University of Engineering and Technology Lahore (Narowal Campus) Experiment No. 9 Frequency Modulation & Demodulation Using MATLAB
University of Engineering and Technology Lahore (Narowal Campus) Experiment No. 9 Frequency Modulation & Demodulation Using MATLAB
University of Engineering and Technology Lahore (Narowal Campus) Experiment No. 9 Frequency Modulation & Demodulation Using MATLAB
EXPERIMENT NO. 9
Frequency Modulation & Demodulation Using MATLAB
OBJECTIVE
In this lab, we shall use MATLAB to implement frequency modulation and demodulation
DESCRIPTION
Let us consider a sinusoidal message signal of 10 Hz and a sinusoidal carrier in the transmitter of
400 Hz and frequency deviation 100Hz, carrier amp: 1Vpp.
MATLAB Program
%%FM Modulation
fc=20;
fm=1;
ts=1/(10*fc);
fs=1/ts;
kf=2;
wc=2*pi*fc;
t=0:ts:2;
m=sin(2*pi*fm*t);
m_int=-2*pi*cos(2*pi*fm*t);
y=cos(wc*t+(kf*m_int));
figure(1);
subplot(211);
plot(t,m);
title('Input Signal');
subplot(212);
plot(t,y);
title('FM modultion of Input Signal');
%% Spectrum of FM signal
mf=fftshift(fft(m))*ts;
delta=fs/length(mf);
f=-fs/2:delta:fs/2-delta;
figure(2);
subplot(211);
plot(f,abs(mf));
title('Magnitude spectrum of Input Signal');
a=fftshift(fft(y))*ts;
delta=fs/length(a);
f=-fs/2:delta:fs/2-delta;
subplot(212);
University of Engineering and Technology Lahore (Narowal Campus)
plot(f,abs(a));
title('Magnitude spectrum of FM Signal');
%%% Differentiator
E=diff(y)/ts;
figure(3);
plot(E);
title('Differentiation of FM signal');
figure(4);
subplot(4,1,n);
plot(t1,vout,t1,E);
EXPERIMENT NO. 10
Phase Modulation and Demodulation Using Matlab
OBJECTIVE
To write and simulate a MATLAB program to generate a phase modulated signal and then demodulate it.
DESCRIPTION
MATLAB Program
clc;
clear all;
close all;
fm=25;
fc=400;
mf=10;
t=0:0.0001:0.1;
m=sin(2*pi*fm*t);
subplot(3,1,1);
plot(t,m);
xlabel('Time(s)');
ylabel('Amplitude(V)');
title('Message Signal');
grid on;
c=sin(2*pi*fc*t);
subplot(3,1,2);
plot(t,c);
xlabel('Time(s)');
ylabel('Amplitude(V)');
title('Carrier Signal');
grid on;
Lab Tasks
1) Write a MATLAB program to demodulate the PM signal and compare it with your message signal
on the same plot
University of Engineering and Technology Lahore (Narowal
Campus)
EXPERIMENT NO. 11
FM Modulation using PLL
Laboratory Tasks
In this Laboratory exercise you will generate a single-tone modulated FM signal using the Voltage-
controlled Oscillator (VCO) in a Phase-locked loop (PLL)
Background
Figure 1 shown below uses the VCO portion of the 4046 PLL.
The frequency deviation constant in FM i.e. 𝑘𝑓 can be determined for the above circuit by plotting
the VCO’s output frequency versus the VCO’s input voltage. This should give (approximately) a
straight line, its slope is 𝑘𝑓 in hertz-per-volt. The formula for modulation index for FM i.e. 𝛽𝑓 is
given in Chapter 4 of the text (by J. G. Proakis & M. Salehi 2014)
1. Investigate the above circuit by giving it different inputs through the circuit as shown in
Figure 2.
2. Find the frequency for the three VCO input voltages as shown in the table of Figure 2. From
that information, determine 𝑘𝑓 for your modulator.
3. Now apply a sinusoidal signal of 5 KHz with an amplitude of 2 Volts peak to peak and DC
offset of 5 Volts at the input of VCO. Determine 𝛽𝑓 of your signal.
5
University of Engineering and Technology Lahore (Narowal
Campus)
4. Show the time domain output of the VCO to the instructor. Essentially it is a rectangular
waveform with a varying frequency.
5. Write a brief summary of the background and calculations about using PLL circuit for FM
generation.
Figure 2
6
University of Engineering and Technology Lahore (Narowal
Campus)
EXPERIMENT NO. 12
FM Demodulation using PLL
Laboratory Tasks
In this Laboratory exercise you will demodulate a frequency modulated signal using PLL which
you have generated in lab#11.
Background
Figure 1 shows the frequency modulation and demodulation circuit.
1. Perform all steps given in previous lab#12 manual to generate the Frequency modulated
signal.
2. First PLL IC CD4046 is used for FM modulation and second CD4046 is used for
demodulation of FM modulated signal.
3. Build the circuit shown in Figure 1 for FM modulation and demodulation. It is not necessary
to use the buffer and output low pass filter.
4. Show the demodulated signal to the instructor.
5. Write a brief summary of the background and calculations about using PLL circuit for FM
demodulation.