信号抽样程序

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

临界抽样及重构程序代码: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;

1 / 4
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功