资源描述
M2-3(1) function yt=x(t) yt=(t).*(t=0&t=2&t=3&t=0&t=2&t=3&t=0)untiled3.mk=-2:10xk=10*(0.5).k.*un(k);stem(k,xk)title(xk)axis(-3,12,0,11)M2-5(6) k=-10:10xk=5*(0.8).k.*cos(0.9)*pi*k)stem(k,xk)title(xk)grid onM2-7A=1;t=-5:0.001:5;w0=6*pi;xt=A*cos(w0*t);plot(t,xt)hold onA=1;k=-5:5;w0=6*pi;xk=A*cos(w0*0.1*k);stem(k,xk)axis(-5.5,5.5,-1.2,1.2)title(x1=cos(6*pi*t)&x1k)A=1;t=-5:0.001:5;w0=14*pi;xt=A*cos(w0*t);plot(t,xt)hold onA=1;k=-5:5;w0=14*pi;xk=A*cos(w0*0.1*k);stem(k,xk)axis(-5.5,5.5,-1.2,1.2)title(x2=cos(14*pi*t)&x2k)A=1;t=-5:0.1:5;w0=26*pi;xt=A*cos(w0*t);plot(t,xt)hold onA=1;k=-5:5;w0=26*pi;xk=A*cos(w0*0.1*k);stem(k,xk)axis(-5.5,5.5,-1.2,1.2)title(x1=cos(26*pi*t)&x1k)M2-9(1) k=-4:7;xk=-3,-2,3,1,-2,-3,-4,2,-1,4,1,-1;stem(k,xk,file)(2) k=-12:21;x=-3,0,0,-2,0,0,3,0,0,1,0,0,-2,0,0,-3,0,0,-4,0,0,2,0,0,-1,0,0,4,0,0,1,0,0,-1;subplot(2,1,1)stem(k,x,file)title(3倍内插)t=-1:2;y=-2,-2,2,1;subplot(2,1,2)stem(t,y,file)title(3倍抽取)axis(-3,4,-4,4)(3) k=-4:7;x=-3,-2,3,1,-2,-3,-4,2,-1,4,1,-1;subplot(2,1,1)stem(k+2,x,file)title(xk+2)subplot(2,1,2)stem(k-4,x,file)title(xk-4)(4) k=-4:7;x=-3,-2,3,1,-2,-3,-4,2,-1,4,1,-1;stem(-fliplr(k),fliplr(x),file)title(x-k)M4-1(1)对于周期矩形信号的傅里叶级数cn =-1/2j*sin(n/2*pi)*sinc(n/2)n=-15:15;X=-j*1/2*sin(n/2*pi).*sinc(n/2);subplot(2,1,1);stem(n,abs(X),file);title(幅度谱)xlabel(nw);subplot(2,1,2);stem(n,angle(X),file);title(相位谱)(2)对于三角波信号的频谱是:Cn=-4n22+2nsinn2+4n22cosn2n=-15:15;X=sinc(n)-0.5*(sinc(n/2).2);subplot(2,1,1);stem(n,abs(X),file);title(幅度谱)xlabel(nw);subplot(2,1,2);stem(n,angle(X),file);title(相位谱)M4-4(1) tau=0.5;T=100;N=T/tau;t=0:tau:(T-tau);x=(t=0 & t=0).*exp(-t);X=fftshift(tau*fft(x);X=abs(X);w=-(pi/tau)+(0:N-1)*(2*pi/(N*tau);plot(w,X)grid on
展开阅读全文