您好,欢迎访问三七文档
当前位置:首页 > 临时分类 > 实验五(信号抽样与恢复)
实验五信号抽样与恢复一、实验目的学会用MATLAB实现连续信号的采样和重建二、实验原理1.抽样定理若)(tf是带限信号,带宽为m,)(tf经采样后的频谱)(sF就是将)(tf的频谱)(F在频率轴上以采样频率s为间隔进行周期延拓。因此,当sm时,不会发生频率混叠;而当sm时将发生频率混叠。2.信号重建经采样后得到信号)(tfs经理想低通)(th则可得到重建信号)(tf,即:)(tf=)(tfs*)(th其中:)(tfs=)(tf)(snTt=)()(ssnTtnTf)()(tSaTthccs所以:)(tf=)(tfs*)(th=)()(ssnTtnTf*)(tSaTccs=csT)]([)(scsnTtSanTf上式表明,连续信号可以展开成抽样函数的无穷级数。利用MATLAB中的tttc)sin()(sin来表示)(tSa,有)(sin)(tctSa,所以可以得到在MATLAB中信号由)(snTf重建)(tf的表达式如下:)(tf=csT)]([sin)(scsnTtcnTf我们选取信号)(tf=)(tSa作为被采样信号,当采样频率s=2m时,称为临界采样。我们取理想低通的截止频率c=m。下面程序实现对信号)(tf=)(tSa的采样及由该采样信号恢复重建)(tSa:例5-1Sa(t)的临界采样及信号重构;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=-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(211);stem(t1,f1);xlabel('kTs');ylabel('f(kTs)');title('sa(t)=sinc(t/pi)的临界采样信号');subplot(212);plot(t,fa)xlabel('t');ylabel('fa(t)');title('由sa(t)=sinc(t/pi)的临界采样信号重构sa(t)');grid;例5-2Sa(t)的过采样及信号重构和绝对误差分析程序和例4-1类似,将采样间隔改成Ts=0.7*pi/wm,滤波器截止频率该成wc=1.1*wm,添加一个误差函数wm=1;wc=1.1*wm;Ts=0.7*pi/wm;ws=2*pi/Ts;n=-100:100;nTs=n*Tsf=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))));error=abs(fa-sinc(t/pi));%重构信号与原信号误差t1=-15:0.5:15;f1=sinc(t1/pi);subplot(311);stem(t1,f1);xlabel('kTs');ylabel('f(kTs)');title('sa(t)=sinc(t/pi)的采样信号');subplot(312);plot(t,fa)xlabel('t');ylabel('fa(t)');title('由sa(t)=sinc(t/pi)的过采样信号重构sa(t)');grid;subplot(313);plot(t,error);xlabel('t');ylabel('error(t)');title('过采样信号与原信号的误差error(t)');例5-3Sa(t)的欠采样及信号重构和绝对误差分析程序和例4-2类似,将采样间隔改成Ts=1.5*pi/wm,滤波器截止频率该成wc=wm=1三、上机实验内容1.验证实验原理中所述的相关程序;-15-10-5051015-0.500.51kTsf(kTs)sa(t)=sinc(t/pi)的临界采样信号-15-10-5051015-0.500.51tfa(t)由sa(t)=sinc(t/pi)的临界采样信号重构sa(t)-15-10-5051015-101kTsf(kTs)sa(t)=sinc(t/pi)的采样信号-15-10-5051015-202tfa(t)由sa(t)=sinc(t/pi)的过采样信号重构sa(t)-15-10-505101500.51x10-5terror(t)过采样信号与原信号的误差error(t)-15-10-5051015-101kTsf(kTs)sa(t)=sinc(t/pi)的采样信号-15-10-5051015-202tfa(t)由sa(t)=sinc(t/pi)的过采样信号重构sa(t)-15-10-505101500.51terror(t)过采样信号与原信号的误差error(t)2.设f(t)=0.5*(1+cost)*(u(t+pi)-u(t-pi)),由于不是严格的频带有限信号,但其频谱大部分集中在[0,2]之间,带宽wm可根据一定的精度要求做一些近似。试根据以下两种情况用MATLAB实现由f(t)的抽样信号fs(t)重建f(t)并求两者误差,分析两种情况下的结果。(1)wm=2,wc=1.2wm,Ts=1;(2)wm=2,wc=2,Ts=2.5-15-10-505101500.51kTsf(kTs)0.5*(1+cost)*(u(t+pi)-u(t-pi))的采样信号-15-10-5051015-101tfa(t)由0.5*(1+cost)*(u(t+pi)-u(t-pi))的过采样信号重构sa(t)-15-10-5051015012x10-3terror(t)过采样信号与原信号的误差error(t)-15-10-505101500.51kTsf(kTs)0.5*(1+cost)*(u(t+pi)-u(t-pi))的采样信号-15-10-5051015-505tfa(t)由0.5*(1+cost)*(u(t+pi)-u(t-pi))的欠采样信号重构sa(t)-15-10-5051015024terror(t)欠采样信号与原信号的误差error(t)
本文标题:实验五(信号抽样与恢复)
链接地址:https://www.777doc.com/doc-2458935 .html