欢迎来到淘文阁 - 分享文档赚钱的网站! | 帮助中心 好文档才是您的得力助手!
淘文阁 - 分享文档赚钱的网站
全部分类
  • 研究报告>
  • 管理文献>
  • 标准材料>
  • 技术资料>
  • 教育专区>
  • 应用文书>
  • 生活休闲>
  • 考试试题>
  • pptx模板>
  • 工商注册>
  • 期刊短文>
  • 图片设计>
  • ImageVerifierCode 换一换

    数字信号处理第二章实验报告.docx

    • 资源ID:36113611       资源大小:1.21MB        全文页数:20页
    • 资源格式: DOCX        下载积分:20金币
    快捷下载 游客一键下载
    会员登录下载
    微信登录下载
    三方登录下载: 微信开放平台登录   QQ登录  
    二维码
    微信扫一扫登录
    下载资源需要20金币
    邮箱/手机:
    温馨提示:
    快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如填写123,账号就是123,密码也是123。
    支付方式: 支付宝    微信支付   
    验证码:   换一换

     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    数字信号处理第二章实验报告.docx

    实 验 报 告 课 程: 数字信号处理 专业班级: 学生姓名: 学 号: 年 月 日2.1对M=2,运行上述程序,生成输入xn=s1n+s2n的输出信号。输入xn的哪个分量被该离散时间系统抑制?% 程序 P2_1% 一个M点滑动平均滤波器的仿真% 产生输入信号n = 0:100;s1 = cos(2*pi*0.05*n); % 一个低频正弦s2 = cos(2*pi*0.47*n); % 一个高频正弦x = s1+s2;% M点滑动平均滤波器的实现M = input('滤波器所需的长度 = ');num = ones(1,M);y = filter(num,1,x)/M;clf;subplot(2,2,1);plot(n, s1);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('低频正弦');subplot(2,2,2);plot(n, s2);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('高频正弦');subplot(2,2,3);plot(n, x);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('输入信号');subplot(2,2,4);plot(n, y);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('输出信号'); axis;图形显示如下:答:输入部分的高频成分成分被抑制了。2.3对滤波器长度M和正弦信号s1n和s2n的频率取其他值,运行程序P2.1,算出结果。n = 0:100;s1=cos(2*pi*0.02*n);s2=cos(2*pi*0.46*n);x = s1+s2;% M点滑动平均滤波器的实现M = input('滤波器所需的长度 = ');num = ones(1,M);y = filter(num,1,x)/M;clf;figure,subplot(2,2,1);plot(n, s1);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('低频正弦');subplot(2,2,2);plot(n, s2);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('高频正弦');subplot(2,2,3);plot(n, x);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('输入信号');subplot(2,2,4);plot(n, y);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('输出信号'); axis;num =1,-ones(1,M-1);y = filter(num,1,x)/M;figure,subplot(2,2,1);plot(n, s1);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('低频正弦');subplot(2,2,2);plot(n, s2);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('高频正弦');subplot(2,2,3);plot(n, x);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('输入信号');subplot(2,2,4);plot(n, y);axis(0, 100, -2, 2);xlabel('时间序号n'); ylabel('振幅');title('输出信号'); axis;图形显示如下:答:运行结果如下图,可以看出输出信号保留了输入信号xn的高频分量,即保留了s2n分量,低频部分s1n被抑制了。2.5用不同频率的正弦信号作为输入信号,计算每个输入信号的输出信号。输出信号是如何受到输入信号频率的影响的?从数学上对你的结论加以证明。% 程序P2_2% 产生一个正弦输入信号clf;n = 0:200;f=input('Please input the value of f:')x = cos(2*pi*f*n);% 计算输出信号x1 = x 0 0; % x1n = xn+1 x2 = 0 x 0; % x2n = xnx3 = 0 0 x; % x3n = xn-1y = x2.*x2-x1.*x3;y = y(2:202);% 画出输入和输出信号subplot(2,1,1)plot(n, x)xlabel('时间序列n');ylabel('振幅');title('输入信号')subplot(2,1,2)plot(n,y)xlabel('时间信号n');ylabel('振幅');title('输出信号');分别取F=0.05,F=0.47,F=0.5以及F=0,仿真结果如下所示: 证明:设输入信号为,则以及则答:从图形中可以看出,输入频率越大,输出信号值越小。最后都逐渐趋于0。2.7运行程序P2.3,对由加权输入得到的yn在与相同权系数下输出y1n和y2n相加得到的ytn进行比较,这两个序列是否相等?该系统是线性系统么?clf;n = 0:40;a = 2;b = -3;x1 = cos(2*pi*0.1*n);x2 = cos(2*pi*0.4*n);x = a*x1 + b*x2;num=2.2403 2.4908 2.2403;den = 1 -0.4 0.75;ic = 0 0;y1 = filter(num,den,x1,ic);y2 = filter(num,den,x2,ic); y = filter(num,den,x,ic);yt = a*y1 + b*y2; d = y - yt; subplot(3,1,1)stem(n,y);ylabel('振幅');title('加权输入: a cdot x_1n + b cdot x_2n的输出');subplot(3,1,2)stem(n,yt);ylabel('这幅');title('加权输出: a cdot y_1n + b cdot y_2n');subplot(3,1,3)stem(n,d);xlabel('时间序号 n');ylabel('振幅');title('差信号');图形显示如下:答:该仿真结果说明这两个序列相等,该系统是线性系统。2.9当初始条件非零时重做习题Q2.7。令ic = 10 20;则仿真结论如下所示:答:该仿真结果说明这两个序列不相等,该系统不是线性系统。2.11假定另一个系统为yn=xnxn-1,修改程序P2.3,计算这个系统的输出序列y1n,y2n和yn。比较yn和ytn。这两个序列是否相等?该系统是线性系统吗?n=0:40;a=2;b=-3;x11=0 cos(2*pi*0.1*n) 0;x12=0 0 cos(2*pi*0.1*n);x21=0 cos(2*pi*0.4*n) 0; x22=0 0 cos(2*pi*0.4*n);y1=x11.*x12;y2=x21.*x22;yt=a*y1+b*y2;y=(a*x11+b*x21).*(a*x12+b*x22);d=y-yt;subplot(3,1,1)stem(0 n 0,y);ylabel('振幅');title('加权输入: a cdot x_1n + b cdot x_2n的输出');subplot(3,1,2)stem(0 n 0,yt);ylabel('这幅');title('加权输出: a cdot y_1n + b cdot y_2n');subplot(3,1,3)stem(0 n 0,d);xlabel('时间序号 n');ylabel('振幅');title('差信号');图形显示如下:答:这两个序列不相等,该系统不是线性系统。2.13采用三个不同的延时变量D的值重做习题Q2.12。D=2;D=6;D=12;显示图形如下:答:该系统是时不变系统,满足yn-D=ydn。2.15在非零的初始条件下重做习题Q2.12,该系统是时不变系统吗?clf;n = 0:40; D = 10;a = 3.0;b = -2;x = a*cos(2*pi*0.1*n) + b*cos(2*pi*0.4*n);xd = zeros(1,D) x;num = 2.2403 2.4908 2.2403;den = 1 -0.4 0.75;ic = 5 10; y = filter(num,den,x,ic);yd = filter(num,den,xd,ic);d = y - yd(1+D:41+D);subplot(3,1,1)stem(n,y);ylabel('Õñ·ù'); title('Êä³ö yn'); grid;subplot(3,1,2)stem(n,yd(1:41);ylabel('Õñ·ù');title('ÓÉÓÚÑÓʱÊäÈë xn-10µÄÊä³ö'); grid;subplot(3,1,3)stem(n,d);xlabel('ʱ¼äÐòºÅ n'); ylabel('Õñ·ù');title('²îÖµÐźÅ');grid;图形显示如下:答:该仿真结果说明该系统是时变系统。2.17考虑另一个系统:yn=nxn+xn-1,修改程序P2.4,以仿真上面的系统并确定该系统是否为时不变系统。clf;n = 0:40; D = 10;a = 3.0;b = -2;x = a*cos(2*pi*0.1*n) + b*cos(2*pi*0.4*n);xd = zeros(1,D) x;nd=0:length(xd)-1;y=(n.*x)+0 x(1:40);yd=(nd.*xd)+0 xd(1:length(xd)-1);d = y - yd(1+D:41+D);subplot(3,1,1)stem(n,y);ylabel('振幅'); title('输出 yn'); grid;subplot(3,1,2)stem(n,yd(1:41);ylabel('振幅');title('由于延时输入 xn-10的输出'); grid;subplot(3,1,3)stem(n,d);xlabel('时间序号 n'); ylabel('振幅');title('差值信号');grid;图形显示如下:答:从仿真结果看,该系统是时变系统。2.19运行程序P2.5,生成式(2.15)所给的离散系统的冲激响应。clf;N=40;num=2.2403 2.4908 2.2403;den=1 -0.4 0.75;y=impz(num,den,N);%画出冲激相应stem(y);xlabel('时间序号n');ylabel('振幅'); title('冲激响应');grid;图形显示如下:2.21利用filter命令编写一个MATLB程序,生成式(2.17)给出的因果线性时不变系统的冲激响应,计算并画出前40个的样本。把你的结果和习题Q2.20中得到的结果相比较。clf;N = 40;num = 0.9 -0.45 0.35 0.002;den = 1.0 0.71 -0.46 -0.62;% input: unit pulsex = 1 zeros(1,N-1);% outputy = filter(num,den,x);% Plot the impulse response% NOTE: the time axis will be WRONG; h0 will% be plotted at n=1; but this will agree with% the INCORRECT plotting that was also done% by program P2_5.stem(y);xlabel('Time index n'); ylabel('Amplitude');title('Impulse Response'); grid;图形显示如下:答:两题结果一样。2.23运行程序P2.6,计算输出序列yn和y2n以及差值信号dn。yn和y2n相等吗?% Program P2_6% Cascade Realizationclf;x = 1 zeros(1,40); % Generate the inputn = 0:40;% Coefficients of 4th order systemden = 1 1.6 2.28 1.325 0.68;num = 0.06 -0.19 0.27 -0.26 0.12;% Compute the output of 4th order systemy = filter(num,den,x);% Coefficients of the two 2nd order systemsnum1 = 0.3 -0.2 0.4;den1 = 1 0.9 0.8;num2 = 0.2 -0.5 0.3;den2 = 1 0.7 0.85;% Output y1n of the first stage in the cascadey1 = filter(num1,den1,x);% Output y2n of the second stage in the cascadey2 = filter(num2,den2,y1);% Difference between yn and y2nd = y - y2;% Plot output and difference signalssubplot(3,1,1);stem(n,y);ylabel('Amplitude');title('Output of 4th order Realization'); grid;subplot(3,1,2);stem(n,y2)ylabel('Amplitude');title('Output of Cascade Realization'); grid;subplot(3,1,3);stem(n,d)xlabel('Time index n');ylabel('Amplitude');title('Difference Signal'); grid;图形显示如下:答:y(n)和y2(n)相等。2.25用任意的非零初始向量ic,ic1和ic2来重做习题Q2.23。clf;x=sin(2*pi*0.2*n); % Generate the inputn = 0:40;% Coefficients of 4th order systemden = 1 1.6 2.28 1.325 0.68;num = 0.06 -0.19 0.27 -0.26 0.12;xi=1 2 3 4;% Compute the output of 4th order systemy = filter(num,den,x,xi);% Coefficients of the two 2nd order systemsnum1 = 0.3 -0.2 0.4;den1 = 1 0.9 0.8;num2 = 0.2 -0.5 0.3;den2 = 1 0.7 0.85;xi1=1 2;% Output y1n of the first stage in the cascadey1 = filter(num1,den1,x,xi1);xi2=3 4;% Output y2n of the second stage in the cascadey2 = filter(num2,den2,y1,xi2);% Difference between yn and y2nd = y - y2;% Plot output and difference signalssubplot(3,1,1);stem(n,y);ylabel('Amplitude');title('Output of 4th order Realization'); grid;subplot(3,1,2);stem(n,y2)ylabel('Amplitude');title('Output of Cascade Realization'); grid;subplot(3,1,3);stem(n,d)xlabel('Time index n');ylabel('Amplitude');title('Difference Signal'); grid;图形显示如下:答:y(n)和y2(n)不相等。2.27用任意非零初始向量ic,ic1和ic2来重做习题Q2.26。% Program P2.27% Cascade Realizationclf;x = 1 zeros(1,40); % Generate the inputn = 0:40;% Coefficients of 4th order systemden = 1 1.6 2.28 1.325 0.68;num = 0.06 -0.19 0.27 -0.26 0.12;ic=4 10 2 12% Compute the output of 4th order systemy = filter(num,den,x,ic);% Coefficients of the two 2nd order systemsnum1 = 0.3 -0.2 0.4;den1 = 1 0.9 0.8;num2 = 0.2 -0.5 0.3;den2 = 1 0.7 0.85;% Output y1n of the first stage in the cascadey1 = filter(num2,den2,x,ic(1:2);% Output y2n of the second stage in the cascadey2 = filter(num1,den1,y1,ic(3:4);% Difference between yn and y2nd = y - y2;% Plot output and difference signalssubplot(3,1,1);stem(n,y);ylabel('Amplitude');title('Output of 4th order Realization'); grid;subplot(3,1,2);stem(n,y2)ylabel('Amplitude');title('Output of Cascade Realization'); grid;subplot(3,1,3);stem(n,d)xlabel('Time index n');ylabel('Amplitude');title('Difference Signal'); grid;图形显示如下:答:由结果表明,两个输出结果有没差别。有差别证明级联的顺序不可以互换,这里是一个验证程序。2.29修改程序P2.7,计算长度为15的序列hn和长度为10的序列xn的卷积,重做问题Q2.28。hn和xn的样本值你自己给定。% Program P2.29clf;h = 3 2 1 -2 1 0 -4 0 3 1 5 4 0 3 5; % impulse responsex = 1 -2 3 -4 3 2 1 5 6 1; % input sequencey = conv(h,x);n = 0:23;subplot(2,1,1);stem(n,y);xlabel('Time index n'); ylabel('Amplitude');title('Output Obtained by Convolution'); grid;x1 = x zeros(1,14);y1 = filter(h,1,x1);subplot(2,1,2);stem(n,y1);xlabel('Time index n'); ylabel('Amplitude');title('Output Generated by Filtering'); grid;图形显示如下:答:xn后面补零数应为x(n)和hn序列的长度之和减一,为14.2.31使用命令break的目的是什么?答:使用命令break是使当在k未到最后一个数值是此时的值已经小于时,跳出for循环。2.33考虑用差分方程描述的离散时间系统。修改程序P2.8,计算并画出上述系统的冲激响应。该系统稳定吗?% values of the impulse response samplesclf;num = 1 -4 3; den = 1 -1.7 1;N = 200;h = impz(num,den,N+1);parsum = 0;for k = 1:N+1; parsum = parsum + abs(h(k); if abs(h(k) < 10(-6), break, endend% Plot the impulse responsen = 0:N;stem(n,h)xlabel('Time index n'); ylabel('Amplitude');% Print the value of abs(h(k) disp('Value =');disp(abs(h(k);图形显示如下:答:该系统不稳定。2.35修改程序P2.9,将输入序列改变成扫频正弦序列(长度为301、最低频率为0、最高频率为0.5)。那个滤波器能更好的抑制输入信号xn的高频分量?% Program P2_9% Generate the input sequenceclf;n = 0:300;a=pi/600;arg=a*n.*n;x=cos(arg);%x1 = cos(2*pi*10*n/256);%x2 = cos(2*pi*100*n/256);%x = x1+x2;% Compute the output sequencesnum1 = 0.5 0.27 0.77;y1 = filter(num1,1,x); % Output of System #1den2 = 1 -0.53 0.46;num2 = 0.45 0.5 0.45;y2 = filter(num2,den2,x); % Output of System #2% Plot the output sequencessubplot(2,1,1);plot(n,y1);axis(0 300 -2 2);ylabel('Amplitude');title('Output of System #1'); grid;subplot(2,1,2);plot(n,y2);axis(0 300 -2 2);xlabel('Time index n'); ylabel('Amplitude');title('Output of System #2'); grid;图形显示如下:答:由输出结果图形可以看出:y2滤波器能更好地抑制输入信号xn的高频分量。

    注意事项

    本文(数字信号处理第二章实验报告.docx)为本站会员(叶***)主动上传,淘文阁 - 分享文档赚钱的网站仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知淘文阁 - 分享文档赚钱的网站(点击联系客服),我们立即给予删除!

    温馨提示:如果因为网速或其他原因下载失败请重新下载,重复下载不扣分。




    关于淘文阁 - 版权申诉 - 用户使用规则 - 积分规则 - 联系我们

    本站为文档C TO C交易模式,本站只提供存储空间、用户上传的文档直接被用户下载,本站只是中间服务平台,本站所有文档下载所得的收益归上传人(含作者)所有。本站仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。若文档所含内容侵犯了您的版权或隐私,请立即通知淘文阁网,我们立即给予删除!客服QQ:136780468 微信:18945177775 电话:18904686070

    工信部备案号:黑ICP备15003705号 © 2020-2023 www.taowenge.com 淘文阁 

    收起
    展开