Hello
1-Does anyone know how to generate the CA code for GPS
PRN_6_CA=dec2base(1455,2);
PRN_16_CA=dec2base(1776,2);
PRN_26_CA=dec2base(1761,2);
x=1;
G_1=1+x^3+x^10;
j=1;
k=10;
for i=1:1023
for j=1:10;
x(j)=
ca_1(i,:)=[x1 x2 x3 x4 x5 x6 x7 x8 x9 x10];
y=x3+x5;
end
if y==2
x1=0;
else x1=1
end
if G_1==(G_1/2)
y=x3+x5;
if y==2
x2=0;
else x2=1
end
i=i+1;
k=k+1;
end
end
I want to know how to shift the first value to right side if we have 10 value in the one row. So new data is entering at 1st place is sum of the 3rd and 10th place then convert it into binary form which is new value at 1st position. Hence we have to do till 1023 times.
One can see the video to know more what we have to do in the exercise.

 채택된 답변

Kaashyap Pappu
Kaashyap Pappu 2019년 11월 27일
편집: Kaashyap Pappu 2020년 1월 14일

0 개 추천

You can use the comm.PNSequence object to generate the gold code for both generators. For the second generator, you will have to set the mask property to the appropriate phase delay polynomial, and number of bits out as 1023.
chips = 1023;
genG1 = [10 7 0]; % 1 + x^3 + x^10
initVector =[1 1 1 1 1 1 1 1 1 1];
generator = comm.PNSequence('Polynomial',genG1,...
'InitialConditions',initVector,'SamplesPerFrame',chips);
Generate similarly for generator G2 using the phase delay polynomial as the mask, add both sequences using Modulo-2 addition using xor and you will have your sequence.
Hope this helps!

댓글 수: 5

vimal kumar chawda
vimal kumar chawda 2019년 12월 3일
Hello Sir
I have tried on matlab example but my file is showning that class is not define. May i know why? As matlab example should be workout but why it is not working out? What maybe the rasons.
Kaashyap Pappu
Kaashyap Pappu 2019년 12월 5일
편집: Kaashyap Pappu 2020년 1월 16일
The comm.PNSequence object works only if the Communications Toolbox is installed.
vimal kumar chawda
vimal kumar chawda 2019년 12월 5일
Hello Sir
1-In this mask is our initial vector. What does mask means ? for every respective satellite i have to set up the data or algorithm such set up is known as mask?
2- What should be Genpoly?
3-what is InitialStates? What type of value does it take like chip is 1023.
4-CurrentStates means ?
5- What does ... means ?
As per my understanding the blue data is reference and i have to substitute the value or data at beside that in black color like genG1,initVector..
Kaashyap Pappu
Kaashyap Pappu 2019년 12월 16일
  1. The mask would be the phase selection polynomial for each satellite vehicle. You can use a switch case setup for each satellite separately.
  2. Generator polynomial is given the in the technical specification. Specify powers of X as a vector.
  3. Initial states is a binary vector indication the starting state of the Linear Feedback Shift Register setup.
  4. Current state is the current output values for each the registers.
  5. ... is basically to inform the MATLAB compiler that the command is continued on the next line. This is used for readability.
The Blue data indicate properties of the specific object. The black highlighted variables are the user defined property values.
ScubaNinjaDog
ScubaNinjaDog 2022년 9월 6일
But the ouput of the second generator is not directly used like with the first generator.

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Rajkumar Mishra
Rajkumar Mishra 2020년 9월 17일

0 개 추천

Hello,
in the solution above is not the second term be '3' inplace of '7' as mentioned in this line
genG1 = [10 7 0]; % 1 + x^3 + x^10
Markandeya Janaswamy
Markandeya Janaswamy 2023년 3월 1일

0 개 추천

From R2021b, Satellite Communications Toolbox supports generating C/A-codes. Use the function gnssCACode. See https://mathworks.com/help/satcom/ref/gnsscacode.html

카테고리

도움말 센터File Exchange에서 Time Series Objects에 대해 자세히 알아보기

제품

릴리스

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by