% AM program on April 10, 2007 % message is a sinusoid mu=0.5; fm=0.05; fc=0.4; T=200; Ts=0.1 t=[0: Ts: T-Ts]; N=T/Ts; % AM signal m=mu*cos(2*pi*fm*t); s=(1+m).*cos(2*pi*fc*t); % z0=fft(s); zz0=fftshift(z0); % fftshift lets center to be 0 Hz Ts=t(2)-t(1); % the sampling period Fs=1/Ts; % the sampling frequency in Hz F = Fs*(-N/2:(N/2)-1)/N; % frequency axis % (abs(z0)); plot(F, abs(zz0)); i1=1065; i2=1095; % this is a magnified spectrum % If you want to see, then delete the comment command % % plot(F(i1:i2), abs(zz0(i1:i2)))