⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mnoncoh.m

📁 Non coherent GPS signal acquistion file in MATLAB
💻 M
字号:
%programm for noncoherent integration of cacode1865
close all;
clear all;
fs = 5.714e6;
int_time = 1;
dv = 0;
chint = 1;
d1ms = chint*fs/1000;  % multiply to get coherent integartion
dms = fs /1000;
d1msda = [1:d1ms];
dp = [1:int_time*d1ms];
prd = 2* pi*1/fs *d1msda;
fres = 1e3/chint;
fbin = 10*chint+1;
fbinb2 = 5*chint+1;
fid = fopen('d:\datafiles\a1.dat','r');
pdata = fscanf(fid,'%1d',dv*dms+int_time*d1ms);
fclose(fid);

tic;
for i=1:length(pdata);
   if pdata(i) == 0
      pdata(i) = -1;
   end
end
data=pdata;
pdata = pdata';
idata = pdata(1,dms*dv+1:dv*dms+int_time*d1ms);
iffrq =4.292e6;
aif = mod(4.292e6,fs); 
if aif >=fs/2
   aif = fs-aif
end

for svnum =4
   ;
   svnum
   ca =cacode(fs,svnum,d1ms,1);	
   yy = zeros(fbin,d1ms)+zeros(fbin,d1ms);
   for it = 1:int_time;
      it;
      bdata1 = idata(1,1+(it-1)*d1ms:it*d1ms);
      bda = fft(bdata1);
      
     for i =1 :fbin;
         i;
         fc = aif+(i-fbinb2)*fres;
         %fc =   309700+(i-fbinb2)*1
         fcdata = exp(j*fc*prd);
         bdata = ca.*fcdata;
         bfft = fft(bdata);
         bfft = conj(bfft);
         rdata = bfft.* bda;
         xx = ifft(rdata);
         pp = abs(xx).^2;
         yy(i,:) = yy(i,:)+pp;
           
      end
   end
   yy = yy/int_time;
   %yy = yy/(max(max(yy)));
   
   [amp row] = max(max(abs(yy)))
   [amp col] = max(max(abs(yy')))
    fc = aif+(col-fbinb2)*fres
   rv(svnum,:)= abs(yy(col,:));
   amps(svnum) = amp;
   stdv(svnum) = std(rv(svnum,:));
   plot(abs(yy(col,1:dms))/amp)
%title(['GPS = ' num2str(svnum)     'max at= 'num2str(pt_init)])

%figure
%plot(abs(yy(:,row)),'*')
%title (['GPS= ' num2str(svnum)     'Freq= 'num2str(frr) 'Hz'])

  % figure
 % plot((yy(col,:)/amp));
toc;  
end


    





      
   
   
   







⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -