Poc lab 7

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

Department of Electrical and Computer Engineering

Principles of Communication Systems


Lab # 7
FM demodulation with and without SNR

Submitted by group:
1 Ahmed Zaman (Fa20-epe-078)
2 Shahzeb Afridi (Fa20-epe-049)
3 Hassan Khan (Fa20-epe-068)

Submitted to Lab Engineer: Usman Ali


Subject Teacher: Dr. Imadad Khan

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.

FM transmitters send modulated FM signals to be filtered, amplified, and demodulated at the FM


receivers in order to retrieve crucial data from them. In FM, information is stored as frequency
variations in the carrier signal. As information gets modulated to the carrier wave, the frequency
varies above and below the center frequency. The FM detector should be capable of making the
variations in output amplitude according to the variations in the frequency of the input FM
signal. The FM demodulator can be simplified as a circuit used to convert frequency variations
into voltage variations in FM communication receiver systems. The main objective of FM
detectors is to reproduce the signal that is given as input to the FM transmitter. The various types
of FM detectors use different techniques to convert frequency variations into amplitude
variations. The most basic frequency demodulation technique is slope detection.

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

X ¿ M =V M ∗cos ( 2∗π∗f m∗t s )


X ¿ C =V C ∗cos ( 2∗π∗f c∗t s )
Block Diagram:
FM
Message Signal FFT of FM Wave
Modulation

Power and Bandwidth


Carrier Signal

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

X_m=vm*cos(2*pi*fm*ts); % Message Signal


figure
plot(ts,X_m)
title('Message Frequency')
xlabel('Time')
ylabel('Amplitude')

%% Carrier Signal
X_c=vc*cos(2*pi*fc*ts); % Carrier Signal
figure
plot(ts,X_c);
title('Carrier Signal');
xlabel('Time')
ylabel('Amplitude');

%% Frequency Modulated signal


X_fm=vc*cos(2*pi*fc*ts+m.*X_m); % FM Signal
figure
plot(ts,X_fm)
title('FM WAVE')
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')

%%Passing through Awgn Channel


Xn=awgn(X_fm,10);
figure
plot(ts,Xn);
xlabel('Frequency')
ylabel('Amplitude')
title('Noise signal')

%%DEMODULATING THE NOISY SIGNAL


Xnd=fmdemod(Xn,fc,fs,df);
figure
plot(ts,Xnd);
xlabel('Frequency')
ylabel('Amplitude')
title('Demod Noisy Signal')
%% FFT OF FM SIGNAL
f=linspace(-fs/2,fs/2,N); % Vector Defined
N_FFT=abs(fftshift(fft(Xnd,N))); % Forrier Transform
figure
plot(f,N_FFT);
title('FFT of Noisy Demod Signal')
xlabel('Frequency')
ylabel('Amplitude')

%% DEMODULATING THE ORIGINAL SIGNAL


Xd=fmdemod(X_fm,fc,fs,df);
figure
plot(ts,Xd);
xlabel('Frequency')
ylabel('Amplitude')
title('Demoduled Signal')

%% 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).

Question and Answers:


1. What will happen to signal to noise ratio in FM, if its modulation index
is greater than 1?
The signal to noise ratio will increase as the frequency modulation wave generating
equation comprises m=df/fm of as the value of m increases it clearly effects snr as snr
comprises of FM equation.
2. Does the signal to noise ratio depend on the bandwidth of FM wave for
constant bandwidth of baseband signal? Give reason.
Yes, it does depend on the frequency of the baseband or message signal as m=df/fm.
3. What is the relationship of proportionality between modulation index
and SNR?
Direct relationship..

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.

You might also like