Introduction - If you have any usage issues, please Google them yourself
fm=input( Enter the message signal frequency fm= )
fc=input( Enter the carrier frequency fc= )
Am=input( Enter the message signal amplitude Am= )
Ac=input( Enter the carrier signal frequency Ac= )
n=input( Enter the no of DFT points: )
tm=(1/fm)
tc=(1/fc)
nfc=40
t=0:(tc/nfc):4*tm
msg=Am*cos(2*pi*fm*t)
car=Ac*cos(2*pi*fc*t)
Modulation
dsb=msg.*car
AM=(dsb/Ac)+car
figure(1)
subplot(2,1,1)
plot(t,msg)
subplot(2,1,2)
plot(t,car)
figure(2)
subplot(2,1,1)
plot(t,dsb)
subplot(2,1,2)
plot(t,AM)