Lab Assignment 4 POCS
Lab Assignment 4 POCS
Abbottabad Campus
Department of Electrical (Power) Engineering
Lab Assignment: 5
Name/Registration No.:
Shahab Ahmad/FA19-EPE-105
Zabeeh Ullah/FA19-EPE-028
Taha/FA19-EPE-115
Semester: 6th Semester
Class/Section: EPE-6R
Course: Principle of Communication System
Course Teacher: Dr. Ihsan Ullah
Lab Engineer: Sir Usman Ali
Submission Date: Tuesday, April 19th, 2022
A P C
FM demodulation and SNR
PROBLEM STATEMENT
Generate FM wave in noisy environment at different modulation index. Demodulate the FM
wave and compare the output signal to noise ratio (So/No) at different modulation index.
LITERATURE BACKGROUND
Amplitude modulation (AM) is a technique used in electronic communication, most commonly
for transmitting information via a radio carrier wave. AM works by varying the strength of the
transmitted signal in relation to the information being sent. For example, changes in the signal
strength can be used to reflect the sounds to be reproduced by a speaker, or to specify the light
intensity of television pixel.
Procedure
Code:
clc
clear all
close all
%% Intial Parameter
m=0.2;
t=0:1:200;
fm=50;
fc=10*fm;
fs=10*fc;
ts=t/fs;
ph=0;
%% information signal
x_m=cos(2*pi*fm*ts + ph);
figure
plot (ts, x_m)
xlabel ('time')
ylabel('magnitude')
title('Base Band Signal')
grid on
%% AWGN Channel
SNR =10;
Y=awgn(m_t,SNR)
figure
plot(ts,Y)
xlabel('time')
ylabel('Magnitude')
title('AM Modulation Signal with noise')
grid on
%% AM Demodulation with noise
mt_noise=amdemod(Y,fc,fs)
figure
plot(ts,mt_noise)
xlabel('time')
ylabel('Magnitude')
title('AM Demodulated Signal')
grid on
%%SNR in dB
snr_dp=sum(mt.^2)./sum(mt.^2-mt_noise.^2);
snrdb=abs(10.*log(snr_dp));
disp('Signal to noise ratio (SNR_db)');
display(snrdb)
/length(z)/2;
plot(frq/1000,z);
title('FFT of Modulated Signal');
xlabel('F in Hz');
ylabel('Amplitude');
grid on;
power=sum(Y)/length(z)
Bandwidth=2*fm
Output:
Carrier Signal
1
0.8
0.6
0.4
0.2
magnitude
-0.2
-0.4
-0.6
-0.8
-1
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04
time
Message Signal
20
15
10
5
Vm
-5
-10
-15
-20
0 20 40 60 80 100 120 140 160 180 200
Time
AM Modulation
1.5
0.5
Magnitude
-0.5
-1
-1.5
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04
time
2.4
2.2
2
Magnitude
1.8
1.6
1.4
1.2
0.8
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04
time
AM Modulation Signal with noise
2
1.5
0.5
Magnitude
-0.5
-1
-1.5
-2
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04
time
AM Demodulated Signal
3
2.5
2
Magnitude
1.5
0.5
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04
time
Analysis:
S. No. Modulation Index (µ) Signal to noise ratio
(SNRdB)
1 0.2 39.5162
2 1 34.4158
3 2.5 46.1670
4 3 56.6056