Download as pdf or txt
Download as pdf or txt
You are on page 1of 30

Pak-Austria Fachhochschule Institute of Applied Sciences and

Technology, Haripur, Pakistan

DEPARTMENT OF ELECTRICAL ENGINEERING


Lab Report

Submitted by:
Name: Muhammad Awab Ahsan

Department: Electrical Engineering

Registration No: B20F0242EE016

Semester: 5th

Lab No : 4

Subject:
Communication System

Submitted to:

Engr. Rafi-Ullah

__________________

Instructor signature
Communication System Lab Report: 04

Lab No. 04
Implementation of Demodulation Amplitude Modulation and in Simulink

Objective:
In this lab, you are required to conduct simulation in Simulink/MATLAB to explore the
concepts of:
a. A message signal modulated by exploiting the amplitude of a high-frequency carrier
signal.
b. Demodulating an already modulated signal.

Amplitude Modulation:

Amplitude modulation (AM) is a one of the conventional techniques used to transmit


message signal 𝑚(𝑡) using a carrier wave 𝐴 cos (𝜔𝑐𝑡 + 𝜃𝑐), where 𝜔𝑐 = 2𝜋𝑓𝑐. The frequency
𝜔𝑐 and phase 𝜃𝑐 remain constant (assumption for 𝜃𝑐 = 0 can be made without any loss of
generality). If amplitude 𝐴 of the carrier wave is made proportional to the modulating signal
𝑚(𝑡), the resultant signal 𝑚(𝑡) cos(𝜔𝑐𝑡) is a modulated signal.

Amplitude Modulation with Suppressed (removed) Carrier:

AM with suppressed carrier is a technique where carrier IS NOT transmitted along with the
modulated signal 𝑚(𝑡) cos(𝜔𝑐𝑡) and hence receiver must generate a local carrier cos(𝜔𝑐𝑡) to
demodulate the incoming modulated signal. Thus, general equations for modulated and
demodulated signals (𝑥𝑆𝐶(𝑡) and 𝑦𝑆𝐶(𝑡) respectively) become:

𝑥𝑆𝐶(𝑡) = 𝑚(𝑡) cos(𝜔𝑐𝑡). (4.1)


𝑦𝑆𝐶(𝑡) = 𝑥𝑆𝐶(𝑡) cos(𝜔𝑐𝑡). (4.2)

Making use of trigonometric identity and filtering at receiver, an estimated message signal
𝑚(𝑡) can be recovered at the receiver.

Amplitude Modulation with Carrier:

AM with carrier is a technique where carrier IS transmitted along with the modulated signal
𝑚(𝑡) cos(𝜔𝑐𝑡) and hence receiver does not need to generate a local carrier cos(𝜔𝑐𝑡) to
demodulate the received modulated signal. Thus, general equations for modulated and
demodulated signals (𝑥𝑊𝐶(𝑡) and 𝑦𝑊𝐶(𝑡) respectively) become:

𝑥𝑊𝐶(𝑡) = [1 + 𝜇𝑚(𝑡)] cos(𝜔𝑐𝑡) (4.3)


𝑦𝑊𝐶(𝑡) =[𝑥𝑊𝐶(𝑡)]2 (4.4)

Making use of trigonometric identity, filtering, and mathematical processing on 𝑦𝑊𝐶(𝑡), message
signal 𝑚 (𝑡) can be recovered at receiver. In equation (4.3), 𝜇 is the modulation index.

1|Page
Communication System Lab Report: 04

Matlab codes:
T-1:
clear all;

clc;

t = 0:0.001:5; %time.

fm = 1;%frequency of message signal.

fc = 10;%frequency of carrier signal.

fs=100*fc;%sampling frequency.

Am = 5;%Amplitude of message signal.

Ac = 5;%Amplitude of carrier signal.

msg =Am.*cos(2*pi*fm*t);%message signal.

carrier = Ac.*cos(2*pi*fc*t);%carrier signal.

%===========DSB SC IN TIME DOMAIN==================

