Lab 4
Lab 4
Fall – 2021
Theory: FM Modulation is varied its frequency based on message signal’s state change. When
message signal goes positive value to negative value then FM signal change it’s frequency and
vice versa. In the figure below we can see the result of modulating the carrier with the message
using FM modulation.
If we look into the FM signal it shows there has a no component of carrier frequency which is
different from DSBFC.
The SSB is also different from FM which can be understood by considering the mathematical
model that defines the FM signal,
FM = Ac×cos[2𝜋fct+𝛽sin(2𝜋fmt)]
Experimental Result:
Part A:
Code:
close all;
clear all;
clc;
Ac=2;
fc=50000;
t=0:1/(fc*20):20/fc;
csig=Ac*sin(2*pi*fc*t);
fm=5000;
m = square(2*pi*fm*t);
Kf=10000;
td=t(2)-t(1);
Theta =zeros(1,length(t));
for i=1:length(t)
Theta(i)=(2*pi*fc*t(i)+(2*pi*Kf*sum(m(1:i))*t
d));
end
MDS=Ac*sin(Theta);
figure(1)
plot(t,m,'linewidth',1);
hold on
plot(t,MDS)
xlabel('time')
ylabel('Amplitude')
title(['FM modulation for Kf= ' num2str(Kf)])
clc
close all
clear all
fc=50000;
Ac= 2;
[y,Fs] = audioread('Shayem.mp3');
t = 0:1/Fs:1100/Fs;
m = 3*y(140000:141100);
Kf=10000;
td=t(2)-t(1);
Theta =zeros(1,length(t));
for i=1:length(t)
Theta(i)=(2*pi*fc*t(i)+(2*pi*Kf*sum(m(1:i))*t
d));
end
MDS=Ac*sin(Theta);
figure(1)
plot(t,m,'r','linewidth',1);
hold on
plot(t,MDS)
xlabel('time')
ylabel('Amplitude')
title('FM modulated signal for voice signal')
Fig-5: FM modulated signal for voice signal.
close all;
clear all;
clc;
Ac=2;
fc=50000;
t=0:1/(fc*20):20/fc;
csig=Ac*sin(2*pi*fc*t);
fm=5000;
m = square(2*pi*fm*t);
Kf=10000;
td=t(2)-t(1);
Theta =zeros(1,length(t));
for i=1:length(t)
Theta(i)=(2*pi*fc*t(i)+(2*pi*Kf*sum(m(1:i))*t
d));
end
MDS=Ac*sin(Theta);
spk=fftshift(abs(fft(MDS)));
frq=linspace(-1/td,1/td,length(t));
figure(1)
plot(frq,spk,'linewidth',1);
xlabel('time')
ylabel('Amplitude')
title('Frequency spectrum for square wave')
%%%%%%%%%%%%%%%%%%%
fc=50000;
Ac= 2;
[y,Fs] = audioread('Shayem.mp3');
t = 0:1/Fs:1100/Fs;
m = 3*y(140000:141100);
Kf=10000;
td=t(2)-t(1);
Theta =zeros(1,length(t));
for i=1:length(t)
Theta(i)=(2*pi*fc*t(i)+(2*pi*Kf*sum(m(1:i))*t
d));
end
MDS=Ac*sin(Theta);
SS=abs(fft(MDS));
spk=fftshift(SS);
frq=linspace(-1/td,1/td,length(t));
figure(2)
plot(frq,spk,'linewidth',1);
xlabel('time')
ylabel('Amplitude')
title('Frequency spectrum for voice signal')
hold off
figure(3)
for d=1:length(SS)
if(SS(d)<3)
SS(d)=35*SS(d);
end
if(SS(d)<10)
SS(d)=15*SS(d);
end
if(SS(d)<15)
SS(d)=6*SS(d);
end
if(SS(d)<25)
SS(d)=4*SS(d);
end
if(SS(d)<35)
SS(d)=3*SS(d);
end
snv=sin(2*pi*SS(d)*t);
hold on
plot(t,snv,'linewidth',1)
end
xlabel('time')
ylabel('Amplitude')
title('FM signals is rich in sinewaves')
hold off
figure(3)
for d=1:length(SS)
% if(SS(d)<3)
% SS(d)=35*SS(d);
% end
% if(SS(d)<10)
% SS(d)=15*SS(d);
% end
% if(SS(d)<15)
% SS(d)=6*SS(d);
% end
% if(SS(d)<25)
% SS(d)=4*SS(d);
% end
% if(SS(d)<35)
% SS(d)=3*SS(d);
% end
snv=sin(2*pi*SS(d)*t);
hold on
plot(t,snv,'linewidth',1)
end
xlabel('time')
ylabel('Amplitude')
title('FM signals is rich in sinewaves')
Fig-9: plot of sine spectrum without rearrange values.
Q-Answer-1:
The frequency with the amplitude of message signal which multiplied with frequency sensitivity,
Kf.
Q-Answer-2:
Yes. We can calculate the frequency using Fi(t)= fc+Kf× 𝑚(𝑡) equation. When the wave is
negative, Fi(t)= fc+Kf× 𝑚(𝑡)
Q-Answer-3:
The relationship between the FM signal’s frequency deviation and the amplitude
of the message is, ∆𝑓=Kf×Am.
Conclusion:
From this lab, we achieved our objective and we know how to modulate FM signal using voice
signal and we can use this in other labs.