logo

DSP for Communications Laboratory Manual

   

Added on  2023-01-16

35 Pages7310 Words32 Views
DSP for Communications
School of Engineering
2018-2019 S2
Laboratory Manual

Experiment 1
Aim: Representations and implementation of signals and systems using MATLAB
Introduction and background Theory:
The aim of this lab session is to familiarize with the representation and implementation of
signals and systems using MATLAB software
This experiment is intended to acquaint with the elementary idea of uncomplicated operations
on systems with respect to continuous time signals. The main features of the experiment
include:
Deconvolution of continuous time signals.
Convolution of continuous time signals.
Convolution of discrete time signals.
System described by difference equation.
Concept of Finite Response and Infinite Impulse Response filters.
Due to the limitation of the size of the computer memory, it is not possible to represent the
infinite sequences, which are commonly used in the DSP area by the MATLAB program. All
sequences in MATLAB are finite-duration sequences. In MATLAB, the correct
representation of a sequence needs two vectors; one is for the sample position 𝑛, and the other
is for the appropriate values 𝑥.
What is MATLAB?
Matlab software provides high level computing capacity using language (programming) and
the modelling in simulink environment. It covers vast area such as electrical, mechanical,
electronics, embedded system, chemical, hydraulic etc. with user friendly interface. The name
Matlab came from MATrix LABoratory because all the computations are done in matrix
form. Mainly applicable areas are for academic and scientific computations.
M-Files
M file writing provides capability of solving any complex problem in simplified form using
scripts. Line by line execution is done locally in matlab environment. The extension of file
type is .m where anybody can save, edit.
Observation and Result
Exercise 1.
1. Due to the limitation of the size of the computer memory, it is not possible to
represent the infinite sequences, which are commonly used in the DSP area by the
MATLAB program. All sequences in MATLAB are finite-duration sequences. In
MATLAB, the correct representation of a sequence needs two vectors; one is for the
sample position 𝑛, and the other is for the appropriate values 𝑥. So a sequence
where the up arrow indicates the sample at 𝑛 = 0) can be represented in MATLAB by:
n=[-5:5];

x=[3, 2, 2,-1,0,1,4,3,7,2,2];
stem (n,x,'LineWidth',2);
xlabel('Sample position')
ylabel('Values')
title('Representation of elementary sequences')
saveas(gcf,'Ex1_1.tif')
Conclusion: Representation of signal is important aspect for processing using digital
programs such as Matlab, here we learn how to represent signal of finite or infinite length
using Matlab coding and plotted the same.
2. Representation of unit sample sequence:
The more general way to represent unit simple is to represent the shift version of this
sequence
%example n0=4 to see where will the delta be created
n0=4;
n1=-5;
n2=6;
%Now calling the function

[x,n]=impseq(n0,n1,n2);
%Creating the function
function [x,n]= impseq(n0,n1,n2)
if ((n0 < n1) || (n0 > n2) || (n1 > n2))
error('arguments must satisfy n1 <= n0 <= n2')
end
n = n1:n2;
x=(n-n0)==0;
stem(n,x,'LineWidth',2);
xlabel('Sample position')
ylabel('Values')
title('Representation of elementary sequences')
saveas(gcf,'Ex1_2.tif')
end
Conclusion: We can conclude that unit impulse sequence produces unity signal at given or
assigned instant and for rest of the positions it is zero.
3. Representation of unit step sequence:
Approach is to use the logical relation n>=0. To implement
n0=4;
n1=-5;
n2=9;

%Now calling the function
[x,n]=stepseq(n0,n1,n2);
%Creating the function
function [x,n]= stepseq(n0,n1,n2)
n=[n1:n2];
x=[(n-n0)>=0];
stem (n,x,'LineWidth',2);
xlabel('Sample position')
ylabel('Values')
title('Unit Step Signal')
saveas(gcf,'Ex1_3.tif')
end
Conclusion: From practical we can conclude that unit step signal is the representation where
signal magnitude is unity for assigned instant samples and for other cases it is zero.
4. Representation of an exponential sequence:
a. Real valued exponential sequence:
Example: to generate
%Real Valued
clc
clear all
close all
n1=[0:15];

x1=1.4.^n1;
stem(n1,x1,'LineWidth',2);
xlabel('Sample position')
ylabel('Values')
title('Real Value Exponential Sequence')
saveas(gcf,'Ex1_4_a.tif')
Conclusion: From practical we can see real value exponential signal is presentation of
sample in increasing or decreasing nature based on define signals.
b. Complex valued exponential sequence:
%Complex Valued
clc
clear all
close all
n2=[0:15];
x2=exp((0.5+8j)*n2);
stem(n2,x2,'LineWidth',2);
xlabel('Sample position')
ylabel('Values')
title('Complex Valued4 Exponential Sequence')
saveas(gcf,'Ex1_4_b.tif')

Conclusion: From practical we can say that complex valued signal is presented using sample
instant where value can be in positive or negative in magnitude.
5. Representation of sinusoidal sequence: Example: to generate
Here different value of example is use to generate the sinusoidal signal
sequence
n = [0:20];
x =5*cos(0.1*pi*n+pi/3)+4*sin(0.8*pi*n);
stem(n,x,'LineWidth',2);
xlabel('Sample position')
ylabel('Values')
title('Representation of Sinusoidal Sequence')
saveas(gcf,'Ex1_2.tif')

Conclusion: Sinusoidal signal plays important role of signal processing applications and
discreate representation also important and it is presented in above plot, plotted using matlab.
Exercises 2: Operation on sequences using MATLAB
The basic operation on signals such as integration, multiplication, subtraction, differentiation and
addition are to be carried out to change the shape and output form for application of signal processing
it can be image processing, audio processing, satellite, or medical imagine.
1. Signal Addition
In signal and system, the process of adding the different signal is summation of their
corresponding magnitudes. It is presented in more detail in following Matlab experiment.

End of preview

Want to access all the pages? Upload your documents or become a member.