您好,欢迎访问三七文档
临界抽样及重构程序代码:wm=1;wc=wm;Ts=pi/wm;ws=2*pi/Ts;n=-100:100;nTs=n*Ts;f=sinc(nTs/pi);Dt=0.005;t=-20:Dt:20;fa=f*Ts*wc/pi*sinc((wc/pi)*(ones(length(nTs),1)*t-nTs'*ones(1,length(t))));subplot(311);plot(t,fa)xlabel('t');ylabel('fa(t)');title('sa(t)=sinc(t/pi)的原信号');grid;t1=-20:0.5:20;f1=sinc(t1/pi);subplot(312);stem(t1,f1);xlabel('kTs');ylabel('f(kTs)');title('sa(t)=sinc(t/pi)的临界采样信号');grid;subplot(313);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.8*pi/wm;ws=2*pi/Ts;n=-100:100;nTs=n*Ts;f=sinc(nTs/pi);Dt=0.005;t=-10:Dt:10;fa=f*Ts*wc/pi*sinc((wc/pi)*(ones(length(nTs),1)*t-nTs'*ones(1,length(t))));subplot(411);plot(t,fa)xlabel('t');ylabel('fa(t)');title('sa(t)=sinc(t/pi)的原信号');grid;error=abs(fa-sinc(t/pi));t1=-10:0.5:10;f1=sinc(t1/pi);subplot(412);stem(t1,f1);xlabel('kTs');ylabel('f(kTs)');title('sa(t)=sinc(t/pi)的采样信号');grid;subplot(413);plot(t,fa)xlabel('t');ylabel('fa(t)');title('由sa(t)=sinc(t/pi)的过采样信号重构sa(t)');grid;subplot(414);plot(t,error);xlabel('t');ylabel('error(t)');title('过采样信号与原信号的误差error(t)');grid;欠抽样及重构程序代码:wm=1;wc=wm;Ts=1.3*pi/wm;ws=2*pi/Ts;n=-100:100;nTs=n*Ts;f=sinc(nTs/pi);Dt=0.005;t=-20:Dt:20;fa=f*Ts*wc/pi*sinc((wc/pi)*(ones(length(nTs),1)*t-nTs'*ones(1,length(t))));error=abs(fa-sinc(t/pi));subplot(411);plot(t,fa)xlabel('t');ylabel('fa(t)');title('sa(t)=sinc(t/pi)的原信号');grid;t1=-20:0.5:20;f1=sinc(t1/pi);subplot(412);stem(t1,f1);xlabel('kTs');ylabel('f(kTs)');title('sa(t)=sinc(t/pi)的采样信号sa(t)');grid;subplot(413);plot(t,fa)xlabel('t');ylabel('fa(t)');title('由sa(t)=sinc(t/pi)的欠采样信号重构sa(t)');grid;subplot(414);plot(t,error);xlabel('t');ylabel('error(t)');title('欠采样信号与原信号的误差error(t)');grid;
本文标题:信号抽样程序
链接地址:https://www.777doc.com/doc-2691272 .html