Analog Communication Systems labratory
8*/5&3SEMESTER–∼
SubmittedBy
'JTFIB5BEEFTF
Reg. No.: 18BEC
# 5FDI. (BEC)–I*YeaS
NameoftheSchool: SENSE
VELLOREINSTITUTEOFTECHNOLOGY
VELLORE–632014
TAMILNADU
INDIA
Date:07–June–
TASK-2
AIM: Design a real‐time FM system to transmit and receive your own voice.
Operation of FM:
• When an input voltage (say V)is given to Control
Voltage pin, the upper and lower comparator reference
changes to voltages V and V/2.
• So when the capacitor voltage becomes less than V/2,
output becomes high and the capacitor starts charging to
Vcc through resistor R1 and diode D.
• When the the capacitor voltage becomes greater than V,
output becomes low and the capacitor starts discharging
through resistor R2 and 7th pin of the IC
• So the time period is proportional to the input voltage V.
• So as V increases, time period of the output wave
increases and when V decreases time period of the
output wave decreases.
MATLAB CODE For FM Modulation:
FOR WBFM(M>>1)
close all clear all
fm1 = input('Message frequency= ');
fc= input('carrier frequency= ');
mi = input('Modulation frequency= ');
t = 0:0.0001:0.1;
m = sin(2*pi*fm1*t);
subplot(3,1,1);
plot(t,m);
c = sin(2*pi*fc*t);
subplot(3,1,2);
plot(t,c);
f = sin(2*pi*fc*t+(mi.*sin(2*pi*fm1*t)));
subplot(3,1,3);
plot(t,f);
FOR NBFM(M<<1)
close all clear all
fm1 = input('Message frequency= ');
fc= input('carrier frequency= ');
mi = input('Modulation frequency= ');
t = 0:0.0001:0.1;
m = sin(2*pi*fm1*t);
subplot(3,1,1);
plot(t,m);
c = sin(2*pi*fc*t);
subplot(3,1,2);
plot(t,c);
f = sin(2*pi*fc*t+(mi.*sin(2*pi*fm1*t)));
subplot(3,1,3);
plot(t,f);
Generation of FM signal with noise:
clc;
clear all;
close all;
fc= 10e+3;
fs = 100e+3;
fm = 200;
t = 0:1/
fs:((2/fm)-(1/fs));
x = cos(2*pi*fm*t);
kf = 2*pi*(fc/fs)*(1/max(max(x)));
kf = kf*(fm/fc);
opt = 10*kf;
b=0.1*ones(1,10);a=1;
subplot(221); plot(t,x);
title('Modulating signal');
s = modulate(x,fc,fs,'fm',opt);
subplot(222);
plot(t,s);
title('FM modulated signal');
m1 = demod(s,fc,fs,'fm',opt);
m_recov1 = filter(b,a,m1);
subplot(223); plot(t,m_recov1);
title('Demodulated signal');
sn = awgn(s,25); subplot(224);
plot(t,sn);
title('FM modulated signal with noise');
m = demod(sn,fc,fs,'fm',opt);
m_recov = filter(b,a,m);
figure(2); plot(t,m_recov);
title('Demodulated signal after adding noise');
FM with noise and spectrum:
clc;
clear all;
close all;
fs=1./0.001;
fm=input('Message frequency= ');
fc=input('Carrier frequency= ');
mi=input('Modulation index= ');
t=0:0.0001:0.1;
m=sin(2*pi*fm*t);
subplot(4,1,1);
plot(t,m);
xlabel('time');
ylabel('amplitude');
title('Message signal');
grid on c=sin(2*pi*fc*t);
subplot(4,1,2);
plot(t,c);
xlabel('time');
ylabel('amplitude');
title('Carrier signal');
grid on
y=sin(2*pi*fc*t+(mi.*sin(2*pi*fm*t)));
x=awgn(y,25);
subplot(4,1,3);
plot(t,y);
xlabel('time');
ylabel('amplitude');
title('FM signal');
subplot(4,1,4);
plot(t,x);
xlabel('time');
ylabel('amplitude');
title('FM signal with noise');
grid on
N_pt=1024;
y=fft(y,N_pt);
figure('position',[100 100 1100 400]);
xlabel('freq');
ylabel('amplitude');
title('spectrum');
plot((fs./2)*linspace(0,1,N_pt./2),abs(y(1:N_pt./2)));