Thursday, June 2, 2016

AMPLITUDE MODULATION (AM) AND DEMODULATION

PROGRAM:
clc;
clear all;
close all;

fm = input('Enter the modulating signal frequency(Hz) :');
fc = input('Enter the carrier signal frequency(Hz) :');
fs = input('Enter the sampling frequency(Hz) :');

t = (0:.1:100)'/fs;

sig_mod = sin(2*pi*fm*t);
sig_amod = ammod(sig_mod,fc,fs);
sig_amod_noise = sig_amod + randn(size(t));
sig_admod = amdemod(sig_amod,fc,fs);
sig_admod_noise = amdemod(sig_amod_noise,fc,fs);

subplot(3,2,1);
plot(t,sig_mod);
xlabel('time (s)->');
ylabel('amplitude (v)->');
title('MODULATING SIGNAL');

subplot(3,2,3);
plot(t,sig_amod);
xlabel('time (s)->');
ylabel('amplitude (v)->');
title('AMPLITUDE MODULATED (AM) SIGNAL');

subplot(3,2,5);
plot(t,sig_admod);
xlabel('time (s)->');
ylabel('amplitude (v)->');
title('DEMODULATED AM SIGNAL');

subplot(3,2,2);
plot(t,sig_mod);
xlabel('time (s)->');
ylabel('amplitude (v)->');
title('MODULATING SIGNAL');

subplot(3,2,4);
plot(t,sig_amod_noise);
xlabel('time (s)->');
ylabel('amplitude (v)->');
title('AMPLITUDE MODULATED SIGNAL WITH ADDED NOISE');

subplot(3,2,6);
plot(t,sig_admod_noise);
xlabel('time (s)->');
ylabel('amplitude (v)->');
title('DEMODULATED NOISE ADDED AM SIGNAL');


SAMPLE OUTPUT:
Enter the modulating signal frequency(Hz) :2
Enter the carrier signal frequency(Hz) :10
Enter the sampling frequency(Hz) :50


PLOT:

No comments:

Post a Comment