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

Lab 4 Final

Lab 4

Uploaded by

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

Lab 4 Final

Lab 4

Uploaded by

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

Department of Computer Engineering

Digital Signal Processing

Course Instructor:

Lab Engineer:

Semester
LAB EXPERIMENT # 04
Generation of Continuous and Discrete time singularity functions in MATLAB

OBJECTIVE:

To Represent the Singularity functions in MATLAB.

UNIT STEP SIGNALS:

The Heaviside step function, or the unit step function, usually denoted by H (but sometimes u
or θ), is a discontinuous function whose value is zero for negative argument and one for positive
argument. It seldom matters what value is used for H(0), since H is mostly used as a distribution.

The function is used in the mathematics of control theory and signal processing to represent a
signal that switches on at a specified time and stays switched on indefinitely. It is also used in
structural mechanics together with the Dirac delta function to describe different types of structural
loads. It was named after the English polymath Oliver Heaviside.Its most basic form as function
of time is:

MATLAB CODE FOR IMPLEMENTATION:

1. Unit Step signal & sequences implementation

MATLAB CODE OUTPUT


UNIT IMPULSE SIGNALS:

The Dirac delta function, or δ function, is (informally) a generalized function on the real number
line that is zero everywhere except at zero, with an integral of one over the entire real line. The
delta function is sometimes thought of as an infinitely high, infinitely thin spike at the origin, with
total area one under the spike, and physically represents an idealized point mass or point charge.
It was introduced by theoretical physicist Paul Dirac. Dirac explicitly spoke of infinitely great
values of his integrand. In the context of signal processing, it is often referred to as the unit
impulse. Its discrete analog is the Kronecker delta function which is usually defined on a finite
domain and takes values 0 and 1.

Its most basic discrete form as function of time is

MATLAB CODE FOR IMPLEMENTATION:

1. Unit Impulse signal & sequences implementation

MATLAB CODE OUTPUT


MATLAB CODE FOR IMPLEMENTATION:
1. Unit Ramp signal & sequences implementation

MATLAB CODE OUTPUT


%% Continous Ramp Function

ramp=0:2:20; t=0:1:10;
subplot(2,1,1);
plot(t,ramp,'k'); xlabel('time');
ylabel('Amplitude'); grid on;
axis=([0 10 0 20]);
title('Continous Ramp
Function');

ContinousRampFunction
20

15

%% Descrete Ramp Function


10

ramp=0:2:20; t=0:1:10;
5
subplot(2,1,2);
stem(t,ramp,'k'); xlabel('time');
ylabel('Amplitude'); grid on;
axis=([0 10 0 20]);
title('Descrete Ramp
Function');

0
0 2 4 6 8 10
time

PRACTICE QUESTIONS

Q1. Write the Matlab code to draw the unit step function. The value of the function is 1
at t>3. Otherwise it is zero.
.

Q2. Draw the ramp function of y(t)= 3x-4 Code:


Q3. Using stem command draw the following graph g[n]= u[n-4] –u[n-10]

Rubrics:

Theoretical Setup Troubleshooting Completeness Total Aggregate


concepts preparation

You might also like