📄 pr6_40.m
字号:
%Problem 6.40;
%simulating masking of a weaker signal by ACF sidelobes of the stronger one
%in time-resolution (Prob.6.40);
clear all; close all;
A=[1 1 1 -1 1 -1 1 -1 1 -1 1;1 -1 1 1 -1 1 1 1 -1 -1 -1]; N=size(A,2); %two binary codes, the second having better ACF;
f0=10; %carrier frequency
Ch=cos(2*pi*f0*[0:0.01:0.99]); %bandpass chip;
tau=399; al=0.4; %delay and intensity of a delayed copy;
t=[0:0.01:2*N+tau*0.01-0.02]; %time scale;
for k=1:2 %the same operations for both signals;
S=kron(A(k,:),Ch); R=xcorr(S)/(S*S'); R1=[R,zeros(1,tau)]; R2=al*[zeros(1,tau),R]; %matched filtering of direct and delayed replicas;
subplot(3,2,k); plot(t,R1); ylabel('S_{mf}(t)'); xlim([0,2*N+tau*0.01-0.1]); ylim([-1.2,1.2]); grid; %MF response for non-delayed signal;
subplot(3,2,k+2); plot(t,R2); ylabel('a*S_{mf}(t-\tau)'); xlim([0,2*N+tau*0.01-0.1]); ylim([-1.2,1.2]); grid; %MF response for delayed signal;
subplot(3,2,k+4); plot(t,R1+R2); ylabel('y(t)'); xlabel('t/\Delta'); xlim([0,2*N+tau*0.01-0.1]); ylim([-1.2,1.2]); grid; %MF response to superposition of direct and delayed signals;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -