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

📄 pr2_56.m

📁 Spread Spectrum and CDMA Principles and Applications 书籍和代码
💻 M
字号:
%Problem 2.56;
%Simulating dependence of time estimation accuracy on signal bandwidth;

clear all; close all;
t1=[0:0.01:2]; t2=[0:0.001:2.009]; N=length(t1); %time scales;
WD=[0 50]; %set deviations of LFM-signal;
S=((ones(2,1)*exp(-20*(t1-1/2).^2)).*exp(i*pi*WD'*((t1-1/2).^2))); %two rows are LFM complex envelopes for two deviation values;
Ovs=ones(1,10); %will be used in oversampling to plot bandpass signals;
Sov=kron(S,Ovs); %oversampled complex envelopes;
SI1=real(Sov.*kron(ones(2,1),exp(2*i*pi*25*t2))); %SI1=[SI1,zeros(2,1000)]; %2 rows are bandpass LFM-signals with different deviations;
Nobs=100; %set number of observations;
q=6;
for k=1:2 %the loop do thesame for both signals;
    subplot(3,2,k); plot(t2,SI1(k,:)); xlim([0,2]); ylim([-1.2 1.2]); grid; ylabel('s(t)');  %plotting LFM signal for k-th deviation;
    Sou=xcorr(S(k,:))/(norm(S(k,:)))^2; Sou=Sou(100:300); Souv=kron(Sou,Ovs); Sou=real(Souv.*exp(2*i*pi*25*t2)); %pure matched filtered signal;
    subplot(3,2,k+2); plot(t2,Sou); grid; xlim([0,2]); ylim([-1.2 1.2]); ylabel('noiseless MF output'); %plotting pure matched filtered signal;
    nsig=norm(S(k,:))/(q*sqrt(2));
    No=normrnd(0,nsig,Nobs,N+100)+i*normrnd(0,nsig,Nobs,N+100); %Nobs complex noise waveforms;
    Y=No+[zeros(Nobs,100),kron(ones(Nobs,1),S(k,:))]; %matrix of complex envelopes of Nobs observations for k-th deviation, front zeros are added to make the filtering stationary;
    SO=abs(filter(S(k,101:-1:1),1,Y'))/(norm(S(k,:))^2); %observed real envelope at the matched filter output;
    SO=SO';SO=SO(:,101:end); %dropping the segment corresponding to front zeros;
    subplot(3,2,k+4); plot(t1,SO(1:10,:));grid; xlabel ('t/T'); ylim([0 1.5]); ylabel('MF output envelope'); %plotting MF output envelope;
    [A,B]=max(SO'); tau=(B-1)*0.01-1; Ext(k)=mean(tau); Sig(k)=std(tau); %mean and variance of estimation;
end;
disp('    SNR        dev      AvEst      Sigma');
disp([[q,q]',WD',Ext',Sig']); %outputting deviation, averaged delay estimate, and experimental standard deviation of estimate;

⌨️ 快捷键说明

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