Lab 4 Final
Lab 4 Final
Course Instructor:
Lab Engineer:
Semester
LAB EXPERIMENT # 04
Generation of Continuous and Discrete time singularity functions in MATLAB
OBJECTIVE:
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:
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.
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
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.
.
Rubrics: