SIGNALS AND SYSTEMS
LAB REPORT
ROLL NO:241FA25001
1
VISUALISATION OF FUNDAMENTAL SIGNALS
Abstract. In this experiment we have visualised some basic fundamental signals
which include unit step function,unit impulse function,unit ramp function,rectangular
and triangular pulses,and sinc function.for visualising this signals MATLAB is
used as primary computational tool for simulating all these signals.each signal
was generated using appropriate mathematical expressions.
1. Introduction
Basic signals are fundamental waveforms that serve as the building blocks for more com-
plex signals in the field of signals and systems. These signals convey information by
varying with time or another independent variable and are often represented using math-
ematical functions. The basic signals are rectangular pulse ,unit step ,unit impulse,unit
ramp,triangular pulse,sinc function.
2. Theory
2.1. unit step signal
The unit step signal (also known as the Heaviside step function) is a fundamental signal
in signals and systems theory, widely used for analysis, testing, and system modeling. It
is defined as a function that is zero for all negative time and
(one for zero and all positive
0, t < 0
time. Mathematically, for the continuous-time case: u(t) =
1, t ≥ 0
The unit step signal shows abrupt transition from 0 to 1 at t=0.
it exhibhits a discontinuty at t=0.The derivative of unit step function give dirac delta func-
tion delta(t).
Figure 1. unit step signal
2.2. Unit impulse function
The unit impulse function, often referred to as the Dirac delta function .delta(t).
It is used for system analysis, especially in linear time-invariant (LTI) systems.
The unit impulse function is a unique signal that is: Zero everywhere except at the origin
(t = 0) Infinite at t = 0, but in such a way that the total area under the curve is exactly 1
Mathematically, it can be represented as:
( Z ∞
∞, t = 0
δ(t) = with δ(t) dt = 1
0, t ̸= 0 −∞
The unit impulse is the derivative of the unit step function.
Properties of impulse function:
1.the area under the curve is 1.
2.it is an even function.
δ(−t) = δ(t)
3.shifting property: for any function f(t)
Z ∞
f (t) δ(t − a) dt = f (a)
−∞
4.SCALING:
5.for any non zero scalar a,
1
δ(at) = δ(t), a ̸= 0
|a|
6.when any function is multiplied with the impulse function then at time other thant0 it
becomes 0 this could be represented mathematically as:
f (t) · δ(t − t0 ) = f (t0 ) · δ(t − t0 )
Figure 2. unit impulse signal
2.3. unit ramp function
it is a fundamental signal in signal processing.It is defined as zero for all negative inputs
and equals the input value for non-negative inputs, producing a graph shaped like a slope
or "ramp."it is represented mathematically as The ramp function R(t) is a fundamental
signal defined as:
(
0, t<0
R(t) =
t, t≥0
It can also be expressed as the product of the input and the unit step function:
R(t) = t · u(t)
where u(t) is the unit step function. The ramp function is the integral of the unit step
function:
Z t
R(t) = u(τ ) dτ
−∞
and its derivative is the unit step function:
d
R(t) = u(t)
dt
Graphically, the ramp function remains zero for t < 0 and increases linearly with
slope 1 for t ≥ 0.
• relation between unit step,impulse and ramp functions
Z t Z t
d d
δ(t) = u(t), u(t) = R(t), R(t) = u(τ ) dτ, u(t) = δ(τ ) dτ
dt dt −∞ −∞
Figure 3. Ramp signal
2.4. Rectangular pulse(Gate function)
The rectangular signal is also known as the unit pulse, gate function or normalised boxcar
function. Also, the rectangular function is an even function of time.
A signal that produces a rectangular shaped pulse with a width of T (where T = 1 for the
unit rectangular function) centred at T = 0 is known as rectangular signal. The rectangular
signal pulse also has a height of 1.
Mathematically, the unit rectangular signal is defined as,
(
t 1, |t| ≤ τ2
rect =
τ 0, otherwise
A rectangular pulse with width T and amplitude A and centered at t=0,is mathematically
expressded as :
(
t A, |t| ≤ τ2
A · rect =
τ 0, otherwise
Figure 4. Rectangular pulse
2.5. Triangular pulse
A function whose graph takes the shape of a triangle is known as triangular signal. The
triangular signal is also known as hat function or tent function. Mathematically, the unit
triangular pulse signal is defined as :
( 2|t| τ
t 1− τ
, |t| < 2
∆ = τ
τ 0, |t| ≥ 2
It is symmetric around zero, zero outside a certain interval, and reaches a peak amplitude
at the center
The triangular signal is also an even function of time.
Figure 5. unit Triangularsignal
2.6. sinc function
The sinc function oscillates with a time period of 2πand decays with increasing time (t).
The value of a sinc function is zero at t = nπ, where n= ±1, ±2, ±3 . . . for. it is
mathematically exoressed as :
sin(πt) , t ̸= 0
πt
sinc(t) =
1, t=0
sin t , t ̸= 0
t
sinc(t) =
1, t=0
The sinc function is also an even function of time.
its amplitude decays as t increases. it is symmetric about t=0
Figure 6. Sinc function
3. visualising the signals
MATLAB was utilized as the primary computational tool for simulating and visualizing
these signals. Each signal was generated using appropriate mathematical expressions and
plotted to observe their unique characteristics and properties.
3.1. procedure
1. Initialize the Environment
clc; clear all; close all;
clc: Clears the command window.
clear all: Removes all variables from the workspace.
close all: Closes any open figure windows.
This ensures that you start with a fresh workspace and display.
2. Define the Time Vector
t = -20:0.01:20;
Creates a vector from -20 to 20 with increments of 0.01.
This acts as the "x-axis" (time) for the plots.
3. Define the Signals Each signal is defined mathematically over the vector t:
Unit Step Function (x1)
x1 = 1 .* (t >= 0); makes x1 = 1 where t 0, else 0.
x1(t==0)=0; sets value at t=0 specifically to 0 (not standard, but sometimes done for vi-
sualization clarity).
Unit Impulse Function (x2) x2 = 1 .(t == 0); x2 is 1 only at t = 0, else 0.
Unit Ramp Function (x3) x3 = t .(t >= 0); x3 = t when t 0, else 0.
Rectangular Pulse (x4) Amplitude A and width T set as 1 and 3, respectively.
x4 = A . (abs(t) <= T/2); is 1 when |t| 1.5, else 0.
Triangular Pulse (x5) x5 = A.(1-2.abs(t)/T) .(abs(t)<T/2); forms a symmetric triangle of
peak 1 at t=0 within interval |t| < 1.5.
Sinc Function (x6)
x6 = sin(t) ./ t; computes sinc everywhere except t=0.
x6(t == 0) = 1; sets value at t=0 to 1 to avoid division by zero and ensure mathematical
correctness.
. Plot the Signals subplot(6,1,N): Arranges six plots vertically (one for each signal).
plot(): Plots each signal as a function of time with specific color and line width
for clarity.
xlabel(), ylabel(), title(): Annotates each subplot with axes labels and a title defin-
ing the function plotted.
The order of plotting:
Subplot 1: x1 - Unit Step
Subplot 2: x2 - Unit Impulse
Subplot 3: x3 - Unit Ramp
Subplot 4: x4 - Rectangular Pulse
Subplot 5: x5 - Triangular Pulse
Subplot 6: x6 - Sinc Function
3.2. MATLAB code:
1 clc ;
2 clear all ;
3 close all ;
4 t = - 20:0.01:20;
5 x1 = 1 .* ( t >= 0) ;
6 x1 ( t ==0) =0;
7 x2 = 1 .* ( t == 0) ;
8 x3 = t .* ( t >= 0) ;
9 A = 1;
10 T = 3;
11 x4 = A .* ( abs ( t ) <= T /2) ;
12 x5 = A .* (1 - 2.* abs ( t ) / T ) .*( abs ( t ) <T /2) ;
13 x6 = sin ( t ) ./ t ;
14 x6 ( t == 0) = 1;
15 subplot (6 ,1 ,1) ;
16 plot (t , x1 , 'r ' , ' LineWidth ' ,2) ;
17 xlabel ( ' time ')
18 ylabel ( ' amplitude ') ;
19 title ( ' unit step function ') ;
20 subplot (6 ,1 ,2) ;
21 plot (t , x2 , 'b ' , ' LineWidth ' ,2) ;
22 xlabel ( ' time ')
23 ylabel ( ' amplitude ') ;
24 title ( ' unit impulse function ') ;
25 subplot (6 ,1 ,3) ;
26 plot (t , x3 , 'g ' , ' LineWidth ' ,2) ;
27 xlabel ( ' time ')
28 ylabel ( ' amplitude ') ;
29 title ( ' unit ramp function ') ;
30 subplot (6 ,1 ,4) ;
31 plot (t , x4 , 'k ' , ' LineWidth ' ,2) ;
32 xlabel ( ' time ')
33 ylabel ( ' amplitude ') ;
34 title ( ' unit rectangular pulse ') ;
35 subplot (6 ,1 ,5) ;
36 plot (t , x5 , 'm ' , ' LineWidth ' ,2) ;
37 xlabel ( ' time ')
38 ylabel ( ' amplitude ') ;
39 title ( ' unit triangular pulse ') ;
40 subplot (6 ,1 ,6) ;
41 plot (t , x6 , 'c ' , ' LineWidth ' ,2) ;
42 xlabel ( ' time ')
43 ylabel ( ' amplitude ') ;
44 title ( ' sinc function ') ;
in the code we have used many in bulilt matlab functions like plot,subplot,title.the outout
will be visible in the figure window
3.3. output
when we running the code in the matlab the following figure will appear in the figure
window
Figure 7. output
4. conclusion:
In this experiment, the fundamental signals—including the unit step, unit impulse, unit
ramp, rectangular pulse, triangular pulse, and sinc function—were analyzed and visual-
ized using MATLAB. Generating and plotting these signals allowed for a deeper under-
standing of their characteristic shapes, behaviors, and mathematical properties.