2.1 Title: Design and Implementation of a Frequency Modulator and Demodulator
2.2 Aim of the experiment:
To design and implement a Frequency Modulation (FM) modulator and demodulator and demonstrate its principle of operation for a given specification.
2.3 Theoretical background for the experiment:
Frequency Modulation (FM) is a method of modulating a carrier wave by varying its frequency according to the instantaneous amplitude of the message signal. Unlike Amplitude Modulation (AM), FM is less susceptible to noise and interference. The FM signal can be expressed as:
where:
Amplitude of the carrier signal
Carrier frequency
Frequency deviation (proportional to the amplitude of the message signal)
Message signal (modulating signal)
Demodulation is achieved using an FM demodulator, typically involving a frequency discriminator and a low-pass filter.
2.4 Design:
Modulator: Generate the FM signal by varying the carrier frequency based on the message signal.
Demodulator: Use a phase-locked loop (PLL) or software-based discriminator to recover the original message signal.
2.5 Step by step procedure to carry out the experiment:
Generate a sinusoidal message signal .
Generate a sinusoidal carrier signal .
Implement frequency modulation by varying the carrier frequency based on .
Observe the FM signal's spectrum to confirm frequency variation.
For demodulation:
Use a frequency discriminator to convert frequency changes back to amplitude variations.
2.6 Code:
%FM
fs=1000;
t=0:1/fs:1;
Ac=10;
Am=2;
fc=50;
fm=10;
kf=50;
mt=Am*cos(2*pi*fm*t);
ct=Ac*cos(2*pi*fc*t);
%Frequency modulation
integral_mt = cumtrapz(t, mt);
s_t=Ac*cos(2*pi*fc*t+2*pi*kf*integral_mt);
%Phase modulation
p_t=Ac * cos(2 * pi * fc * t + kf * mt);
% Message Signal
subplot(4,1,1);
plot(t,mt);
xlabel(' time')
ylabel('mt');
title('Message signal');
% Carrier Signal
subplot(4,1,2);
plot(t,ct);
xlabel(' time')
ylabel('ct');
title('Carrier signal');
% Frequency modulated Signal
subplot(4,1,3);
plot(t,s_t);
xlabel(' time')
ylabel('Frequency modulated Signal');
title('Frequency modulated Signal');
% Phase modulated Signal
subplot(4,1,4);
plot(t,p_t);
xlabel(' time')
ylabel('Phase modulated Signal');
title('Phase modulated Signal');
% Frequency domain representation
N = length(s_t);
f = linspace(-fs/2, fs/2, N);
s_t_fft = fftshift(fft(s_t)/N);
figure;
plot(f, abs(s_t_fft));
title('Frequency Domain Representation');
xlabel('Frequency (Hz)');
ylabel('Amplitude');
2.7 Observations and results:
· The FM signal displays frequency variation corresponding to the amplitude of the message signal.
· The demodulated signal matches the original message signal after low-pass filtering.
2.8 Plotting of the graph:
2.9 Frequency Demodulator Code
%FM
fs=1000;
t=0:1/fs:1;
Ac=10;
Am=2;
fc=50;
fm=10;
kf=50;
mt=Am*cos(2*pi*fm*t);
ct=Ac*cos(2*pi*fc*t);
%Frequency modulation
integral_mt = cumtrapz(t, mt);
s_t=Ac*cos(2*pi*fc*t+2*pi*kf*integral_mt);
%frequency demodulation
V_t=s_t+(s_t.*s_t);
% Message Signal
subplot(4,1,1);
plot(t,mt);
xlabel(' time')
ylabel('mt');
title('Message signal');
% Carrier Signal
subplot(4,1,2);
plot(t,ct);
xlabel(' time')
ylabel('ct');
title('Carrier signal');
% Frequency Demodulated Signal
subplot(4,1,3);
plot(t,V_t);
xlabel(' time')
ylabel('Frequency Demodulated Signal');
title('Frequency Demodulated Signal');
%LPF message signal
[b,a]=butter(5,fm/(fs/2),'low');
filtered_signal=filter(b,a,V_t);
subplot(4,1,4);
plot(t, filtered_signal);
title('Filtered Signal (LPF)');
xlabel('Time (s)');
ylabel('Amplitude');
2.9 Conclusion of the experiment:
The FM modulator and demodulator were successfully implemented. The frequency modulation process was observed to encode the message signal as variations in the carrier frequency. Using a discriminator and low-pass filter, the original message signal was accurately recovered, demonstrating the principle of FM.