CS Lab Manual
CS Lab Manual
Communication Systems
B.E Electrical Engineering
Group Members
Introduction
Amplitude modulation is done by taking the product of message and carrier signals and then
demodulate it.
Objective
In this lab, we'll learn how to modulate a signal with full band amplitude modulation to
prepare it for transmission and then demodulate it to model a receiver.
Background
Our message signal is a sinusoid with a frequency of fm and an amplitude of Am. The
carrier signal has an amplitude of Ac and a frequency of fc.
Message Signal:
𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴(2𝑓𝑓𝐴𝐴𝑓𝑓) = 𝐴𝐴(𝑓𝑓)
Carrier Signal:
𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴(2𝑓𝑓𝐴𝐴𝑓𝑓) = 𝐴𝐴(𝑓𝑓)
Modulation is accomplished by multiplying the carrier signal with the message signal, as
seen below:
Modulated Signal:
(1 + 𝐴𝐴𝐴𝐴𝐴𝐴(2𝑓𝑓𝐴𝐴𝑓𝑓)) = 𝑔𝑔(𝑓𝑓). 𝐴𝐴(𝑓𝑓)
The modulated signal is multiplied by the carrier signal and then passed through a lowpass
filter to produce demodulation.
Demodulated Signal:
𝑀𝑀(𝑓𝑓) = 𝑔𝑔(𝑓𝑓). 𝐴𝐴(𝑓𝑓)
Scope Output
Matlab code
clc clear
close all,
Am = 1;%Amplitude of message signal
Ac = 1;%Amplitude of Carrier signal
u = Am/Ac;%µ omega_m = 1;%?m
omega_c = 30;%?c t = -
10:0.0001:10;
Modulated = (1+u*(message_signal/Ac)).*carrier_signal;
demodulated = Modulated.*carrier_signal;
[B A] = butter(50, 0.0001);
M = filter(B, A, demodulated);
subplot(411)
plot(t,message_signal,'r')
title("m(t)")
subplot(412)
plot(t,carrier_signal,'r')
title("c(t)") subplot(413)
plot(t,Modulated,'r')
title("g(t)") subplot(414)
plot(t,M,'r')
title("M(t)")
Conclusion
To prepare a signal for transmission, we used full band amplitude modulation and then
demodulated it. We modulated the signal by multiplying it by the carrier signal and using
modulation index one, then demodulating it with the carrier signal. When we multiply the
modulated signal by the carrier signal and send it through a low pass filter, we get the
demodulated signal.
LAB-03
Introduction
Using the half band of the modulated signal to perform amplitude modulation and then
demodulation.
Objective
In this lab, we'll learn how to modulate a signal with half band amplitude modulation to
prepare it for transmission and then demodulate it to model a receiver.
Background
Our message signal is a sinusoid with a frequency of fm and an amplitude of Am. The
carrier signal has an amplitude of Ac and a frequency of fc.
Message Signal:
𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴(2𝑓𝑓𝐴𝐴𝑓𝑓) = 𝐴𝐴(𝑓𝑓)
Carrier Signal:
𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴𝐴(2𝑓𝑓𝐴𝐴𝑓𝑓) = 𝐴𝐴(𝑓𝑓)
Modulation is accomplished by multiplying the carrier signal with the message signal, as
seen below:
Modulated Signal:
(1 + µ 𝐴𝐴𝐴𝐴𝐴𝐴(2𝑓𝑓𝐴𝐴𝑓𝑓)). 𝐴𝐴(𝑓𝑓) = 𝑔𝑔(𝑓𝑓)
The modulated signal is multiplied by the carrier signal and then passed through a lowpass
filter to produce demodulation.
Demodulated Signal:
𝑀𝑀(𝑓𝑓) = 𝑔𝑔(𝑓𝑓). 𝐴𝐴(𝑓𝑓)
Simulink
Scope Output
Matlab code
close all
clear all
clc
Am = 1; Ac =
1; u = Am/Ac;
omega_m = 20;
omega_c = 200;
t = -2:0.001:2;
modulated = (1+u*(message_signal/Ac)).*carrier_signal;
[D, C] = butter(12, 0.5); modulated_1
= filter(D, C, modulated);
demodulated = modulated_1.*carrier_signal;
[B, A] = butter(8, 0.01);
M = filter(B, A, demodulated);
subplot(411)
plot(t,message_signal,'r') title("Message
Signal")
subplot(412)
plot(t,carrier_signal,'r') title("Carrier
Signal")
subplot(413)
plot(t,modulated_1,'r')
title("Modulated Signal")
subplot(414)
plot(t,M,'r')
title("Demodulated Signal")
Conclusion
We performed modulation but this time we only used half band of the modulated signal by passing
it through a low pass filter and then demodulating it.
LAB-04
Introduction
Several modulated signals can be transmitted as a single signal over a single channel and
then can be demodulated at the receiver.
Objective
In this lab, we'll learn how to modulate a signal with half band amplitude modulation to
prepare it for transmission and then demodulate it to model a receiver.
Background
We modulate three signals by multiplying them with three different carriers and passing
them through an adder. At the receiver end, we first use a band pass signal to recover the
spectrum of each modulated signal because they are all at the same carrier frequency, and
then we pass each of them through a low pass filter to recover our signals.
Message Signals:
m1(t) = 𝐴𝐴𝐴𝐴1𝑆𝑆𝑆𝑆𝑆𝑆(2𝜋𝜋 ∗
200 ∗𝑡𝑡) m2(t) =
𝐴𝐴𝐴𝐴2𝑆𝑆𝑆𝑆𝑆𝑆(2𝜋𝜋150 ∗ 𝑡𝑡)
m3(t) = 𝐴𝐴𝐴𝐴3𝑆𝑆𝑆𝑆𝑆𝑆(2𝜋𝜋100 ∗
𝑡𝑡)
Carrier Signals:
c1(t) = 𝐴𝐴𝐴𝐴1𝑆𝑆𝑆𝑆𝑆𝑆(2𝜋𝜋 ∗
5000𝑡𝑡) c2(t) =
𝐴𝐴𝐴𝐴2𝑆𝑆𝑆𝑆𝑆𝑆(2𝜋𝜋10000𝑡𝑡) c3(t)
= 𝐴𝐴𝐴𝐴3𝑆𝑆𝑆𝑆𝑆𝑆(2𝜋𝜋15000𝑡𝑡)
The Band pass filter cut-off frequency for c1(t) will be [6000,8000].
The Band pass filter cut-off frequency for c1(t) will be [10000,14000].
Simulink
Scope Input
Scope Output
Matlab code
Demodulation
Conclusion
We performed modulation but this time we have multiple modulated signals and pass them through
single channel to get demodulation.
LAB-05
Introduction
A continuous time signal can be represented in its samples and can be recovered back when
sampling frequency fs is greater than or equal to the twice the highest frequency component
of message signal.
𝑓𝑓𝑓𝑓≥ 2𝑓𝑓𝑓𝑓.
Objective
In this lab, we'll learn how to sample a signal.
Background
Sampling frequency is the reciprocal of the sampling period. This sampling frequency can
be simply called as Sampling rate. The sampling rate denotes the number of samples taken
per second, or for a finite set of values.
For an analog signal to be reconstructed from the digitized signal, the sampling rate should
be highly considered. The rate of sampling should be such that the data in the message
signal should neither be lost, nor it should get over-lapped. Hence, a rate was fixed for this,
called as Nyquist rate.
Simulink
Scope Onput(s)
𝑓𝑓𝑓𝑓>2𝑓𝑓𝑓𝑓
𝑓𝑓𝑓𝑓 = 2𝑓𝑓𝑓𝑓
𝑓𝑓𝑓𝑓 < 𝑓𝑓𝑓𝑓
Matlab code
clc clear
close all;
t = 0:0.0001:0.1; fm=50; x =
sin(2*pi*fm*t); mul = input("Enter
nyquist rate "); subplot(3,1,1)
plot(t,x); title("Original
Signal"); fs = 2* fm * mul;
Ts = 1/fs; ts =
0:Ts:0.1; xs =
sin(100*pi*ts);
subplot(3,1,2)
stem(ts,xs);
title("Sampled Signal");
% Filter h = sinc(pi * ts /
Ts); xr = conv(h, xs); l =
length(xr); tr = linspace(0,
0.1, l / 2); subplot(3,1,3)
plot(tr, xr(1 : l / 2));
title("Reconstructed Signal");
𝑓𝑓𝑓𝑓>2𝑓𝑓𝑓𝑓
𝑓𝑓𝑓𝑓 = 2𝑓𝑓𝑓𝑓
LAB-06
Introduction
A detector in which (a) both the phase and the amplitude of the received signal are used and
(b) a phase reference signal is used to remove out-of-phase noise. Note: Examples of
coherent detectors are specialized photodetectors and demodulators.
Objective
In this lab, we'll learn how to use a coherent detector to generate a signal at the receiving end
that is equivalent to the carrier signal at the transmitting end.
Background
Coherent detection can not only achieve higher sensitivity than direct detection but can
significantly increase the spectral efficiency (encoding more bits on each symbol) as well
because it uses phase, amplitude, and polarization of an optical carrier to carry information.
Although coherent detection has enjoyed great success in optical transport networks, today
virtually all the optical interconnects inside data centers use intensity modulation and direct
detection (IM-DD) techniques because of the cost, power consumption, and footprint.
Simulink
Scope Output
Conclusion
We were able to recover the signal using the coherence detector, which was able to match the carrier
signal's frequency.
LAB-07
Introduction
In sampling, the sample rate must be carefully chosen, dependent on the content of the
signal and the analysis to be performed. Imagine we have some data which has already been
sampled, from a particular test or experiment and we now wish to re-analyze the data maybe
using different techniques or to look for a different characteristic and we don’t have the
opportunity to repeat the test. In this situation we can look at resampling techniques such as
up sampling and down sampling. Objective
In this lab, we'll learn how to perform up sampling and down sampling of signal.
Background
Up-Sampling is a "Zero-Padding Procedure" that increase the number of samples of a DT
signal. More specifical, when up sampling, zeros are added between the samples of a signal.
Down-Sampling is to decrease the sample size. In the other word, it divides the input signal
into segments, and pick a point from each segment to form a new signal.
clc clear
close all;
n1 = 0:n-1;
M = input("Enter M: ");
x2 = x(1:M:n); n2 =
0:length(x2)-1;
X = fft(x);
lx = linspace(-pi, pi, length(X));
X2 = fft(x2);
LX = linspace(-pi, pi, length(X2));
subplot(411)
stem(n1, x)
title('Signal')
subplot(412)
stem(n2, x2)
title('Down sampled signal')
subplot(413) plot(lx,
X)
title('Frequency Spectrum of Signal')
subplot(414) plot(LX, X2) title('Frequency
Spectrum of Downsampled Signal')
Up-sampling
clear clc close all %%
input = sine wave t=[-
100:0.01:5]; fs=10;
input1=sin(2*pi*fs*t);
input=input1'; %% input=
speech sentence
%[input,fs]=auread('speech.au');
%% output output=whosyourmommy(input,fs,5,3);
%sound(input,fs)
%sound(output,fs)
Function (whosyourmommy)
function output = whosyourmommy(input,fs,up_rate,down_rate)
%%
% sound(input,160000)
sig1=input;
%sig2=input(:,2);
a=up_rate; b=down_rate;
M =20; %design a 20th order LPF
w=pi/2; h = fir1(M,w/pi);
SIG1=conv(h,sig1); %input signal goes into LPF
%SIG2=conv(h,sig2);
N=length(SIG1);
Sig1_1(1:a:a*N)=SIG1; %up sampling by a
h=fir1(M,1/a); Sig1=conv(h,Sig1_1);
%Sig2(1:a:a*N)=SIG2;
%%
N=length(Sig1); ssig1=Sig1(1:b:N);
%down sampling by b
%ssig2=Sig2(1:b:N); %h =
1; % blackman window h =
fir1(M,w/pi); %lpf
output(:,1)=conv(h,ssig1);
%output(:,2)=conv(h,ssig2);
%% plots figure(1)
subplot(3,1,1)
plot(input)
title('input signal')
subplot(3,1,2)
plot(Sig1)
Conclusion
We were able to successfully down sample and up sample signals. Down sampling shrinks the plot
while up sampling enlarges it in the temporal domain. In the frequency domain, down sampling
widens the spectrum and up sampling narrows it.
LAB-08
Introduction
FM is the modification of the frequency of a carrier wave in response to the parameters of a
signal.
Objective
In this lab, we'll learn how to create a Frequency Modulation model in SIMULINK and code it in
MATLAB.
Background
The carrier amplitude remains constant in frequency modulation, but its frequency changes
in response to the modulating signal. The frequency change is proportional to the magnitude
of the information signal. As the amplitude of the information signal fluctuates, the real
carrier frequency deviates above and below the centre carrier frequency. The diagram
depicts frequency modulation using a sine wave information signal. The carrier frequency of
the information signal increases on the positive peaks and decreases on the negative peaks.
FM, like AM, generates sidebands. However, unlike AM, which generates a single pair of
sidebands for each frequency in the modulating signal, FM generates an infinite number of
pairs of sidebands for each frequency in the information signal. As a result, an FM signal
consumes a massive amount of bandwidth. Fortunately, the quantity of sidebands produced
may be regulated by carefully determining the degree of variation allowed in the carrier.
Sidebands are reduced when variations are small. Furthermore, some of the higher-order
sidebands have very low amplitudes and hence contribute little to the FM signal. While the
bandwidth of an FM signal can be adjusted and established to meet a particular frequency
range, it still takes up more spectrum space than an AM signal.
Matlab code
clear all clc t =
0:0.001:1; fm =
10; fc = 100; Am
= 1;
Ac = 1;
B1 = 0.1;
B2 = 3; m =
Am*cos(2*pi*fm*t); c =
Ac*cos(2*pi*fc*t);
s1 = cos(2*pi*fc*t + B1*sin(2*pi*fm*t)); s2 =
cos(2*pi*fc*t + B2*sin(2*pi*fm*t)); M =
fft(m); x1 = linspace(-pi, pi, length(M)); C
= fft(c);
x2 = linspace(-pi, pi, length(c)); S1
= fft(s1);
x3 = linspace(-pi, pi, length(S1));
S2 = fft(s2); x4 = linspace(-pi,
pi, length(S2));
subplot(411) plot(t,
m); title('Message
signal') subplot(412)
plot(t, c);
title('Carrier')
subplot(413) plot(t,
s1);
title('Modulated signal: 0 < B < 1')
subplot(414) plot(t, s2);
title('Modulated signal: B > 1')
figure subplot(411) plot(x1, M)
title('Spectrum of message signal')
subplot(412) plot(x2, C) title('Spectrum
of Carrier signal') subplot(413)
plot(x3, S1)
title(' Frequency Spectrum of Modulated signal: 0 < B < 1')
subplot(414) plot(x4, S2) title(' Frequency Spectrum of
Modulated signal: B > 1')
Conclusion
Frequency modulation is the process of encoding information in a carrier wave by altering the
wave's instantaneous frequency. Telecommunications, radio transmission, signal processing, and
computers all employ the technology.
LAB-09
Introduction
FM demodulation is a critical step in receiving a frequency modulated transmission. After
the signal has been received, filtered, and amplified, the original modulation from the carrier
must be recovered. This is referred to as demodulation or detection.
Objective
In this lab, we'll learn SIMULINK Frequency Demodulation Model Implementation and Analysis
Background
A non-linear feedback loop is the phase locked loop. Analyzing its performance with any
degree of accuracy is a difficult task. It is straightforward to depict in simplified block
diagram style.
This configuration can be utilised for a variety of applications. The VCO output was used
for Carrier acquisition. The output of the LPF is used as an FM demodulator, as indicated. It
is one thing to discuss the basic operation of the PLL as a demodulator, but quite another to
do a detailed investigation of its performance. Its performance is hindered by the fact that it
is characterised by non-linear equations, the solution to which is generally a matter of
approximation and compromise.
A phase-locked loop (PLL) can be utilised to build a complex but high-performance FM
demodulation circuit. The frequency of an incoming waveform can be "locked onto" by a
PLL. It accomplishes this by combining a phase detector, a low-pass filter (sometimes
known as a "loop filter"), and a voltage-controlled oscillator (VCO) into a negativefeedback
system, as illustrated in figure.
After locking, the PLL can generate an output sinusoid that tracks frequency fluctuations in
the incoming sinusoid. This output waveform would be derived from the VCO's output.
However, in an FM-demodulator application, we do not require an output sinusoid with the
same frequency as the input signal. Instead, we use the loop filter output as a demodulated
signal.
Simulink
Conclusion
The PLL is an electronic feedback control system that locks the output and input signals in good
frequency and phase agreement. If a carrier frequency drifts during transmission in radio
communication, the PLL in the receiver circuit will automatically follow the carrier frequency.
LAB-10
Introduction
Statistical operations are a method of describing a collection of data measurements on
recurrent events. In this lab, we will calculate the mean, standard deviation, variance,
skewness, autocorrelation, and PSD of the data.
Objective
In this lab, we will perform certain statistical procedures on the random data in MATLAB.
Background
1. Mean: The mean refers to the average of a set of values.
6. PSD: A Power Spectral Density (PSD) is the measure of signal's power content versus
frequency. A PSD is typically used to characterize broadband random signals.
MATLAB
x = rand(1000,1);
m = mean(x) %Mean s = std(x) %STD v = var(x)
%Variance Sk = skewness(x) %Skewness ACorr
= autocorr(x)%AutCorrelaton periodogram(x) %PSD
PSD Graph for the Data.
Conclusion
Statistical operations describe a set of data measurements on recurring events. In this lab, we
examine the mean, deviation, degree of symmetry, variability, and symmetry of randomly produced
data.
Questions / Answers
LAB-02
vAM=Vcsinωct+mVc2cos(ωc−ωm)t−mVc2cos(ωc+ωm)tvAM=Vcsinωct+
mVc2cos(ωc−ωm)t−mVc2cos(ωc+ωm)t