资源描述:
《信号与系统matlab数字信号处理_东南大学短学期_作业一》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、实验一二、1.>>A=[1,2,3;4,5,6;7,8,9]A=1234567893.>>B=[9,8,7;6,5,4;3,2,1]B=987654321>>C=[4,5,6;7,8,9;1,2,3]C=4567891234.>>AA=123456789>>BB=987654321>>CC=456789123三、1.>>A=[1,2,3];B=[4,5,6];>>C=A+BC=579>>D=A-BD=-3-3-3>>E=A.*BE=41018>>F=A./BF=0.25000.40000.5000>>G=A.^BG=132729>
2、>stem(A)>>stem(B)>>stem(C)>>stem(D)>>stem(E)>>stem(F)>>stem(G)2.(1)>>fori=1:10000t(i)=(i-1)/1000;f(i)=3-exp(-t(i));endplot(t,f)(2)>>fori=1:10000t(i)=(i-1)/1000;f(i)=5*exp(-t(i))+3*exp(-2*t(i));endplot(t,f)(3)>>fori=1:3000t(i)=(i-1)/1000;f(i)=exp(-t(i))*sin(2*pi*t(i));
3、endplot(t,f)(4)>>fori=1:3000t(i)=(i-1)/1000;f(i)=sin(3*t(i))/(3*t(i));endplot(t,f)(5)>>clear>>fori=1:6k(i)=i;f(i)=(-2)^(-k(i));end>>stem(k,f)(6)>>clear>>fori=1:5k(i)=i-1;f(i)=exp(k(i));end>>stem(k,f)(7)>>clear>>fori=1:99k(i)=i;f(i)=k(i);end>>stem(k,f)四、1.>>clearA=[2,3
4、,1;1,1,1;3,-1,-1];B=[11;6;-2];>>x=ABx=1.00002.00003.00002.A=[1,1,1;1,-2,1;1,2,3];B=[2;-1;-1];>>x=ABx=31-23.A=[1,1,0;0,1,1;1,0,1];B=[27;33;30];>>x=ABx=121518实验二二、1.%定义阶跃函数function[r]=pulse(k)%UNTITLED2Summaryofthisfunctiongoeshere%Detailedexplanationgoeshereifk<0r=0
5、;elser=1;endend>>clear>>fori=1:10k(i)=i-4;f(i)=sin(k(i))*pulse(k(i));end>>stem(k,f)2.>>fori=1:10k(i)=i-5;f(i)=sin(k(i))+sin(pi*k(i));end>>stem(k,f)3.>>clearfori=1:50k(i)=i;f(i)=k(i)*sin(k(i))*pulse(k(i)-3);endstem(k,f)4.clearfori=1:20k(i)=i-10;f(i)=(-1)^k(i)+(0.5)^k(i
6、)*pulse(k(i));end>>stem(k,f)七、%直接调用conv函数1.f1=[1,1,1,1];f2=[1,0.5,0.25,0.125,0.0625];>>conv(f1,f2)ans=1.00001.50001.75001.87500.93750.43750.18750.06252.f1=[1,1,1,1];f2=[3,2,1];>>conv(f1,f2)ans=356631%自编卷积函数function[y]=my_conv(a,b)%UNTITLEDSummaryofthisfunctiongoeshere
7、%Detailedexplanationgoesherelengtha=length(a);lengthb=length(b);len=lengtha+lengthb-1;y=linspace(0,0,len);fori=lengtha:-1:1forj=lengthb:-1:1y(i+j-1)=a(i)*b(j)+y(i+j-1);endendend1.f1=[1,1,1,1];f2=[1,0.5,0.25,0.125,0.0625];>>my_conv(f1,f2)ans=1.00001.50001.75001.87500.9
8、3750.43750.18750.06252.f1=[1,1,1,1];f2=[3,2,1];>>my_conv(f1,f2)ans=356631实验三只用DFT计算频谱二、已知离散时间序列x(k)={1,2,3,4,5,6,6,5,4,3,2,1