dsb_sc = msg.*carrier; %dsb sc modulated wave

%=====DSB SC IN FREQUENCY DOMAIN============

ld=length(dsb_sc);

f=linspace(-fs/2,fs/2,ld);

DSB_SC=fftshift(fft(dsb_sc,ld)/ld); %frequency spectrum of dsb_sc modulated


signal.

%=====DSB SC DEMODULATION TIME DOMAIN============

pmo = 2*dsb_sc.*carrier; %product modulator output

pmo = pmo/Ac;

nf = fm/fs; %normalised frequency

[num, den] = butter(5,3*nf); %butter worth lpf of 5th order

msg_r = filter(num,den,pmo); %demodulated signal after passing through lpf

%=====DSB SC DEMODULATION FREQUENCY DOMAIN============

lr=length(msg_r);

fr=linspace(-fs/2,fs/2,lr); %frequency bins

MSG_R=fftshift(fft(msg_r,lr)/lr); %frequency spectrum of demodulated signal

%================ PLOTTING =========================

subplot(4,1,1);

plot(t, msg);

title("MESSAGE SIGNAL (TIME DOMAIN)");

xlabel('time (sec)');

ylabel('amplitude');

2|Page
Communication System Lab Report: 04

grid on;

subplot(4,1,2);

plot(t, carrier);

title("CARRIER SIGNAL (TIME DOMAIN)");

xlabel('time (sec)');

ylabel('amplitude');

grid on;

subplot(4,1,3);

plot(t, dsb_sc);

title("MODULATED DSB SC SIGNAL (TIME DOMAIN)");

xlabel('time (sec)');

ylabel('amplitude');

grid on;

subplot(4,1,4);

plot(t, msg_r);

title("DEMODULATED DSB SC SIGNAL (TIME DOMAIN)");

xlabel('time (sec)');

ylabel('amplitude');

grid on;

figure;

subplot(2,1,1);

plot(f, abs(DSB_SC));

xlim([-15 15]);

title('DSB SC MODULATION IN FREQUENCY DOMAIN');

xlabel('frequency(hz)');

ylabel('amplitude');

grid on;

subplot(2,1,2);

plot(fr, abs(MSG_R));

xlim([-6 6]);

title('DSB SC DE MODULATION IN FREQUENCY DOMAIN');

xlabel('frequency(hz)');

ylabel('amplitude');

grid on;

3|Page
Communication System Lab Report: 04

Output:

Figure 1: Message, Carrier, Modulation and Demodulation

Figure 2: DSB SC Modulation and Demodulation frequency domain

4|Page
Communication System Lab Report: 04

T-2:
t = 0:0.001:5;
fH = 15;
fL = 2;
Ah=5;
Al=10;
xH = Ah*sin(2*pi*fH.*t);
xL = Al*sin(2*pi*fL.*t);
% Modulation
y = xL.*xH;
% De-Modulation By Synchoronous Method
m = (y.*xH)./(Ah*Ah);
% Filtering High Frequencies
[n,w] = buttord(2/1000,4/1000,.5,5);
[a,b] = butter(n,w,'low');
dem = filter(a,b,m);
lr=length(dem);
fr=linspace(-200/2,200/2,lr); %frequency bins
MSG_R=fftshift(fft(dem,lr)/lr); %frequency spectrum of demodulated signal
subplot(2,2,1);
plot(t,xH,'b',t,xL,'r');
title('m(t) & c(t)');
grid;
subplot(2,2,2);
plot(t,y,'k');
title('DSBSC');
grid;
subplot(2,2,3);
plot(t,m);
title('De-Modulated');
grid;
subplot(2,2,4);
plot(fr,abs(MSG_R));
xlim([-3 3]);
title('De-Modulated in frequency domain');
grid;

Output:

Figure 3: Message, Carrier, Modulated and Demodulated (time and frequency)

5|Page
Communication System Lab Report: 04

Tutorial #1: Implementation of DSB-SC on Simulink

