Professional Documents
Culture Documents
Lab 4
Lab 4
Submitted by:
Name: Muhammad Awab Ahsan
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:
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:
Making use of trigonometric identity and filtering at receiver, an estimated message signal
𝑚(𝑡) can be recovered at the receiver.
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:
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.
fs=100*fc;%sampling frequency.
ld=length(dsb_sc);
f=linspace(-fs/2,fs/2,ld);
pmo = pmo/Ac;
lr=length(msg_r);
subplot(4,1,1);
plot(t, msg);
xlabel('time (sec)');
ylabel('amplitude');
2|Page
Communication System Lab Report: 04
grid on;
subplot(4,1,2);
plot(t, carrier);
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,3);
plot(t, dsb_sc);
xlabel('time (sec)');
ylabel('amplitude');
grid on;
subplot(4,1,4);
plot(t, msg_r);
xlabel('time (sec)');
ylabel('amplitude');
grid on;
figure;
subplot(2,1,1);
plot(f, abs(DSB_SC));
xlim([-15 15]);
xlabel('frequency(hz)');
ylabel('amplitude');
grid on;
subplot(2,1,2);
plot(fr, abs(MSG_R));
xlim([-6 6]);
xlabel('frequency(hz)');
ylabel('amplitude');
grid on;
3|Page
Communication System Lab Report: 04
Output:
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:
5|Page
Communication System Lab Report: 04
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:
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
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
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:
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:
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
Solution:
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:
Solution:
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:
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