版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、南通大学DSP课程设计实验加课后习题程序实验一n=-50:50;u=(n>=0;e=(0.8.n;x1=e.*u;u1=(n>=4;u2=(n>=5;x2=(u1-u2;u3=(n>=0;u4=(n>=4;x2=(u3-u4;subplot(4,1,1;stem(n,u,'.'subplot(4,1,2;stem(n,x1,'.'subplot(4,1,3;stem(n,x2,'.'subplot(4,1,4;stem(n,x3,'.'实验二n=-100:100;x1=(n>=-2&(n
2、<2;w=-2*pi:0.01:2*pi;X1=x1*exp(-j*n'*w;x=eps.m;x2=x1.*x;X2=x2*exp(-j*n'*w;x3=(n>=0&(n<4;X3=x3*exp(-j*n'*w;figure(1plot(w,abs(X1;figure(2plot(w,abs(X2;figure(3plot(w,abs(X3;实验三N1=64;N2=64;N3=100;n1=0:N1-1;n2=0:N2-1;n3=0:N3-1;x1=(n1>=0&(n1<8;X1=fft(x1,N1;x21=a11+a21+
3、a31;x22=a12+a22+a32;X21=fft(x21,N1;X22=fft(x22,N2;x3=a4+a5+a6;X3=fft(x3,N3N4=250;n4=0:N4-1;u1=(n4>=0;u2=(n4>=N4;x4=a7+a8+a9;y1=u1-u2;y2=hamming(N4;x41=x4.*y1;x42=x4.*y2'X41=fft(x41,N4;X42=fft(x42,N4;figure(1stem(n1,abs(X1,'.'figure(2subplot(2,1,1;stem(n1,abs(X21,'.'subplot(
4、2,1,2;stem(n2,abs(X22,'.'figure(3stem(n3,abs(X3,'.'figure(4subplot(2,1,1;stem(n4,abs(X41,'.'subplot(2,1,2;stem(n4,abs(X42,'.'subplot(2,1,1;stem(n,abs(X41,'.'subplot(2,1,2;stem(n,abs(X42,'.'实验四dt=0.0005;t=-0.005:dt:0.005;xa=exp(-1000*abs(t;n=-500:500;w=
5、-3*pi:0.001:3*pi;Ts1=1/20000;Ts2=1/5000;Ts3=1/1000;x1=exp(-1000*abs(n*Ts1;x2=exp(-1000*abs(n*Ts2;x3=exp(-1000*abs(n*Ts3;X1=x1*exp(-j*n'*w;X2=x2*exp(-j*n'*w;X3=x3*exp(-j*n'*w;figure(1;plot(t,xa;figure(2subplot(3,1,1;stem(w,abs(X1subplot(3,1,2;stem(w,abs(X2subplot(3,1,3;stem(w,abs(X3实验五A=1
6、,-3.1836,4.6223,-3.7795,1.8136,-0.48,0.0544;B=0.0004,0.0022,0.0056,0.0075,0.0056,0.0022,0.0004;figure(1;H,w=freqz(B,A;plot(w,abs(H,''figure(2;h=impz(B,A;stem(h,'.'figure(3;zplane(B,A;z=roots(Bp=roots(Ax=-4,-2,0,-4,-6,-4,-2,-6,-6,-4,-4,-6,-6,-2,6,12,8,0,-16,-38,-60,-84,-90,-66,-32,-4,
7、-2,-4,8,12,12,10,6,6,4,0,0,0,0,0,-2,-2,0,0,-2,-2,-2,-2,0;figure(4;y=filter(B,A,x;stem(yA=1,-3.1836,4.6223,-3.7795,1.8136,-0.48,0.0544;B=0.0004,0.0022,0.0056,0.0075,0.0056,0.0022,0.0004;figure(1;H,w=freqz(B,A;plot(w,abs(H,''figure(2;h=impz(B,A;stem(h,'.'figure(3;zplane(B,A;z=roots(Bp=
8、roots(Ax=-4,-2,0,-4,-6,-4,-2,-6,-6,-4,-4,-6,-6,-2,6,12,8,0,-16,-38,-60,-84,-90,-66,-32,-4,-2,-4,8,12,12,10,6,6,4,0,0,0,0,0,-2,-2,0,0,-2,-2,-2,-2,0;figure(4;y=filter(B,A,x;subplot(2,1,1;stem(xsubplot(2,1,2;stem(y实验六Fs=5000;b,a=butter(3,pi/4*Fs,'s'c,d=impinvar(b,a,Fs;H,w=freqz(c,d;figure(1subp
9、lot(2,1,1plot(w/pi,abs(H;ylabel('³å»÷ÏìÓ¦²»±ä·¨'m,n=bilinear(b,a,Fs;M,w=freqz(m,n;subplot(2,1,2plot(w/pi,abs(M;ylabel('Ë«ÏßÐԱ任·¨'grid;wp=0.4*pi;ws=0.5*
10、pi;ap=3;as=20;N,wn=buttord(wp/pi,ws/pi,ap,as;b,a=butter(N,wn,'low'figure(2freqz(b,a;n=0:47;x=1+cos(pi*n/4+cos(2*pi*n/3;y=filter(b,a,x;figure(3subplot(2,1,1;plot(n,x;grid;subplot(2,1,2;plot(n,y;grid;ws=0.4*pi;wp=0.5*pi;ap=3;as=20;N,wn=buttord(wp/pi,ws/pi,ap,as;b,a=butter(N,wn,'high'fi
11、gure(4freqz(b,a;n=0:47;x=1+cos(pi*n/4+cos(2*pi*n/3;y=filter(b,a,x;figure(5subplot(2,1,1;plot(n,x;grid;subplot(2,1,2;plot(n,y;grid;wp=0.2*pi 0.48*pi;ws=0.1*pi 0.55*pi;ap=3;as=20;N,wn=buttord(wp./pi,ws./pi,ap,as;b,a=butter(N,wn,'bandpass'figure(6freqz(b,a;n=0:47;x=1+cos(pi*n/4+cos(2*pi*n/3;y=f
12、ilter(b,a,x;figure(7subplot(2,1,1;plot(n,x;grid;subplot(2,1,2;plot(n,y;grid;实验七N=25;wn=0.6;b=fir1(N,wn,hamming(N+1;H,w=freqz(b,1;figure(1n=0:N;stem(b,'.'gridfigure(2plot(w/pi,20*log10(abs(H;gridb2=fir1(N,wn,boxcar(N+1;H2,w=freqz(b2,1;figure(3n=0:N;stem(b2,'.'gridfigure(4plot(w/pi,20*
13、log10(abs(H2;gridb3=fir1(N,wn,blackman(N+1;H3,w=freqz(b3,1;figure(5n=0:N;stem(b3,'.'gridfigure(6plot(w/pi,20*log10(abs(H3;gridN2=30;wn2=0.3 0.6;b4=fir1(N2,wn2,hamming(N2+1;H4,w=freqz(b4,1;figure(7n=0:N;stem(b4,'.'gridfigure(8plot(w/pi,20*log10(abs(H4;grid习题一n=-12:12;x=(n>=-2&(
14、n<2;x0=(2.nx1=x.*x0;subplot(3,1,1;stem(n,x1,'.'x01=(n>=-4&(n<4;x02=(n>-4&(n<=4;x2=x02-x01;subplot(3,1,2;stem(n,x2,'.'x3=cos(0.3*pi*n;subplot(3,1,3;stem(n,x3,'.'习题二n=-50:50;N1=16;n1=0:N1-1;N2=25;n2=0:N2-1;N3=32;n3=0:N3-1;N4=50;n4=0:N4-1;w=-2*pi:0.01:2*pi
15、;x01=(n>=0;x02=(n>=32;x0=x01-x02;figure(1X1=dtft(x1,n,w;subplot(2,1,1;plot(w,abs(X1;subplot(2,1,2;plot(w,angle(X1;figure(2X2=fft(x2,N1;subplot(2,1,1;stem(n1,abs(X2;subplot(2,1,2;stem(n1,angle(X2;figure(3X3=fft(x3,N2;subplot(2,1,1;stem(n2,abs(X3;subplot(2,1,2;stem(n2,angle(X3;figure(4X4=fft(x4,
16、N3;subplot(2,1,1;stem(n3,abs(X4;subplot(2,1,2;stem(n3,angle(X4;习题三dt=0.0005;t=-0.005:dt:0.005;x0=(exp(-1000*t.*cos(2*pi*t;n=-500:500;w=-3*pi:0.001:3*pi;Ts1=1/20000;Ts2=1/5000;Ts3=1/1000;x1=(exp(-1000*n*Ts1.*cos(2*pi*n*Ts1;x2=(exp(-1000*n*Ts2.*cos(2*pi*n*Ts2;x3=(exp(-1000*n*Ts3.*cos(2*pi*n*Ts3;X1=dtf
17、t(x1,n,w;X2=dtft(x2,n,w;X3=dtft(x3,n,w;figure(1;plot(t,x0;figure(2subplot(3,1,1;plot(w,abs(X1subplot(3,1,2;plot(w,abs(X2subplot(3,1,3;plot(w,abs(X3习题四A=1,-0.5;B=1,2;figure(1;zplane(B,A;z=roots(Bp=roots(Afigure(2;h=impz(B,A;stem(h,'.'figure(3;H,w=freqz(B,A;plot(w,abs(H,''figure(4;n=0:
18、19;x=(n>=0&(n<20;y=filter(B,A,x;subplot(2,1,1;stem(xsubplot(2,1,2;stem(y习题五wn=0.1*pi 0.2*pi;N=10;b,a=butter(N,wn,'bandpass'figure(1freqz(b,a;figure(2n=0:N;stem(b,'.'grid;习题六wp=0.1; ws=0.2;Rp=3;Rs=30;N,wn=buttord(wp,ws,Rp,Rs;b,a=butter(N,wn,'low'freqz(b,a;习题七Fs=1;fig
19、ure(1b,a=butter(2,pi/4*Fs,'s'c,d=impinvar(b,a,Fs;H,w=freqz(c,d;plot(w/pi,abs(H;ylabel('³å¼¤ÏìÓ¦²»±ä·¨'gridq,w=butter(2,pi/4*Fs,'s'q0,w0=lp2hp(q,w,pi/4*Fs'm,n=bilinear(q0,w0,Fs;H,w=freqz(m,n;figure(2plot(w/pi,abs(H;ylabel('Ë«ÏßÐԱ任·¨'grid习题八N=18;wn=0.4;b=fir1(N,wn,hamming(N+1;H,w=freqz(b,1;figure(1n=0:N;subplot(2,1
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- DB11T 1065-2014 城市基础地理信息矢量数据要素分类与代码
- 江苏省盐城市2024-2025学年高三上学期11月期中物理试题(无答案)
- 化妆品用香料产业深度调研及未来发展现状趋势
- 家禽料槽市场需求与消费特点分析
- 冷链餐饮供应链行业相关项目经营管理报告
- 妇女腹带产业深度调研及未来发展现状趋势
- 江苏省南通市海门区东洲小学等2024-2025学年四年级上学期11月期中科学试题
- 包装袋用纸产业规划专项研究报告
- 传送高功率电子束的波导管产业运行及前景预测报告
- 小学语文“搭石”说课稿
- 地理信息科学专业职业生涯规划书
- 厨房卫生教案-劳动课教学设计
- 镀锌板通风管工程施工方案
- 企业家案例分析课件
- 助产职业生涯规划书
- 福建省泉州市德化县2023-2024学年七年级上学期期中考试道德与法治试题
- 职业生涯规划-医生职业说明
- 信息资源目录编制规范(用于个人参考学习版本)
- 互联网的定义及发展历程
- 马克思主义基本原理智慧树知到课后章节答案2023年下齐鲁工业大学
- 学而思小学奥数知识体系
评论
0/150
提交评论