欢迎来到天天文库
浏览记录
ID:39577366
大小:93.50 KB
页数:9页
时间:2019-07-06
《实验一 熟悉MATLAB环境》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、实验一熟悉MATLAB环境一、实验目的(1)熟悉MATLAB的主要操作命令。(2)学会简单的矩阵输入和数据读写。(3)掌握简单的绘图命令。(4)用MATLAB编程并学会创建函数。(5)观察离散系统的频率响应。二、实验内容(1)数组的加、减、除和乘方运算。输入A=[1234],B=[3456],求C=A+B,D=A-B,E=A.*B,F=A./B,G=A.^B并用stem语句画出A、B、C、D、E、F、G。(2)用MATLAB实现下列序列:a)b)c)d)将c)中的扩展以16为周期的函数绘出四个周期。e)将c
2、)中的扩展以10为周期的函数绘出四个周期。(3),产生并绘出下列序列的样本(4)绘出下列时间函数的图形,对x轴、y轴以及图形上方均须加上适当的标注:a)b)(5)编写函数stepshift(n0,n1,n2)实现u(n-n0),n13、2)题中d)和e)两小题的结果,试说明对于周期性信号,应当如何采样,才能保证周期扩展后与原信号保持一致?(2)对于有限长序列,如何用MATLAB计算其DTFT?二、实验报告要求(1)简述实验目的及原理。(2)按实验步骤附上实验程序。(3)按实验步骤附上有关离散系统的频率特性曲线。(4)简要回答思考题。(1)A=[1234]A=1234B=[3456]B=3456C=A+BC=46810D=A-BD=-2-2-2-2E=A.*BE=381524F=A./BF=0.33330.50000.60000.6667G4、=A.^BG=1162434096A=[1234];B=[3456];C=A+B;D=A-B;E=A.*B;F=A./B;G=A.^B;subplot(3,3,1);stem(A);title('A');subplot(3,3,2);stem(B);title('B');subplot(3,3,3);stem(C);title('C');subplot(3,3,4);stem(D);title('D');subplot(3,3,5);stem(E);title('E');subplot(3,3,6);ste5、m(F);title('F');subplot(3,3,7);stem(G);title('G');(2)a)n=0:15;x=0.8.^nx=Columns1through141.00000.80000.64000.51200.40960.32770.26210.20970.16780.13420.10740.08590.06870.0550Columns15through160.04400.0352b)n=0:15;x=exp((0.2+3j)*n)x=Columns1through81.0000-1.6、2092+0.1724i1.4324-0.4168i-1.6602+0.7509i1.8780-1.1942i-2.0650+1.7677i2.1923-2.4934i-2.2212+3.3928iColumns9through162.1010-4.4854i-1.7673+5.7857i1.1398-7.3006i-0.1198+9.0242i-1.4106-10.9326i3.5900+12.9763i-6.5776-15.0719i10.5514+17.0909ic)n=0:15;x=3*cos(0.7、125*pi*n+0.2*pi)+2*sin(0.25*pi*n+0.1*pi)x=Columns1through143.04513.34952.37140.2076-2.3814-4.3399-4.8652-3.8251-1.80900.21451.43281.60831.14530.7759Columns15through161.06102.0091d)n=0:15;x=3*cos(0.125*pi*n+0.2*pi)+2*sin(0.25*pi*n+0.1*pi);y=[xxxx]y=Columns18、through143.04513.34952.37140.2076-2.3814-4.3399-4.8652-3.8251-1.80900.21451.43281.60831.14530.7759Columns15through281.06102.00913.04513.34952.37140.2076-2.3814-4.3399-4.8652-3.8251-1.80900.21451.43281.6083Col
3、2)题中d)和e)两小题的结果,试说明对于周期性信号,应当如何采样,才能保证周期扩展后与原信号保持一致?(2)对于有限长序列,如何用MATLAB计算其DTFT?二、实验报告要求(1)简述实验目的及原理。(2)按实验步骤附上实验程序。(3)按实验步骤附上有关离散系统的频率特性曲线。(4)简要回答思考题。(1)A=[1234]A=1234B=[3456]B=3456C=A+BC=46810D=A-BD=-2-2-2-2E=A.*BE=381524F=A./BF=0.33330.50000.60000.6667G
4、=A.^BG=1162434096A=[1234];B=[3456];C=A+B;D=A-B;E=A.*B;F=A./B;G=A.^B;subplot(3,3,1);stem(A);title('A');subplot(3,3,2);stem(B);title('B');subplot(3,3,3);stem(C);title('C');subplot(3,3,4);stem(D);title('D');subplot(3,3,5);stem(E);title('E');subplot(3,3,6);ste
5、m(F);title('F');subplot(3,3,7);stem(G);title('G');(2)a)n=0:15;x=0.8.^nx=Columns1through141.00000.80000.64000.51200.40960.32770.26210.20970.16780.13420.10740.08590.06870.0550Columns15through160.04400.0352b)n=0:15;x=exp((0.2+3j)*n)x=Columns1through81.0000-1.
6、2092+0.1724i1.4324-0.4168i-1.6602+0.7509i1.8780-1.1942i-2.0650+1.7677i2.1923-2.4934i-2.2212+3.3928iColumns9through162.1010-4.4854i-1.7673+5.7857i1.1398-7.3006i-0.1198+9.0242i-1.4106-10.9326i3.5900+12.9763i-6.5776-15.0719i10.5514+17.0909ic)n=0:15;x=3*cos(0.
7、125*pi*n+0.2*pi)+2*sin(0.25*pi*n+0.1*pi)x=Columns1through143.04513.34952.37140.2076-2.3814-4.3399-4.8652-3.8251-1.80900.21451.43281.60831.14530.7759Columns15through161.06102.0091d)n=0:15;x=3*cos(0.125*pi*n+0.2*pi)+2*sin(0.25*pi*n+0.1*pi);y=[xxxx]y=Columns1
8、through143.04513.34952.37140.2076-2.3814-4.3399-4.8652-3.8251-1.80900.21451.43281.60831.14530.7759Columns15through281.06102.00913.04513.34952.37140.2076-2.3814-4.3399-4.8652-3.8251-1.80900.21451.43281.6083Col
此文档下载收益归作者所有