# GPS Receiver in Frequency Domain

I'm trying to transmit and receiver the GPS payload in both Time and Frequency Domain.

For transmitting and receiving in time domain :

numBits = 10;                        % LFSR length
codeLength = 2^numBits-1;           % Spreading code length

%% PN code generation

% initial sequence is taken from IRNSS document
goldCode1 = generateGoldCode(935,239,codeLength,numBits);
goldCode1 = 2*goldCode1-1;                        % Assign code to 1 to 1 and -1 to 0

goldCode2 = generateGoldCode(38,381,codeLength,numBits);
goldCode2 = 2*goldCode2-1;

goldCode3 = generateGoldCode(564,561,codeLength,numBits);
goldCode3 = 2*goldCode3-1;

%% At transmitter part

%% Time Domain
crossCorr = xcorr2(TxData,goldCode2);
outputData = crossCorr(codeLength:codeLength:end)/codeLength;


For Frequency domain I want to receive each bit at a time:

starting =1;
i=0;
crossCorr_temp=[zeros(1,100)] ;
goldCodeFFT = conj(fft(goldCode2));
for val = 1023:1023:length(TxData)
corr_time = crossCorr_FFT(1:end)/codeLength; **#Doubt here**
starting = starting +1023;
i=i+1;
end


How do I approach this frequency-domain way to receive the GPS payload bits?

• Why do you multiply each payload by a different constant (1,2,3)? Are you emulating different received signal strength of each? To start to address real receiver issues, you'll want to introduce a random Doppler offset (anywhere within + /- 2.5KHz would be typical), a random sampling time offset (so you will want to have multiple samples per chip to do this), and a random starting position offset in your receiver. If you can deal with all three of those uncertainties in your receiver you will be prepared to receive actual signals. – Dan Boschen Dec 26 '19 at 13:39

$$corr(a,b) = ifft(fft(a)fft(b)^*)$$