You are on page 1of 5

COMSATS UNIVERSITY ISLAMABAD

Principles of Communication Systems

Lab Report No 01

Understanding the Basic Signals Parameters using MATLAB


Semester & Section

BEE-5B

Submitted by:

M Muzammil Nadeem
FA17-BEE-051

Submitted to:

Sir Dr. Moazzam Tiwana

Submission Date:

September 11, 2019


Objectives:

For any given signal, students should be able to determine signal parameters including RMS voltage, peak-peak
voltages, average voltage, time period and frequency.

Pre-Lab:

Electrical signals are time varying voltages and currents. In many cases these have important properties that we can
measure. For any sinusoidal signals there are the three important parameters that we need to specify to describe a
sinusoidal signal completely. The mathematical function we use to describe a sinusoidal signal is a general sine or
cosine function. Let's say that we have a sinusoidal voltage signal, V (t).

Mathematically:

𝑉(𝑡) = 𝑉 sin(𝑤𝑡 + ø) (1)

These three parameters are;

𝑉 = 𝑎𝑚𝑝𝑙𝑖𝑡𝑢𝑑𝑒
𝑤 = 𝑎𝑛𝑔𝑢𝑙𝑎𝑟 𝑓𝑟𝑒𝑞𝑢𝑒𝑛𝑐𝑦
ø = 𝑝ℎ𝑎𝑠𝑒
Various kinds of instruments have been designed to measure these three (amplitude, frequency and phase) as well as
other parameters of any sinusoid signal. Consider the signal in this figure.

By closely examining this signal we find that signal runs from -10 to +14 volts. It can't be represented as a pure sinusoid
with an expression like:

𝑉(𝑡) = 𝑉 sin(𝑤𝑡 + ø)
It can't be represented using above relation as a pure sinusoid has positive and negative extremes of the same absolute
value. One way to characterize this signal is to give the peak-to-peak value of the signal.

In-Lab

Task 1
Create a MATLAB vector called sig1 representing approximately 5 cycles of the sinusoidal voltage waveform cos (2πft);
where the frequency f is 1.0 kHz.

MATLAB code:
clear all;
close all;
clc
f=1000;
fs=8000;
t=0:1/fs:5/f;
sig1=cos(2*pi*f*t);
subplot(211)
plot(t,sig1)
xlabel('time');
ylabel('amplitude');
title('time domain');
N=length(sig1);
sig11=abs(fftshift(fft(sig1,N)))
f11=(fs.*(-N/2:N/2-1))/N;
subplot(212)
plot(f11,sig11)
xlabel('frequency');
ylabel('amplitude');
title('freq domain');
GRAPH:

Task 2
Create a MATLAB vector called sig2 representing 5 cycles of the sinusoidal voltage waveform sin (2πft); where the
frequency f is 1.0 kHz. Plot sig2.

MATLAB code:
clear all;
close all;
clc
f=1000;
fs=8000;
t=0:1/fs:5/f;
sig2=sin(2*pi*f*t);
subplot(211)
plot(t,sig2)
xlabel('time');
ylabel('amplitude');
title('time domain');
N=length(sig2);
sig11=abs(fftshift(fft(sig2,N)))
f11=(fs.*(-N/2:N/2-1))/N;
subplot(212)
plot(f11,sig11)
xlabel('frequency');
ylabel('amplitude');
title('freq domain');
GRAPH:
Task 3
Create a MATLAB vector called sig3 that is the sum of sig1 and sig2.

MATLAB code:
clear all;
close all;
clc
f=1000;
fs=8000;
t=0:1/fs:5/f;
sig=cos(2*pi*f*t)+sin(2*pi*f*t);
subplot(211)
plot(t,sig)
xlabel('time');
ylabel('amplitude');
title('time domain');
N=length(sig);
sig11=abs(fftshift(fft(sig,N)))
f11=(fs.*(-N/2:N/2-1))/N;
subplot(212)
plot(f11,sig11)
xlabel('frequency');
ylabel('amplitude');
title('freq domain');
GRAPH:
Task 4
Create a MATLAB vector

sig10 = cos (2*pi*f1*t) + 0.5*cos(2*pi*f2*t + pi/4) + 0.3*cos(2*pi*f3*t - pi/4)

MATLAB code:
clear all;
close all;
clc
f1=1000;
f2=2000;
f3=3000;
fs=8000;
t=0:1/fs:5/f1;
sig=cos(2*pi*f1*t)+0.5*cos(2*pi*f2*t+pi/4)+0.3*cos(2*pi*f3*t-pi/4);
subplot(211)
plot(t,sig)
xlabel('time');
ylabel('amplitude');
title('time domain');
N=length(sig);
sig11=abs(fftshift(fft(sig,N)))
f11=(fs.*(-N/2:N/2-1))/N;
subplot(212)
plot(f11,sig11)
xlabel('frequency');
ylabel('amplitude');
title('freq domain');
GRAPH:

Critical Analysis:
In this lab I have leant and determine signal parameters including RMS voltage, peak-peak voltages, average
voltage, time period and frequency using the MATLAB. I have created the MATLAB vector for a given signal
and determine its time domain response then transform the time domain signal into the frequency domain
signal using the fast Fourier transform fft command. Then shift the signal in between 0 and 1 using fft shift
command to determine the impulse response of the given signal.

You might also like