% Matlab commands for demonstrating AM modulation
%--  3:38 PM 10/30/01 --%
fs=11025
tt=0:1/fs:2;
ss = cos(2*pi*440*tt);
fm=440;
sound(ss,fs)
sound(ss,fs)
A=2;
fc=fc=3000
fc=3000
xx = (A+ss)*cos(2*pi*fc*tt);
xx = (A+ss).*cos(2*pi*fc*tt);
plot(tt(1:2*fm/fs),xx(1:2*fm/fs))
plot(tt(1:2*round(fm/fs),xx(1:2*round(fm/fs))
plot(tt(1:2*round(fm/fs),xx(1:2*round(fm/fs)))
plot(tt(1:2*round(fm/fs)),xx(1:2*round(fm/fs)))
plot(tt(1:2*round(fm/fs)),xx(1:2*round(fm/fs)))
figure
plot(tt(1:2*round(fm/fs)),xx(1:2*round(fm/fs)))
plot(tt(1:2*round(fs/fm)),xx(1:2*round(fs/fm)))
plot(tt(1:10*round(fs/fm)),xx(1:10*round(fs/fm)))
specgram(xx,512,fs)
specgram(xx,1024,fs)
specgram(ss,1024,fs)
specgram(xx.*cos(2*pi*fc*tt),1024,fs)
sound(xx,fs)
sound(xx.*cos(2*pi*fc*tt),fs)
soundsc(xx.*cos(2*pi*fc*tt),fs)
playscale
whos
sound(tone)
sound(xx)
specgram(xx,512,fs)
plot(xx(1:200))
yy=(2+xx).*cos(2*pi*fc*tt);
plot(tt,xx)
plot(tt,yy)
specgram(yy,512,fs)
which specgram
which zcat
%--  4:48 PM 10/30/01 --%