EXPT.
NO: 01
DATE : 15.07.2025 GENERATION OF SIGNALS
Aim:
To generate various periodic and aperiodic signals such as chart, impulse, step, ramp,
sinusoidal signal, cosine signal, exponential signal using MATLAB.
Apparatus Required:
MATLAB Software
Theory:
Unit Step Signal:
A continuous time unit step signal is denoted by u(t), mathematically it can be expressed as
u(t) = 1, for t > 0
u(t) = 0, for t < 0
Unit Ramp Signal:
A continuous time ramp signal is denoted by r(t), mathematically it can be expressed as
r(t) = t, for t ≥ 0
r(t) = 0, for t < 0
Sine Waveform:
A sinusoidal has the same shape as the graph of the sine function used.
In trigonometry, a discrete time sinusoidal waveform is denoted by
X[n] = A sin(n)
Cosine waveform:
A cosine wave is a signal waveform with a shape identical to that of a sine wave, except each
point on the cosine wave occurs exactly 1/4 cycles earlier than the corresponding point on
the sine wave.
1
2
Impulse signal:
An impulse function is a special function that is often used by engineers to model certain
events.
δ[n] = 1 at n = 0
δ[n] = 0 at n ≠ 0
Exponential signal:
The complex exponential is a complex valued signal that simultaneously encapsulates both a
cosine signal and a sine signal by putting them on the real and imaginary components of
complex signal. The continuous time complex exponential is defined as:
Continuous time: s(t) = Ce^(αt)
Unit Parabolic Signal:
A parabolic signal, also known as an acceleration signal, is a test signal in signal processing
where the magnitude of the signal varies as the square of time. It is mathematically
represented as t²/2 for t ≥ 0 and 0 for t < 0.
3
OUTPUT FOR UNIT STEP RESPONSE :
4
OUTPUT FOR UNIT RAMP RESPONSE :
CODE:
UNIT STEP RESPONSE:
clc;
clear all;
close all;
n = -10:1:10;
x = [zeros(1,10), 1, ones(1,10)];
stem(n, x);
xlabel('Time');
ylabel('Amplitude');
title('Unit Step Response');
UNIT RAMP RESPONSE:
5
clc;
clear all;
close all;
n = (0:1:20);
x = n;
stem(n, x);
xlabel('Time');
ylabel('Amplitude');
title('Unit Ramp Response');
OUTPUT FOR SINE RESPONSE :
OUTPUT FOR COSINE RESPONSE :
6
SINE WAVEFORM:
clc;
clear all;
close all;
n = (-20:1:20);
x = sin(n);
stem(n, x);
xlabel('Time');
ylabel('Amplitude');
title('Sine response');
COSINE WAVEFORM:
clc;
clear all;
7
close all;
n = (-20:1:20);
x = cos(n);
stem(n, x);
xlabel('Time');
ylabel('Amplitude');
title('Cosine response');
OUTPUT FOR IMPULSE RESPONSE :
OUTPUT FOR EXPONENTIAL RESPONSE :
8
UNIT IMPULSE RESPONSE:
clc;
clear all;
close all;
n = -10:1:10;
x = [zeros(1,10), 1, zeros(1,10)];
stem(n, x);
xlabel('Time');
ylabel('Amplitude');
title('Impulse response');
EXPONENTIAL SIGNAL:
clc;
clear all;
close all;
n = (0:1:20);
9
x = exp(n);
stem(n, x);
xlabel('Time');
ylabel('Amplitude');
title('Exponential response');
OUTPUT FOR PARABOLIC RESPONSE :
10
UNIT PARABOLIC SIGNAL:
clc;
close all;
x = linspace(-5, 5, 100);
y = 0.5 * x.^2;
plot(x, y);
xlabel('Time');
ylabel('Amplitude');
title('Parabolic response');
11
INFERENCE:
CONTENTS MARKS AWARDED MARKS OBTAINED
PREPARATION 40
OBSERVATION 30
RECORD 20
12
VIVA VOCE 10
TOTAL 100
Result:
Thus various periodic and aperiodic signals are generated using MATLAB.
13