📄 pr2_54.m
字号:
%Problem 2.54;
%ACF of an arbitrary pulse;
clear all; close all;
t=[0:0.01:1]; %time scale;
S=[linspace(0,1,50),linspace(1,0,51)]; %baseband pulse form;
t1=[-130:130]/100; S1=[zeros(1,130) S zeros(1,30)]/max(S); %wrapping signal by zeros to have nicer view;
subplot(221); plot(t1,S1); axis([-1.30 1.30 -0.2 1.2]); grid; xlabel('t/T'); ylabel('baseband signal'); %plotting baseband signal;
Car=cos(2*pi*t*10); %carrier;
Sbp=S.*Car/max(S); %bandpass signal;
Sbp1=[zeros(1,130) Sbp zeros(1,30)]; %wrapping to have nicer view;
subplot (222); plot(t1,Sbp1); axis([-1.30 1.30 -1.2 1.2]); grid; xlabel('t/T'); ylabel('bandpass signal'); %plotting bandpass signal;
Rbb=xcorr(S)/(S*S'); %baseband ACF
Rbb1=[zeros(1,30) Rbb zeros(1,30)]; %wrapping to have nicer view;
subplot(223); plot(t1,Rbb1);axis([-1.30 1.30 -0.2 1.2]); grid; xlabel('tau/T'); ylabel('baseband ACF'); %plotting baseband ACF;
Rbp1=Rbb1.*cos(2*pi*t1*10); %bandpass ACF;
subplot(224); plot(t1,Rbp1);axis([-1.30 1.30 -1.2 1.2]); grid; xlabel('tau/T'); ylabel('bandpass ACF'); %plotting bandpass ACF;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -