基于Matlab的频谱搬移%9-21R=0.005;t=-1.2:R:1.2;tao=2;x=rectpuls(t,tao);figure(1);plot(t,x);axis([-2201]);y=x.*cos(10*pi*t);%X=fourier(x);%Y=fourier(y);figure(2);subplot(2,2,1);plot(t,x);axis([-2,2,0,1.2])xlabel('t');ylabel('x(t)');subplot(2,2,3);plot(t,y);xlabel('t');ylabel('y(t)=x(t)*cos(10*pi*t)');W1=40;N=1000;k=-N:N;W=k*W1/N;X=x*exp(-j*t'*W)*R;X=real(X);Y=y*exp(-j*t'*W)*R;Y=real(Y);subplot(2,2,2);plot(W,X)xlabel('w');ylabel('X(w)');subplot(2,2,4);plot(W,Y)xlabel('w');ylabel('Y(w)');-2-1.5-1-0.500.511.5200.10.20.30.40.50.60.70.80.91-2-101200.51tx(t)-2-1012-1-0.500.51ty(t)=x(t)*cos(10*pi*t)-40-2002040-1012wX(w)-40-2002040-0.500.511.5wY(w)