




版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、精选文档Experiment ExportName: Student No: Institute: Dec 26, 2011Experiment Purposes 1. Be familiar with the software Environment and Programming flow in MATLAB5.3.2. Learn how to draw the signal waveform and determine the signal properties.3. Calculate the convolution, frequency response and system ou
2、tput by using the functions: conv, freqz, freqs and filter. Experiment Contents实验项目一:MATLAB编程基础及典型实例 画出离散时间正弦信号并确定基波周期(注:pi 表示圆周率)1 x1n=sin(pi*4/4)*cos(pi*n/4)2 x2n=cos(pi*n/4)*cos(pi*n/4)3 x3n=sin(pi*n/4)*cos(pi*n/8)program for matlabn=0:31;
3、x1=sin(pi*n/4).*cos(pi*n/4);x2=cos(pi*n/4).*cos(pi*n/4);x3=sin(pi*n/4).*cos(pi*n/8);subplot(3,1,1);stem(n,x1);title('x1');subplot(3,1,2);stem(n,x2);title('x2');subplot(3,1,3);stem(n,x3);title('x3');grid on; Conclusion: These signals is periodic, the first and second sign
4、als period are 4. The third signals period is 16. 离散时间系统性质:离散时间系统往往是用几个性质来表征,如线性、时不变性、稳定性、因果性及可逆性等。MATLAB可用来构成一些反例证明某些性质不满足。(a) 系统yn=sin(pi/2)xn)不是线性的。利用信号x1n=n和x2=2n来证明该系统不满足线性性质。(b) 系统 yn=xn+xn+1不是因果的。利用信号xn=un证明它。定义向量x和y分别代表在-5<=n<=9上的输入和在-6<=n<=9上的输出。Program
5、for matlab1.4(a)n=0:20;x1=1 zeros(1,20);x2=2*x1;x=x1+x2;y1=sin(pi/2)*x1);y2=sin(pi/2)*x2);y=sin(pi/2)*x);figure(1),stem(n,y1)figure(2),stem(n,y2)figure(3),stem(n,y) 1.4(b)x1=zeros(1,5) ones(1,10);x2=zeros(1,4) ones(1,11);y=x1+x2;n1=-5:9;n2=-5:9;figure(1),stem(n1,x1)figure(2),stem(n2,y) Conclusion: y
6、n=sin(pi/2)xn) is not linear and yn=xn+xn+1 is not cuasal and the result is shown in the chart above. 卷积计算:有限长信 xn= 1, 0n5, 0 , otherwise. 和 hn= n, 0n5, 0 , otherwise. (1) 用解析方法计算yn=xn*hn(2) 用conv计算y。步骤:a. 定义0n5区间上的向量x&
7、#160;b. 定义0n5区间上的向量hc. 用y=conv(x,h)计算yd. 构造y的标号向量nye. 用stem(ny,y)画出结果f. 验证此结果与解析导出的结果是否一致?Program for matlab N=6;M=6;L=N+M-1;x=1,1,1,1,1,1;h=0,1,2,3,4,5;y=conv(x,h);nx=0:N-1;nh=0:M-1;ny=0:L-1;stem(ny,y);xlabel('n');xlabel('y'); Conclusion: y=ans =3 and the result is show i
8、n the picture above.实验项目2一、 实验项目名称:周期信号傅里叶分析及其MATLAB实现 二、上机实验题目:特征函数在LTI系统傅里叶分析中的应用1实验项目的目的和任务:掌握特征函数在系统响应分析中的作用,正确理解滤波的概念。2 上机实验内容:1 函数Filter、Freqz和Freqs的使用:2.2节(g)、3.2节、4.1节2 计算离散时间傅里叶级数:3.1节3 LTI系统的特征函数:3.4节(a
9、),(b),(c)4 用离散时间傅里叶级数综合信号:3.5节(d),(e),(f),(h).5 吉布斯现象:根据英文教材Example 3.5验证Fig3.9的吉布斯现象(a)(d). 1 函数Filter、Freqz和Freqs的使用:2.2节(g)、3.2节、4.1节filter:计算由线性常系数差分方程 k=0Kak+1yn-k=m=0Mb(m+1)x(n-m)表征的因果LTI系统的输出若x是在nxnnx+Nx-1上的输入向量,而向量a和b包含系数ak和bm,那么y=filter(b,a,x)就得到在nxnnx+N
10、x-1上的系统输出yn+2yn-1=xn-3xn-1则a=1 2,b=1 3%2.2gMain Program x=1,1,1,1,1,1,0,0,0,0,0;h=0,1,2,3,4,5;y=filter(h,1,x);ny=0:10;stem(ny,y);xlabel('n');xlabel('y');%3.2a1=1 -0.8 0;b1=2 0 -1;N=4;h1 omega1=freqz(b1,a1,N) h2 omega2=freqz(b1,a1,N,'whole')%4.1a=1 3;b=3;figure;freqs(b,a)
11、;w=linspace(0,3*pi);h=freqs(b,a,w);figure;plot(w,abs(h);a1=3 4 1;b1=1 0 5;figure;freqs(b1,a1); 计算离散时间傅里叶级数:3.1节x=1 1 zeros(1,30);a=(1/32)*fft(x)n=0:31;figure(1),stem(n,a)figure(2),stem(n,imag(a)y=32*ifft(a);figure(3),stem(n,y)figure(4),stem(n,imag(y) LTI系统的特征函数:3.4节(a),(b),(c)%3.
12、4(a) n=-20:100; x1=exp(j*(pi/4)*n);x2=sin(pi*n/8+pi/16);x3=(9/10).n; x4=n+1;subplot(5,1,1),stem(n,real(x1);title('real(x1)');axis(0,100,-5,5)subplot(5,1,2),stem(n,imag(x1);title('imag(x1)'); axis(0,100,-5,5)subplot(5,1,3),stem(n,x2);title('x2'); axis(0,100,-5,5)subplot(5
13、,1,4),stem(n,x3);title('x3')subplot(5,1,5),stem(n,x4);title('x4')%3.4(b)n=0:100; x1=exp(j*(pi/4)*n);x2=sin(pi*n/8+pi/16);x3=(9/10).n; x4=n+1;a=1 -0.25;b=1 0.9;y1=filter(b,a,x1);y2=filter(b,a,x2);y3=filter(b,a,x3);y4=filter(b,a,x4);figure;subplot(5,1,1),stem(n,real(y1);title('real
14、(y1)')subplot(5,1,2),stem(n,imag(y1);title('imag(y1)')subplot(5,1,3),stem(n,y2);title('y2')subplot(5,1,4),stem(n,y3);title('y3')subplot(5,1,5),stem(n,y4);title('y4')%3.4(c)h1=y1./x1;h2=y2./x2;h3=y3./x3;h4=y4./x4;figure;subplot(5,1,1),stem(n,real(h1);title('rea
15、l(h1)')subplot(5,1,2),stem(n,imag(h1);title('imag(h1)')subplot(5,1,3),stem(n,h2);title('h2')subplot(5,1,4),stem(n,h3);title('h3')subplot(5,1,5),stem(n,h4);title('h4')%3.5(d)function x=period(xn)x=zeros(1,64);a,b=size(xn);for k=1:(64/b) x(1,b*(k-1)+1:b
16、*k)=xn;endx1=ones(1,8);x2=x1,zeros(1,8)x3=x1,zeros(1,24);x11=period(x1);x22=period(x2);x33=period(x3);n=0:63;subplot(3,1,1);stem(n,x11)subplot(3,1,2);stem(n,x22)subplot(3,1,3);stem(n,x33)x2 = Columns 1 through 13 1 1 1 1 1 1 1 1 0 0 0 0 0 Columns 14 through 16 0 0 0%3.5(e)x11=ones(1,8) ones(1,8) one
17、s(1,8) ones(1,8) ones(1,8) ones(1,8) ones(1,8) ones(1,8);x22=ones(1,8) zeros(1,8) ones(1,8) zeros(1,8) ones(1,8) zeros(1,8) ones(1,8) zeros(1,8);x33=ones(1,8) zeros(1,24) ones(1,8) zeros(1,24);a1=(1/64)*fft(x11);a2=(1/64)*fft(x22);a3=(1/64)*fft(x33);n=0:63;subplot(3,1,1);figure(1),stem(n,a1)subplot(
18、3,1,2);figure(2),stem(n,a2)subplot(3,1,3);figure(3),stem(n,a3)figure(4),stem(n,imag(a1)figure(5),stem(n,imag(a2)figure(6),stem(n,imag(a3) %3.5(f)function x=func(ak,n)x=0;for k=-31:31 if k<=0 ak(k)= ak(-k) x= x+ak(k)*exp(i*k*(2*pi/32)*n) ; else &
19、#160; x=x+ak(k)*exp(i*k*(2*pi/32)*n) ; endendsubplot(3,1,1);n=0:31;x3_2=zeros(1,32);for k=1:32 x3_2(k)=real(func(a3,k);endstem(n,x3_2)%3.5(h)function x=dtfs(ak,n)x=0;for k=-31:31 if k<=0 ak(k)=ak(-k) x= x+ak(k)*exp(i*k*(2*pi
20、/32)*n) ; else x=x+ak(k)*exp(i*k*(2*pi/32)*n) ; endend 吉布斯现象:根据英文教材Example 3.5验证Fig3.9的吉布斯现象(a)(d)%Gibbsx=1/2;k=0;t=-2:0.01:2;x1=-2 -1 -1 1 1 2;y1=0 0 1 1 0 0;for i=1:2:49 k=i-k;x=x+(-1)(k+1)*2/(i*pi)*cos(i*pi*t/2);if(i=1
21、)figure; plot(x1,y1,t,x); title('N=1')elseif(i=3)figure; plot(x1,y1,t,x);title('N=3')elseif(i=7)figure; plot(x1,y1,t,x);title('N=7')elseif(i=9)figure; plot(x1,y1,t,x);title('N=9')elseif(i=49)figure; plot(x1,y1,t,x);title('N=49')endend 实验项目3:一、 实验项
22、目名称:非周期信号傅里叶分析的MATLAB实现二、上机实验题目:傅里叶变换的基本性质及其在系统分析中的应用1实验项目的目的和任务:熟练掌握连续时间傅里叶变换的基本性质及其在系统分析中应用。2 上机实验内容: 连续时间傅里叶变换性质:4.3节(b) 求由微分方程描述的单位冲激响应:4.5节(b) 计算离散时间傅里叶变换:5.1节(a),(b),(c) 由欠采样引起的混叠:7.1节(a),(b),(c),(d)3学时数:2 连续时间傅里叶变换性质:4.3节(b)load splaty=y(1:8192);N=8192;f
23、s=8192;Y=fftshift(fft(y);Y1=conj(Y);Y1=fft(Y1);Y1=real(Y1);sound(Y1,fs) 求由微分方程描述的单位冲激响应:4.5bb1=0 1 -2;a1=1 1.5 0.5;r1,p1=residue(b1,a1)Result:r1 = 6 -5p1 = -1.0000 -0.5000 计算离散时间傅里叶变换:5.1节(a),(b),(c) 由欠采样引起的混叠:7.1节(a),(b),(c),(d)%7.1(a)(b):T=1/8192;n=1:50;omig=2*pi*1000; &
24、#160;n=0:8192;x=sin(omig*T.*n);n2=0:50.*T; figure; subplot(2,1,1);stem(n2,x(1:51); subplot(2,1,2);plot(n2,sin(omig.*n2);%7.1(c) T=1/8192;n=1:50;omig=2*pi*1000; n=0:8192;x=sin(omig*T.*n);n2=0:50.*T; figure; subplot(2,1,1);stem(n2,x(1:51); subplot(
25、2,1,2);plot(n2,sin(omig.*n2);%7.1(d)ws=2*pi*8192;w0=2*pi*1500;T=1/8192;n=0:8191;t=n*T;x=sin(w0*t);subplot(2,1,1);stem(n(1:50),x(1:50);xlabel('n');ylabel('xn');subplot(2,1,2);plot(n(1:50),x(1:50);xlabel('n');ylabel('x(t)');grid on;figure;N=length(x);X=fftshift(fft(x,N)
26、*(2*pi/N);%CTFTS;w=linspace(-1,1-1/N,N)/(2*T);plot(w,abs(X);xlabel('w');ylabel('abs(X)'); 实验项目4:一、 实验项目名称:LTI系统复频域分析的MATLAB实现二、上机实验题目:拉氏变换与Z变换的基本性质在系统分析中的应用1实验项目的目的和任务:掌握拉氏变换、Z变换的基本性质及其在系统分析中的典型应用2上机实验内容: 作系统的零极点图(用roots和zplane函数):9.1节(a), (c) 求系统频率响应和极点位置:9.2节(a),(b) 离散时间
27、频率响应的几何解释:10.2节(a), (b), (c),(d),(e) 3 作系统的零极点图(用roots和zplane函数):9.1节(a) (i)a1=1 5;b1=1 2 3;zs=roots(a1)ps=roots(b1)plot(real(zs),imag(zs),'o');hold onplot(real(ps),imag(ps),'x');gridaxis(-5 2 -2 2);(ii)a2=2 5 12;b2=1 2 10;zs=roots(a2)ps=roots(b2)plot(real(zs),imag(zs),'o
28、39;);hold onplot(real(ps),imag(ps),'x');gridaxis(-3 3 -3 3);(iii)a3=2 5 12;b3=1 4 14 20;zs=roots(a3)ps=roots(b3)plot(real(zs),imag(zs),'o');hold onplot(real(ps),imag(ps),'x');gridaxis(-3 3 -3 3);%9.1(c) a=0 1 -3;b=1 2 5;zs=roots(b)ps=roots(a)plot(real(zs),imag(zs),'o
29、'); hold onplot(real(ps),imag(ps),'x');grid onaxis(-5 5 -5 5);zplane(a,b);Result:zs = -1.0000 + 2.0000i -1.0000 - 2.0000ips = 3 求系统频率响应和极点位置%9.2aw=1;a1=1 0 1;a2=1 0.5 1;a3=1 2 1;a4=1 4 1;ps1=roots(a1)ps2=roots(a2)ps3=roots(a3)ps4=roots(a4)subplot(2,2 ,1);plot(real(ps1),imag(ps1),
30、9;x');axis(-4 4 -4 4);xlabel('Re');ylabel('Im');title('pole point figure (a1)');grid;subplot(2,2 ,2);plot(real(ps2),imag(ps2),'x');axis(-4 4 -4 4);xlabel('Re');ylabel('Im');title('pole point figure (a2)');grid;subplot(2,2 ,3);plot(real(ps3)
31、,imag(ps3),'x');axis(-4 4 -4 4);xlabel('Re');ylabel('Im');title('pole point figure (a3)');grid;subplot(2,2 ,4);plot(real(ps4),imag(ps4),'x');axis(-4 4 -4 4);xlabel('Re');ylabel('Im');title('pole point figure (a1)');gridResult:ps1 = 0 +
32、1.0000i 0 - 1.0000ips2 = -0.2500 + 0.9682i -0.2500 - 0.9682ips3 = -1 -1ps4 = -3.7321 -0.2679%9.2bn=-5:0.1:5;b=1;a1=1 0 1;a2=1 0.5 1;a3=1 2 1;a4=1 4 1;freqs(a1,b,n)figure freqs(a2,b,n)figurefreqs(a3,b,n)figurefreqs(a4,b,n) 离散时间频率响应的几何解释%10.2ab=1 0 0;a=1 -0.9 0.81;zs1=roots(b)ps=roots(a)plot(real(
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 酿造美酒的基础知识培训课件
- 诗词文言文对比阅读(解析版)-2026年中考语文复习试题(广东专用)
- 人教版八年级英语下册重点短语及专练(含答案)
- CN120193440A 一种改善纸张表面平滑度的湿端造纸工艺
- 人教版部编版语文九年级下册 第五单元测试及答案02
- 老人护理知识培训课件
- 2025宾馆客房租赁与设施租赁服务合同范本
- 2025版排水沟疏通与环保处理施工合同样本
- 2025年度外墙防水涂料施工与建筑防水质量监管合同
- 2025年城市综合体拆迁补偿及安置合同
- 原地着灭火防护装备操作程序及评定标准
- 燃气有机热载体锅炉安装使用说明书
- 艾滋病梅毒丙肝检测与解释
- 400T三一履带吊性能表
- GB/T 22076-2008气动圆柱形快换接头插头连接尺寸、技术要求、应用指南和试验
- JJG(新) 32 2022 工作用数字温度计检定规程
- 公共伦理学电子教案
- 埃美柯阀门检验报告汇总-391黄铜调节阀
- 500kV变电站屋外架构组立吊装工程施工安全技术交底
- 三字经全文带拼音注释打印版
- (完整版)污水处理站施工方案
评论
0/150
提交评论