Poc lab 7
Poc lab 7
Poc lab 7
Submitted by group:
1 Ahmed Zaman (Fa20-epe-078)
2 Shahzeb Afridi (Fa20-epe-049)
3 Hassan Khan (Fa20-epe-068)
A P C
Total Marks 1 5 4
Obtained Marks
Experiment 7
FM demodulation with and without SNR
1.1Statement of problem:
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.
1.2Literature Background:
Once information is transmitted as FM signals, it needs to be retrieved at the receiving end. The
demodulation process recovers the original information (modulating signal) from the carrier
signal. The process of demodulation is also called detection or discrimination, and the device
constructed for demodulation can be called a demodulator, detector, or discriminator.
Signal-to-noise ratio (often abbreviated as SNR or S/N) is a measure used in science and
engineering that compares the level of a desired signal to the level of background noise. The
signal-to-noise ratio, the bandwidth, and the channel capacity of a communication channel are
connected by the Shannon–Hartley theorem1. Signal-to-noise ratio is sometimes used informally
to refer to the ratio of useful information to false or irrelevant data in a conversation or
exchange.
Equations:
X ¿ FM =( 2∗π∗f c∗t s + m∗X ¿ M )
df
m=
fm
1.3 Procedure:
Mat lab Code :
%%Lab 7 FM Demodulation
clc %Command window
clear all %Clearing work space
close all %Closing figures
t=0:1:150; % Time
fm=100; % Message frequency
fc=10*fm; % Carrier Frequency
fs=10*fc; % Sampling Frequency
vm=5; % Amplitude of message signal
vc=5; % Amplitude of Carrier Signal
df=1*fm; % Frequency Deviation
m=df/fm; % Modulation index
ts=t/fs; % Sampling Time
N=1024; % Width
%% Message Signal
%% Carrier Signal
X_c=vc*cos(2*pi*fc*ts); % Carrier Signal
figure
plot(ts,X_c);
title('Carrier Signal');
xlabel('Time')
ylabel('Amplitude');
%% FFT OF FM SIGNAL
f=linspace(-fs/2,fs/2,N); % Vector Defined
FM_FFT=abs(fftshift(fft(X_m,N))); % Forrier Transform
figure
plot(f,FM_FFT);
title('FFT of Message Signal')
xlabel('Frequency')
ylabel('Amplitude')
%% FFT OF FM SIGNAL
f=linspace(-fs/2,fs/2,N); % Vector Defined
Nt_FFT=abs(fftshift(fft(Xd,N))); % Forrier Transform
figure
plot(f,Nt_FFT);
title('FFT of Demod Signal')
xlabel('Frequency')
ylabel('Amplitude')
%% Calculating the SNR
SNR=sum(Xd.^2)/sum((Xd.^2)-(X_m.^2))
%% SNR IN DB
snr=10*log10(SNR)
disp('snr in db')
%% POWER
P = sum(((X_fm).^2)/length(t)) % Power In Side Bands
ps=P-((sum(X_c).^2)/length(t));
% Displaying Power
%% BANDWIDTH
B=2*(df+fm); % Calculating
Bandwidth
disp('Bandwidth')
disp(B
1.4 Analysis:
Figure Analysis:
After analyzing this figure and the corresponding code that helped us generate
such a signal we understood that the V ¿ M represents the amplitude of the message
signal and the figure verifies that as its amplitude varies from -5 to +5. Secondly
the figure also tells us that it has a fundamental time period of 0.01 s to verify this
1
by code we have the f m set at 100 and T= that gives us T=0.01s
f
Figure Analysis:
This figure represents the carrier signal. The amplitude of this signal is set at
5.The frequency of this signal is 10∗(100)Hz. The fundamental time period is T
1
and T= so that equates to T=0.01s. Please note that the frequency of the carrier
f
signal is far greater (10x) than the frequency of message signal.
Figure Analysis:
This figure represents the frequency modulated wave and it shows the behavior as follows
as the amplitude was decreasing the spacing between the 2 consecutive troughs increased
ad as the amplitude started to rise again the distance/spacing between 2 consecutive troughs
start to decrease and this phenomenon tells us that the frequency of the signal has been
changed.
Figure Analysis:
Figure Analysis:
This figure represents the noise frequency modulated signal. The amplitude of
this signal is set at 5.The frequency of this signal is 10∗(100)Hz. The
1
fundamental time period is T and T= so that equates to T=0.01s. Please note that
f
the frequency of the noisy signal is far greater (10x) than the frequency of
Figure Analysis:
This figure is representation of demodulated signal with added noise as we passed it through
AWGN channel. What this does is it creates distortion in the amplitude of the demodulated
signal.
Figure Analysis:
This figure basically shows nothing except the Fourier transform of the noisy demodulated
signal.
Figure Analysis:
This figure is representation of demodulated signal without added noise. Observation taken is
that there is no effect on the amplitude of the demodulated signal. And clarifies that there is
no relation between amplitude and frequency in frequency modulation. Phase shift of 90 is
also there.
Figure Analysis:
This figure basically shows nothing except the Fourier transform of the demodulated signal.
Hardware Implementations:
Figure Analysis:
This figure is basically the photo of the trainer connect across the frequency demodulator and
modulator circuit present in this trainer showing us the after effects of modulating the signal
and then demodulating it.We observe that the message signal at output and input is no
different in case of without added noise.
Figure Analysis:
This figure is basically an oscilloscopic picture of the carrier signal generated with the help of
function generator present in the trainer.
Figure Analysis:
This figure is basically an oscilloscopic picture of the frequency modulated signal.
Figure Analysis:
This figure is basically an oscilloscopic picture of the frequency demodulated signal with
added noise. The noise and distortion in the demodulated signal is due to the electronic
components (res, cap, IC’s).
TABLE
S.No. Modulation index SNR in dB
1 0.5 12.4667
2 1 12.3297
3 2.5 14.9901
4 3.0 10.4974
Conclusion:
In this lab experiment we understood the relationships between signal to noise ratio with
modulation index (df/fm) and with bandwidth. We also saw that without the addition of noise it’s
pretty easy to recover the message signal. Later we also saw that if modulation index is greater
than one the snr increases.