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

📄 acquisitionconvolution.m

📁 gps捕获源码
💻 M
字号:
function [codephase,frequency] = acquisitionConvolution(svnum)% Performs acquisition on collected data% Searches for the satellite with number svnum% Returns the code phase and the coarse frequency of the signal% ***** initial conditions *****load data.matx=double(data');fs=11.999e6;	% sampling freqts=1/fs;	% sampling timen=fs/1000;	% data pt in l msnn=[0:n-1];	% total no. of ptsfc0=3.563e6;	% center freq without Doppler% ***** Reads code with 1024 different phasesfilename=sprintf('gold%i.mat',svnum);load(filename);code=double(code(1,:));% ***** DFT of C/A codecodefreq = conj(fft(code));for i=1:41  fc(i) = fc0 + 0.0005e6*(i-21);  expfreq=exp(j*2*pi*fc(i)*ts*nn);  sine= imag(expfreq);		% generate local sine  cosine= real(expfreq);	% generate local cosine   I = sine.*x;  Q = cosine.*x;  IQfreq = fft(I+j*Q);  convcodeIQ = IQfreq .* codefreq;  result(i,:) = abs(ifft(convcodeIQ)).^2;end[peak codephase]=max(max(result));[peak frequency]=max(max(result'));frequency = fc(frequency);codephaseChips = round(1023 - (codephase/11999)*1023)gold_rate = 1.023e6;			% Gold code clock rate in Hzts=1/fs;tc=1/gold_rate;b=[1:n];c=ceil((ts*b)/tc);figure(1)x_axis=c;y_axis=fc/1e6;s=surf(x_axis,y_axis,result);set(s,'EdgeColor','none','Facecolor','interp');axis([min(x_axis) max(x_axis) min(y_axis) max(y_axis) min(min(result)) max(max(result))]);caxis([0 max(max(result))]);xlabel('Code Phase [chips]');ylabel('Frequency [MHz]');zlabel('Magnitude');text=sprintf('SVN %i',svnum);title(text);

⌨️ 快捷键说明

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