版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
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 output
2、 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;x1=sin(pi*n/4).*cos(pi*n/4);x2=cos(pi*n/4).*cos(pi*n/4);x3=sin
3、(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 signals period are 4. The third signals period is 16. 离散时间系统性质:离散时间系统往往是用几个性质来表征,如线性、时不变性、稳定性、因果性及可逆性等
4、。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 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
5、(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: yn=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
6、=n, 0n5, 0 , otherwise. (1) 用解析方法计算yn=xn*hn(2) 用conv计算y。步骤:a. 定义0n5区间上的向量xb. 定义0n5区间上的向量hc. 用y=conv(x,h)计算yd. 构造y的标号向量nye. 用stem(ny,y)画出结果f. 验证此结果与解析导出的结果是否一致?Program for matlabN=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); Conclusi
7、on: y=ans =3 and the result is show in 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),(b),(c)4 用离散时间傅里叶级数综合信号:3.5节(d),(e),(f),(h).5 吉布斯现
8、象:根据英文教材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+Nx-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,
9、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);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,3
10、0);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.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
11、,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,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
12、,a,x2);y3=filter(b,a,x3);y4=filter(b,a,x4);figure;subplot(5,1,1),stem(n,real(y1);title(real(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;s
13、ubplot(5,1,1),stem(n,real(h1);title(real(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*k)=xn;endx1=ones(1,8
14、);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) ones(1,8) ones(1,8) ones
15、(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(3,1,2);figure(2),stem
16、(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 x=x+ak(k)*exp(i*k*(2*pi/32)*n) ; endendsubplot(3,1,1);n=0:31;x3_2=zeros(1,32);
17、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/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;fo
18、r i=1:2:49 k=i-k;x=x+(-1)(k+1)*2/(i*pi)*cos(i*pi*t/2);if(i=1)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:一、 实验项目名称
19、:非周期信号傅里叶分析的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;fs=8192;Y=fftshift(fft(y);Y1=conj(Y);Y1=fft(Y1)
20、;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; n=0:8192;x=sin(omig*T.*n);n2=0:50.*T; figure; subplot(2,1,1);stem(n2,x(1:51);
21、 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(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);xl
22、abel(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)*(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变换的基本性质
23、及其在系统分析中的典型应用2上机实验内容: 作系统的零极点图(用roots和zplane函数):9.1节(a), (c) 求系统频率响应和极点位置:9.2节(a),(b) 离散时间频率响应的几何解释: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;b
24、2=1 2 10;zs=roots(a2)ps=roots(b2)plot(real(zs),imag(zs),o);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(z
25、s),imag(zs),o);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),x);axis(-4
26、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),imag(ps3),x);axis(-4 4 -4 4);xlabel(Re);ylabel(Im);title(pole point figure (a3);grid;subp
27、lot(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 + 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)figurefreqs(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(zs),imag(zs1),o);hold on;plot
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 自贡市第四人民医院2026年住院医师规范化培训招收88名学员笔试备考试题及答案解析
- 2026年西安高新区第五高级中学招聘笔试备考题库及答案解析
- 2026浙江宁波半边山投资有限公司观堂酒店管理分公司(象山半边山观堂)招聘5人笔试备考试题及答案解析
- 2026福建厦门市上塘中学产假顶岗教师招聘2人笔试备考题库及答案解析
- 2026春学期广西来宾市象州县象州镇初级中学招聘见习教师3人笔试备考试题及答案解析
- 2026上海交通大学医学院附属仁济医院工作人员招聘110人笔试备考题库及答案解析
- 2026西安高新区东大街道卫生院招聘笔试备考试题及答案解析
- 2026东风卓联汽车服务有限公司招聘4人笔试备考试题及答案解析
- 2026山西综改示范区人民法院司法警务辅助人员招聘1人笔试备考试题及答案解析
- 2026年渭南韩城事业单位招聘(48人)笔试备考题库及答案解析
- 2025年山西国企笔试题库及答案
- 招标文件编制细则与常见问题解析
- 水下机器人与海洋自动化:创新技术的前沿探索
- DLT 5142-2012 火力发电厂除灰设计技术规程
- DB3208∕T 162-2021 青虾池套养中华绒螯蟹养殖技术操作规程
- 2025餐饮创意菜品研发趋势研究及厨师IP化与出品标准化平衡报告
- 生物-湖南师大附中 2025 届高三月考试卷(六)试题和答案
- 医院科室整改前后对比
- 海外机械设备管理制度
- 上海印象旅游城市介绍模板(免费下载)
- 文献检索与科技论文写作
评论
0/150
提交评论