1、一、b=0,0,1; %生成向量 b a=0.08,0.4,1; %生成向量 a h,w=freqs(b,a,100); %求系统响应函数 H(j?),设定 100 个频率点h1=abs(h); %求幅频响应h2=angle(h); %求相频响应subplot(2,1,1); plot(w,h1); grid; xlabel(角频率(W); ylabel(幅度); title(H(jw)的幅频特性); subplot(2,1,2); plot(w,h2*180/pi); grid; xlabel(角频率(w); ylabel(相位(度); title(H(jw)的相频特性); 二、wm=1;
2、%信号带宽wc=wm; %滤波器截止频率Ts=pi/wm; %采样间隔ws=2*pi/Ts; %采样角频率n=-100:100; %时域采样点数nTs=n*Ts ;%时域采样点f=sinc(nTs/pi); Dt=0.005;t=-15:Dt:15; fa=f*Ts*wc/pi*sinc(wc/pi)*(ones(length(nTs),1)*t-nTs*ones(1,length (t); %信号重构t1=-15:0.5:15; f1=sinc(t1/pi); subplot(2,1,1); stem(t1,f1); xlabel(kTs); ylabel(f(kTs); title(sa(
3、t)=sinc(t/pi)的临界采样信号); subplot(212); plot(t,fa); xlabel(t); ylabel(fa(t); title(由 sa(t)=sinc(t/pi)的临界采样信号重构 sa(t); grid;三、wm=1; %信号带宽wc=1.1*wm; %滤波器截止频率Ts=0.7*pi/wm; %采样间隔ws=2*pi/Ts; %采样角频率n=-100:100; nTs=n*Ts; f=sinc(nTs/pi); Dt=0.005;t=-15:Dt:15; fa=f*Ts*wc/pi*sinc(wc/pi)*(ones(length(nTs),1)*t-nT
4、s*ones(1,length (t); %信号重构error=abs(fa-sinc(t/pi); %求重构信号与原信号的误差t1=-15:0.5:15; f1=sinc(t1/pi); subplot(3,1,1); stem(t1,f1); xlabel(kTs); ylabel(f(kTs); title(sa(t)=sinc(t/pi)的采样信号); subplot(3,1,2); plot(t,fa); xlabel(t); ylabel(fa(t); title(由 sa(t)=sinc(t/pi)的过采样信号重构 sa(t); grid; subplot(3,1,3); plot(t,error); xlabel(t); ylabel(error(t); title(过采样信号与原信号的误差 error(t);