DSP参考程序.doc

  1. 1、本文档共10页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
DSP参考程序

参考程序 %-----实验1----- %-----ex1_1----- clear all; close all; clc; n = [0:20]; x1 = n.*(stepseq(0,0,20)-stepseq(10,0,20)); x2 = 10*exp(-0.3*(n-10)).*(stepseq(10,0,20)-stepseq(20,0,20)); x = x1+x2; subplot(2,1,1);stem(n,x); xlabel(n);ylabel(x(n));axis([0,20,-1,11]) n=[-10:9]; x=[5,4,3,2,1]; xtilde=x * ones(1,4); xtilde=(xtilde(:)); subplot(2,1,2);stem(n,xtilde); xlabel(n);ylabel(xtilde(n));axis([-10,9,-1,6]) set(gcf,color,w); %-----实验1----- %-----ex1_2----- clear all; close all; clc; n=-4:2;x=[1,-2,4,6,-5,8,10]; [x21,n21]=sigshift(5*x,n,-5); [x22,n22]=sigshift(4*x,n,-4); [x23,n23]=sigadd(x21,n21,x22,n22); [x2,n2]=sigadd(x23,n23,3*x,n); subplot(2,1,1);stem(n2,x2); xlabel(n);ylabel(x_1(n)); n=-4:2;x=[1,-2,4,6,-5,8,10];n4=-10:10; x41=2*exp(0.5*n4);x412=cos(0.1*pi*n4); [x42,n42]=sigmult(x41,n4,x,n); [x43,n43]=sigshift(x,n,-2); [x44,n44]=sigmult(x412,n4,x43,n43); [x4,n4]=sigadd(x42,n42,x44,n44); subplot(2,1,2);stem(n4,x4); xlabel(n);ylabel(x_2(n)); set(gcf,color,w); %-----实验1----- %-----ex1_3----- clear all; close all; clc; n=-5:30;b=[1,-1];a=[1]; x1=n.*(stepseq(0,-5,30)-stepseq(10,-5,30)); x2=(20-n).*[stepseq(10,-5,30)-stepseq(20,-5,30)]; [x2,n2]=sigadd(x1,n,x2,n); subplot(2,1,1);stem(n2,x2); xlabel(n);ylabel(x_2(n)); h=filter(b,a,x2); subplot(2,1,2);stem(n,h); xlabel(n);ylabel(h(n)); set(gcf,color,w); %-----实验2----- %-----ex2_1_1----- clear all; close all; clc; n=-5:30;b=[1,-1];a=[1]; x1=n.*(stepseq(0,-5,30)-stepseq(10,-5,30)); x2=(20-n).*[stepseq(10,-5,30)-stepseq(20,-5,30)]; [x2,n2]=sigadd(x1,n,x2,n); subplot(2,1,1);stem(n2,x2); xlabel(n);ylabel(x_2(n)); h=filter(b,a,x2); subplot(2,1,2);stem(n,h); xlabel(n);ylabel(h(n)); set(gcf,color,w); clear all; close all; clc; t=0:0.001:1;xa=cos(20*pi*t); Ts=0.01;N1=round(1/Ts);n1=0:N1;x1=cos(20*pi*n1*Ts); subplot(3,1,1);plot(t,xa,n1*Ts,x1,o); ylabel(x_1(n));title(Sampling of x_a(t) using Ts=0.01); Ts=0.05;N2=round(1/Ts);n2=0:N2;x2=cos(20*pi*n2*Ts); subplot(3,1,2);plot(t,xa,n2*Ts,x2,o); ylabel(x_2(n));title(Sampling of x_a(t) using

文档评论(0)

ipad0a + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档