In this tutorial, you will learn to implement and understand the basic working of a
communication system that employs amplitude modulation (without subcarrier) as the
modulation (and demodulation) scheme.
1) Use Signal Generator block mas your message signal. Set the frequency as 1 kHz
with a waveform of sine. For your own convenience, you can name the block as 𝑚(𝑡).
2) Insert a Sine wave block to work as “carrier”. Set the frequency to be 20 kHz and
Sample time: 1e-6.
3) Multiply the two signals, according to the equation (4.1) and setup the model
according to Fig1.
4) Run the simulation for 0.02 seconds.
5) The waveform on scope shall resemble the ones given in Figure. For spectrum
analyzer, you might to reduce the “full span” (to 80e3 Hz for instance) to have a
better view.
6) Now, to implement equation (4.2), the modulated signal must be multiplied with the
carrier (assumed to be generated at receiver). Note, that in this model, the channel is
assumed to exhibit ideal behaviour.
7) Apply a low pass filter (for example Analog Filter Design) with a cutoff frequency
equivalent to 5 kHz to the output of demodulator (the second multiplier). Set a high
filter order such as 200. Apply a gain of 2 to completely retrieve the message signal as
shown in Figure.
8) Run the simulation to observe the results.

Solution:

Figure 4: Block diagram

Explanation:
1) Here we took the signal generator as the message signal generator. And the sine wave
function generator as the carrier wave generator.
2) Both signals are fed to the product block where both are multiplied by each other.
3) Now plot, the message, carrier and the modulated(multiplied) signal.
4) Pass the modulated signal through the zero-order hold and fed it to the spectrum
analyser.
5) In the second part we pass the modulated signal to the product block and the other
input is the carrier wave.
6) Pass the resultant through the Analog filter design, here we took the Butterworth filter
of the properties defined in fig 2(d).
7) Apply a gain of 2 to the out-of-filtered signal.
8) Now plot the resultant at both the scope and the spectrum analyser.

6|Page
Communication System Lab Report: 04

Properties:

(a) (b)

(c) (d)

Figure 5: Tutorial # 1 block parameters: (a) Carrier wave for modulation ; (b) Carrier wave for demodulation ; (c)
Message Signal ; (d)Butterworth filter

7|Page
Communication System Lab Report: 04

Output:

(a)

(b)

8|Page
Communication System Lab Report: 04

(c)

(d)

Figure 6: Tutorial # 1 plots and graphs: (a) Modulated signal in frequency domain ; (b) Demodulated signal in
frequency domain ; (c) Message, Carrier and modulated signal in time domain ; (d) Demodulated signal in time
domain

9|Page
Communication System Lab Report: 04

Lab Task 01:


1) Re-develop the model of Tutorial #1 with frequency of your message signal to be
(1+xx/100) kHz.
2) In the Analog Filter Design block, select Design method: Chebyshev II, Filter order:
50, and stopband edge frequency (cutoff frequency) to 10 kHz.
3) Use “AWGN channel” block in place of the channel and set the initial seed as 𝑋𝑋
(last two digits of your registration number) and Mode: Signal to noise ratio (SNR).
4) Develop three results (i.e., run simulation three times) by setting SNR (dB) to be 2, 10
and 50. Comment on the results obtained (especially on the time-domain output
signal).
Solution:

Figure 7: Block Diagram

Explanation:
1) Here we took the signal generator as the message signal generator. And the sine wave
function generator as the carrier wave generator.
2) Both signals are fed to the product block where both are multiplied by each other.
3) Now plot, the message, carrier and the modulated(multiplied) signal.
4) Pass the modulated signal through the zero-order hold and fed it to the spectrum
analyser.
5) In the second part we pass the modulated signal to the product block and the other
input is the carrier wave.
6) Pass the resultant through the Analog filter design, here we took the Butterworth filter
of the properties defined in figure.
7) Apply a gain of 2 to the out-of-filtered signal.
8) Now plot the resultant at both the scope and the spectrum analyser.

