Saturday, June 2, 2012

Frequency Modulation and Demodulation matlab code


Frequency Modulation and Demodulation matlab code


Aim: To perform Frequency Modulation & Demodulation of a signal

Equipments:

Operating System: -     Windows XP
Software: -                   Matlab 7.5, Image Processing Toolbox.

Program:

Fs = 8000; % Sampling rate of signal
Fc = 3000; % Carrier frequency
t = [0:Fs]/Fs; % Sampling times
s1 = sin(2*pi*10*t); % Channel 1
%s2 = sin(2*pi*150*t)+2*sin(2*pi*900*t); % Channel 2
%x = [s1]; % Two-channel signal
dev = 50; % Frequency deviation in modulated signal
y = fmmod(s1,Fc,Fs,dev); % Modulate both channels.
z = fmdemod(y,Fc,Fs,dev); % Demodulate both channels.
subplot(2,1,1); plot(t,y); title('frequency modulated image');% Plot x on top.
subplot(2,1,2); plot(t,z);title('demodulated image');% Plot y below.


Results:


No comments:

Post a Comment