www.pudn.com > modusqu.rar > modusqu.m


%产生调幅、调频及调相波形 
clf; 
%format,compact, 
t=0:0.001:1; 
A0=10;w0=200;phi0=0; 
x=A0*square(w0*t+phi0); 
subplot(3,1,1),plot(t,x),hold 
axis([0,1,-12,12]) 
xlabel('t'),ylabel('载波信号') 
%输入信号参数 
dA=5*sin(0.1*w0*t); 
dw=0; 
dphi=0; 
y=(A0+dA).*square((w0+dw).*t+dphi); 
%y=A0.*square((w0+dw).*t+dphi); 
subplot(3,1,2),plot(t,y); 
ylabel('调制波形') 
Y=fft(y); 
subplot(3,1,3),plot(abs(Y)),grid 
axis([0,500,0,5000]) %展宽重要频段的图形 
ylabel('频谱')