0% found this document useful (0 votes)
25 views

Lab Assignment 322

This document contains a lab assignment on digital signal processing using MATLAB. It includes 5 tasks: 1) plotting unit impulse and step signals, 2) introducing MATLAB software and commands, 3) plotting a ramp signal, 4) plotting first and second unit step signals, and 5) implementing the Z-transform in MATLAB. It lists the names and student IDs of 5 students assigned to the tasks.

Uploaded by

Alfaz Uddin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views

Lab Assignment 322

This document contains a lab assignment on digital signal processing using MATLAB. It includes 5 tasks: 1) plotting unit impulse and step signals, 2) introducing MATLAB software and commands, 3) plotting a ramp signal, 4) plotting first and second unit step signals, and 5) implementing the Z-transform in MATLAB. It lists the names and student IDs of 5 students assigned to the tasks.

Uploaded by

Alfaz Uddin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

EEE322: Digital Signal Processing LAB Assignment

Assignment

2018EEE50966 Md Azgar Ali


2018EEE50950 Atikul Islam
1915EEE50648 Md Ahad Ali
2121EEE51150 Md Al-Amin
2121EEE51152 Md Khalid Hasan

Task 1:
a) Unit Impulse Signal: The continuous-time unit impulse
signal is denoted by δ(t) and is defined as − δ(t)={1fort=0
0forteq0. Hence, by the definition, the unit impulse signal
has zero amplitude everywhere except at t = 0. At the
origin (t = 0) the amplitude of impulse signal is infinity so
that the area under the curve is unity.
b) Unit Step Signal :The step signal or step function is that type
of standard signal which exists only for positive time and
it is zero for negative time. In other words, a signal x(t)
is said to be step signal if and only if it exists for t > 0
and zero for t < 0. The step signal is an important signal
used for analysis of many systems.

c) MATLAB is a proprietary multi-paradigm programming


language and numeric computing environment
developed by MathWorks. MATLAB allows matrix
manipulations, plotting of functions and data,
implementation of algorithms, creation of user interfaces,
and interfacing with programs written in other languages.
Application:

i) Statistics and machine learning(ML).


ii) Curve fitting.
iii) Signal Processing
iv) Deep learning.
v) Mapping.

d) Plot graph using Matlab code:


Step 1: Specify the Range of Values for the x variable for which you're
plotting the function. This will define x. ...

Step 2: Define the function, y = f(x) Declare the desired function


with the “=” operator. ...
Step 3: Use the plot function to generate a figure.
2. Task:

Lab 1
Name: Introduction To Matlab Soffware
Using Matlab Toolbar
Use new script tool then we are showing command window and program
window.Any program are showing.
Run section cleck program will be done

Lab 2
Name: Ploting Unit Inpulse Funtion by Matlab
a) Unit Impulse Signal: The continuous-time unit impulse signal is
denoted by δ(t) and is defined as − δ(t)={1fort=0 0forteq0. Hence,
by the definition, the unit impulse signal has zero amplitude
everywhere except at t = 0. At the origin (t = 0) the amplitude of
impulse signal is infinity so that the area under the curve is unity.
Program:
n=-6:6;
delta_n=[0,0,0,0,0,0,1,0,0,0,0,0,0];
stem(n,delta_n); xlabel('Time');
ylabel('Amplitude');

Run section Cleck program will be down


n=-100:100;
delta_n=[zeros(1,100) 1 zeros(1,100)];
stem(n,delta_n); xlabel('Time');
ylabel('Amplitude');
program will be down bleow:
Lab 3
Ramp Singnal Ploting: The ramp function is a unary real function, whose graph is shaped
like a ramp. It can be expressed by numerous definitions, for example "0 for negative inputs, output
equals input for non-negative inputs". The term "ramp" can also be used for other functions obtained
by scaling and shifting, and the function in this article is the unit ramp function (slope 1, starting at 0).

Program:
clear all;
close all;
clc;
N1=-40;
N2=40

N=0;
x=N1:N2;
y=x.*(x-N>=0)
figure;
stem(x,y,'b','Linewidth',7);
xlabel('\bf\color{red}\fontsize{20} Samples');
ylabel('\bf\color{red}\fontsize{20} Amplitude');
title('\bf\color{black}\fontsize{20} Ramp Singnal on Matlab'); grid
on;

Program will be Done bleow:


Lab 4
First & second unit step signal
The unit step function and the impulse function are considered to be fundamental functions in
engineering, and it is strongly recommended that the reader becomes very familiar with both of these
functions.

Program:
%first unit step signal%
n=-20:20; unit_nl=n>=0;
subplot (3,1,1); stem(n,
unit_nl); axis([-5 5 -2
2]); xlabel('Time
Samples');
ylabel('Amplitude');
title('\bf\color{black}\fontsize{10}First unit step signal');

%second unit step signal%


unit_n2=n>=1; subplot
(3,1,2); stem(n,
unit_nl); axis([-5 5 -
22]) xlabel('Time
Samples');
ylabel('Amplitude');
title('\bf\color{black}\fontsize{10}First unit step signal');
%unit impulse function plotting%
delta_n=unit_nl-unit_n2; subplot
(3,1,3); stem(n, delta_n);
axis([-5 5 -22]) xlabel('Time
Samples'); ylabel('Amplitude');

program will be dode bleow:

Lab 5
Z transform implementation by matlab
The Z-transform (ZT) is a mathematical tool which is used to convert the
difference equations in time domain into the algebraic equations in zdomain.In
mathematics and signal processing, the Z-transform converts a discretetime signal, which
is a sequence of real or complex numbers, into a complex frequencydomain (the z-domain
or z-plane) representation. It can be considered a discrete-time equivalent of the Laplace
transform (the s-domain or s-plane).

Program:

%direct function input


x=[1 2 3
4];
l=length(x);

X=0;

z=sym('z'); %deifining symbol


for i=0:l-1
X=X+x(i+1)*z^(-i);
end
disp("displaying output"); disp(X);

program will done bleow:

Program:

syms n; f=sin(n);
r=ztrans(f);
disp("z transform using function"); disp(r); program
will be done bleow:

You might also like