10 | P a g e
Communication System Lab Report: 04

Properties:

(a) (b)

(b) (d)

(e)

Figure 8: Task # 1 block parameters: (a) Message signal ; (b) AWGN with SNR 2 dB ; (c) AWGN with SNR 10 dB ; (d) AWGN
with SNR 50 dB ; (e) Chebyshev filter

11 | P a g e
Communication System Lab Report: 04

Output:

(a)

(b)

12 | P a g e
Communication System Lab Report: 04

(c)

(d)

13 | P a g e
Communication System Lab Report: 04

(e)

(f)

14 | P a g e
Communication System Lab Report: 04

(g)

(h)

Figure 9: Task # 1 plots and graphs: (a) Modulated signal in frequency domain ; (b) Message, Carrier and
modulated signal in time domain ; (c) demodulated signal in frequency domain at SNR(dB)=2 ; (d) demodulated
signal in time domain at SNR(dB)=2 ; (e) demodulated signal in frequency domain at SNR(dB)=10 ; (f)
demodulated signal in time domain at SNR(dB)=10 ; (g) demodulated signal in frequency domain at SNR(dB)=50
; (h) demodulated signal in time domain at SNR(dB)=50

Note:
We can see that by increasing the SNR dB in AWGN channel our signal becomes clean in
both the time and frequency domains.

15 | P a g e
Communication System Lab Report: 04

Tutorial #2: Implementation of DSB-WC on Simulink

In this tutorial, you will learn to implement and understand the basic working of a
communication system that employs amplitude modulation (with subcarrier) as the
modulation (and demodulation) scheme.
1. Assume the same model as developed in Tutorial #1
2. For implementation of DSB-WC, make the necessary amendments as proposed by
Equation (4.3). Your assembled shall resemble the one as given in Figure.
3. To implement the demodulator at receiver, equation (4.4) is to be implemented.
4. Complete the model as shown in Figure . You should know conceptually that why the
blocks such as “gain factor of 2” and constant value of 1 have been used.

Solution:

Figure 10: Block Diagram

Explanation:
1) Pass the message signal through gain which represent modulating index.
2) Add constant 1 and the message signal and fed to product block.
3) Product block has two inputs one from addition block and other the carrier wave.
4) Plot modulated, carrier and the added signals on the scope.
5) Also represent the modulated signal into frequency domain using spectrum analyser.
6) Take square of the modulated signal and provide it with the gain of two.
7) Pass the resultant through the Bessel filter with the properties defined below.
8) Now subtract 1 from it.
9) Now plot in time domain and frequency domain.
Properties:

Figure 11: Bessel filter

Note: In this case, all values except analog filter design are similar to tutorial one. So refer to tutorial one for any
queries.

16 | P a g e
Communication System Lab Report: 04

Output:

(a)

(b)

17 | P a g e
Communication System Lab Report: 04

(e)

(d)

Figure 12: Tutorial # 2 plots and graphs: (a) Modulated signal in frequency domain ; (b) Demodulated signal in frequency
domain ; (c) Message, Carrier and modulated signal in time domain ; (d) Demodulated signal in time domain

18 | P a g e
Communication System Lab Report: 04

Lab Task 02:

1) Re-develop the model of Tutorial #2 with frequency of your message signal to be (1


+(xx/100 )) kHz. Set the modulation index to be 0.3( (𝑥𝑥)/ 99 ) + 0.5).
2) In Analog Filter Design block, select Design method: Bessel, Filter order: 25, and
stopband edge frequency (cutoff frequency) to 5 kHz.
3) Use “AWGN channel” block in place of channel and set initial seed as 𝑋𝑋 (last two
digits of your registration number) and Mode: Signal to noise ratio (SNR).
4) Develop three results (i.e., run simulation three times) by setting SNR (dB) to be 2, 10
and 50. Comment on the results obtained (especially on the time-domain output
signal).

Solution:

Figure 13: Block Diagram

