18 lines
596 B
Mathematica
18 lines
596 B
Mathematica
|
|
load tmpEndAcquisitionphase.mat
|
||
|
|
clc
|
||
|
|
%Refine the frequency range to choose the most suitable frequency
|
||
|
|
PRN=3;
|
||
|
|
caCode=generateCAcode(PRN);
|
||
|
|
codeValueIndex=floor((1:10*samplesPerCode)/settings.samplingFreq*settings.codeFreqBasis);
|
||
|
|
longCaCode=caCode((rem(codeValueIndex,1023)+1));
|
||
|
|
xCarrier=signal0DC(codePhase:codePhase+10*samplesPerCode-1).*longCaCode;
|
||
|
|
plot(xCarrier);
|
||
|
|
numPts=8*(2^(nextpow2(length(xCarrier))));
|
||
|
|
|
||
|
|
fftRst=abs(fft(xCarrier,numPts));
|
||
|
|
[fftMax2, fftMaxIndex2] = max(fftxc(5 : numPts/2-5));
|
||
|
|
rangeFreq=(0:numPts)*settings.samplingFreq/numPts;
|
||
|
|
frequency=rangeFreq(fftMaxIndex2)
|
||
|
|
plot(fftRst)
|
||
|
|
|