Professional Documents
Culture Documents
Name: Meghana R
Reg no: 20BEC1042
Date: 10/01/2022
Block Diagram:
Frequency Modulator
Frequency Demodulator
Code:
%Frequency Modulation
clc;
close all;
clear all;
t=0:0.01:10
m=sin(2*pi*t/2)
subplot(4,1,1)
plot(t, m, 'LineWidth', 2, 'Color', 'r');
set(gca, 'fontsize', 12, 'fontweight', 'bold');
xlabel('t', 'fontsize', 12, 'fontweight', 'bold');
ylabel('m(t)', 'fontsize', 12, 'fontweight', 'bold');
title('Message Signal', 'fontsize', 12);
c=cos(2*pi*5*t)
subplot(4,1,2)
plot(t, c, 'LineWidth', 2, 'Color', 'b');
set(gca, 'fontsize', 12, 'fontweight', 'bold');
xlabel('t', 'fontsize', 12, 'fontweight', 'bold');
ylabel('c(t)', 'fontsize', 12, 'fontweight', 'bold');
title('Carrier Signal', 'fontsize', 12);
s=fmmod(m,5,200,2.5);
subplot(4,1,3)
plot(t, s, 'LineWidth', 2, 'Color', 'k');
set(gca, 'fontsize', 12, 'fontweight', 'bold');
xlabel('t', 'fontsize', 12, 'fontweight', 'bold');
ylabel('s(t)', 'fontsize', 12, 'fontweight', 'bold');
title('Frequency Modulated Signal', 'fontsize', 12);
%Frequency Demodulation
dm=fmdemod(s,5,200,2.5);
subplot(4,1,4)
plot(t, dm, 'LineWidth', 2, 'Color', 'g');
set(gca, 'fontsize', 12, 'fontweight', 'bold');
xlabel('t', 'fontsize', 12, 'fontweight', 'bold');
ylabel('m(t)', 'fontsize', 12, 'fontweight', 'bold');
title('Demodulated Signal', 'fontsize', 12);
Output:
Result: Thus, we have observed the frequency modulation of carrier wave and
demodulation of FM wave using MATLAB with respect to the message signal.