Explanation:
1) Pass the message signal through gain which represent modulating index.
2) Add constant 1 and the message signal and fed to product block.
3) Product block has two inputs one from addition block and other the carrier wave.
4) Plot modulated, carrier and the added signals on the scope.
5) Also represent the modulated signal into frequency domain using spectrum analyser.
6) Take square of the modulated signal and provide it with the gain of two.
7) Pass the resultant through the Bessel filter with the properties defined below.
8) Now subtract 1 from it.
9) Now plot in time domain and frequency domain.

19 | P a g e
Communication System Lab Report: 04

Properties:

(a) (b)

(c) (d)

(e)

Figure 14: Task # 2 block parameters: (a) Message signal ; (b) Modulating index value ; (c) SNR dB=2 ; (d) SNR dB=10 ;
(e) SNR dB=50 ;

Note: Message signal and Bessel filter have same values as tutorial 2 so refer to it.

20 | P a g e
Communication System Lab Report: 04

Output:

(a)

(b)

21 | P a g e
Communication System Lab Report: 04

(c)

(d)

22 | P a g e
Communication System Lab Report: 04

(e)

(f)

23 | P a g e
Communication System Lab Report: 04

(g)

(h)

Figure 15: Task # 2 plots and graphs: (a) Demodulated signal in frequency domain at SNR(dB)=2 ; (b) demodulated
signal in time domain at SNR(dB)=2 ; (c) Demodulated signal in frequency domain at SNR(dB)=10 ; (d)
demodulated signal in time domain at SNR(dB)=10 ; (e) demodulated signal in frequency domain at SNR(dB)=50
; (f) demodulated signal in time domain at SNR(dB)=50

24 | P a g e
Communication System Lab Report: 04

Experiment:

Develop an amplitude modulation DSB-SC communication system and assume


𝑚(𝑡)=sin(2𝜋𝑓1𝑡) + sin(2𝜋𝑓2𝑡), and 𝑓1 = (5(𝑥𝑥/99) + 5) kHz and 𝑓2 = (5(𝑥𝑥/99) +7) kHz.
Choose an appropriate frequency for the carrier signal. Submit your model along with time
and frequency domain plots after EACH step.

Solution:

Figure 16: Block Diagram

Explanation:

• Take two function generators and set their frequencies according to give frequencies.
• Pass both to sum block.
• Pass this signal and the carrier signal into the product box.
• Plot message, carrier and modulated signal in time domain.
• Plot message, carrier and modulated signal in frequency domain.
• For AWGN set roll number as seed value and change the SNR dB as given.
• Pass the modulated signal and the carrier into the product block.
• Pass the demodulated signal through the Chebyshev filter.
• Pass the resultant through thr gain of 2.
• Plot demodulated signal in time domain.
• Plot demodulated signal in frequency domain.

Properties:

Figure 17: Message Signal Properties(sum of both)

25 | P a g e
Communication System Lab Report: 04

Output:

(a)

(b)

26 | P a g e
Communication System Lab Report: 04

(c)

(d)

27 | P a g e
Communication System Lab Report: 04

(e)

(f)

28 | P a g e
Communication System Lab Report: 04

(g)

(h)

Figure 18: experiment plots and graphs: (a) modulated signal in frequency domain ; (b) message, carrier and
modulated signal in time domain (c) Demodulated signal in frequency domain at SNR(dB)=2 ; (d) demodulated
signal in time domain at SNR(dB)=2 ; (e) Demodulated signal in frequency domain at SNR(dB)=10 ; (f)
demodulated signal in time domain at SNR(dB)=10 ; (g) demodulated signal in frequency domain at SNR(dB)=50
; (h) demodulated signal in time domain at SNR(dB)=50

Conclusion:
In this lab we performed dsbsc using the Simulink tool. Here we considered systems with and
without AWGN and studied its effect on the outputs. Performed two types of DSBSC one
with suppresses carrier and the other with carrier. The task were quite difficult and
cumbersome to implement. This lab helps me to greatly understand the concepts of DSBSC.

THE END
29 | P a g e

You might also like