📄 pr6_45.m
字号:
%Problem 6.45
%Perfect PACF signals resolution (BProb 6.45); pftrb;
clear all, close all;
A=[1 1 1 1 1 -1 1 0 1 0 -1 1 1 -1 0 0 1 -1 0 -1 -1]; A=kron(ones(1,4),A); %4 code periods;
S=kron(A,ones(1,100)); %signal complex envelope;
t=[1:length(S)]/100; %time scale;
f0=5; car=exp(i*2*pi*f0*t); %carrier CW of frequency f0;
Sg=imag(S.*car); N=length(Sg); %bandpass signal manipulated by ternary code and length of signal vector;
subplot(411); plot(t,Sg); ylim([-1.2 1.2]); xlim([0,84]); ylabel('signal'); grid; %plotting input;
tau=floor([2.5,5.8]*100); Amp=[0.25,0.125]; %delays and amplitudes of delayed signal replicas;
Sd=diag(Amp)*[zeros(1,tau(1)),Sg(1:N-tau(1));zeros(1,tau(2)),Sg(1:N-tau(2))]; %delayed signal copies;
subplot(412);
plot(t,Sd(1,:)); ylim([-1.2 1.2]); xlim([0,84]); ylabel('1st delayed sgn'); grid; %plotting first delayed signal;
Sr=Sg+sum(Sd); %resulting signal;
subplot(413); plot(t,Sr); ylim([-1.5 1.5]); xlim([0 84]); ylabel('MF input'); grid; %plotting matched filter input;
Smf=filter(Sg(2100:-1:1),1,Sr)/(Sg*Sg'/4); %matched filtering of the resultant signal;
subplot(414);plot(t,Smf); ylim([-1.2 1.2]); xlim([0 84]); ylabel('MF output'); xlabel('t/\Delta'); grid; %plotting matched filter response;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -