Tuesday, 24 September 2013

Fm Modulation Code

the Program for coding Freequency Modulation is

clc;
fs=1000;
fc=100;
t=[0:fs]/fs;
k=50;
x=sin(2*pi*t);
subplot(3,1,1);
plot(t,x);
title('message sigal');
xlabel('time');
ylabel('amplitude');
y=fmmod(x,fc,fs,k);
subplot(3,1,2);
plot(t,y);
xlabel('time');
ylabel('amplitude');
title('modulated signal');
z=fmdemod(y,fc,fs,k);
subplot(3,1,3);
plot(t,z);
xlabel('time');
ylabel('amplitude');
title('demodulated wave');


The Output for the above program is:

Wednesday, 4 September 2013

DSBSC Modulation Code

The program for  DSBSC Modulation is:

clc;
clr;
fs=2;
fc=50;
t=0:0.001:1;
x=sin(2*pi*fs*t);
y=sin(2*pi*fc*t);
subplot(2,2,1);
plot(t,x);
xlabel('time');
ylabel('amplitude');
title('message signal');
subplot(2,2,2);
plot(t,y);
xlabel('time');
ylabel('amplitude');
title('carrier signal');
z=x.*y;
subplot(2,2,3);
plot(z,t);
xlabel('time');
ylabel('amplitude');
title('DSBSC Modulated Waveform');
d=z./y;
subplot(2,2,4);
plot(t,d);
xlabel('time');
ylabel('amplitude');
title('Demodulated Wave');



The output of the code is given as follows: