📄 pr3_36.m
字号:
%Problem 3.36;
%Simulates the RAKE algorithm on the example of LFM bit pulse.
clear all; close all;
t=[1:3000]/500; N=length(t); %time scale;
WD=40; %deviation of LFM bit pulse;
S=exp(i*pi*WD*(t(1:500)-0.5).^2); %complex envelope of bit pulse with different frequency deviations;
Sbp=imag(S.*exp(i*2*pi*25*t(1:500))); %bandpass bit pulse;
Dt=(-1).^unidrnd(2,1,6); %random data bitstream;
tau=[0.116,0.184]*500; tau32=tau(2)-tau(1); tau21=tau(2); %tau-profile, elements within [] are in terms of bit pulse duration;
SD=kron(Dt,Sbp); %bit-stream-manipulated pulses;
q=6; sig=norm(Sbp)/q; %voltage SNR and noise standard deviation;
SR=SD+[zeros(1,tau(1)) SD(1:N-tau(1))]+[zeros(1,tau(2)) SD(1:N-tau(2))]; %superposition of three multipath signals;
Nobs=10; %number of observations;
Ns=normrnd(0,sig,Nobs,N); Y=Ns+ones(Nobs,1)*SR; %Nobs observatios are rows of NobsxN matrix;
subplot(3,1,1); plot(t,Y(1,:)); ylim([-1.2 1.2]*3*sig); xlim([0,3]); ylabel('observation'); grid; %plotting first observation;
MF=filter(Sbp(500:-1:1),1,Y')/(norm(Sbp)^2); MF=MF'; %matched filtering;
subplot(3,1,2); plot(t,MF); ylim([-1.2,1.2]*(1+1/q)); xlim([0.8,1.3]); ylabel('MF out'); grid; %plotting resulting multipath signal;
Rake=MF+[zeros(Nobs,tau32),MF(:,1:N-tau32)]+[zeros(Nobs,tau21),MF(:,1:N-tau21)]; %RAKE combining;
M=max(max(abs(Rake)));
subplot(3,1,3); plot(t,Rake); xlabel('t/T'); xlim([0.8,1.3]); ylim([-1.2,1.2]*M); ylabel('RAKE out'); grid; %plotting RAKE output;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -