Bansilal Ramnath Agarwal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY –
PUNE
Digital Signal Processing ET3270
Name of the student: Gunjan Thakre Roll No. 57
Div: ETA Batch:A3
Date of performance: 17/07/2025
Experiment No.1
Title: Laboratory on Elementary Signals
Aim: i. To generate different elementary signals.
ii. To performs basic operations on signals.
Software used: MATLAB.
Theory: 1. Explain the following signals:
1. Unit Step.
2. Unit Impulse.
3. Ramp.
Bansilal Ramnath Agarwal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY –
PUNE
4. Sinusoidal
5. Exponential Rise
6. Exponential Decay
7. Sync
Bansilal Ramnath Agarwal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY –
PUNE
8. Signum
9. Parabolic.
2. Explain the following signal operations:
1.Time shifting.
2 Time Scaling
3 Time reversal
Bansilal Ramnath Agarwal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY –
PUNE
4. Amplitude Scaling
Code Statement: (Paste your code here)
1. Write MATLAB code to generate the above mention signals.
n = -6:1:6;
imp = (n==0);
subplot(3,3,1);
s = stem(n,imp,"filled");
s.LineStyle = "-";
stp = (n>=0);
subplot(3,3,2);
s = stem(n,stp,"filled");
s.LineStyle = "-";
n1 = 0:0.2:6
subplot(3,3,3);
s = stem(n1,n1,"filled");
s.LineStyle = "-";
n2 = 0:0.2:6
f= 0.2;
x = 2*pi*f*n2;
y= sin(x);
subplot(3,3,4);
s = stem(n2,y,"filled");
s.LineStyle = "-";
exa= exp(n2);
subplot(3,3,5);
s = stem(n2,exa,"filled");
s.LineStyle = "-";
exd= exp(-n2);
subplot(3,3,6);
s = stem(n2,exd,"filled");
s.LineStyle = "-";
n3 = -6:0.15:6
sc = sinc(n3)
subplot(3,3,7);
s = stem(n3,sc,"filled");
s.LineStyle = "-";
Bansilal Ramnath Agarwal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY –
sig= sign(n3); PUNE
subplot(3,3,8);
s = stem(n3,sig,"filled");
s.LineStyle = "-";
x = -6:0.2:6;
y = x.^2;
subplot(3,3,9);
s = stem(x,y,"filled");
s.LineStyle = "-";
2. Write MATLAB code to perform the following operations on the signals
i. Time Delay
n = -10:10;
x = sin(2*pi*0.1*n);
% 1. Time delay x[n - 3]
subplot(3,2,1);
stem(n, x, 'b' ,"filled");
hold on;
xd = sin(2*pi*0.1*(n - 3));
stem(n, xd,'r' ,"filled");
title('Time Delay');
ii. Time Advance
% 2. Time advance x[n + 3]
subplot(3,2,2);
stem(n, x, 'b',"filled");
hold on;
xa = sin(2*pi*0.1*(n + 3));
stem(n, xa, 'r',"filled");
title('Time Advance');
iii. Time Compression
% 3. Time compression: x[2n]
subplot(3,2,3);
stem(n, x, 'b',"filled");
hold on;
xc = sin(2*pi*0.1*(2*n));
stem(n, xc, 'r',"filled");
title('Time Compression');
iv. Time Expansion
% 4. Time expansion: x[n/2]
n2 = -20:2:20;
xe = sin(2*pi*0.1*(-n2/2));
subplot(3,2,4);
stem(n, x, 'b',"filled");
hold on;
stem(n2, xe, 'r',"filled");
title('Time Expansion');
v. Time Reversal
% 5. Time reversal: x[-n]
subplot(3,2,5);
stem(n, x, 'b',"filled");
hold on;
xr = sin(2*pi*0.1*(-n));
stem(n, xr, 'r',"filled");
title('Time Reversal');
Bansilal Ramnath Agarwal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY –
PUNE
3. Write MATLAB code to generate the following discrete signals and perform the following
operations :
a. X1(n)= [1 2 4 6] and b. X2(n)= [2 4 1 2]
i. Amplitude Scaling
ii. Adding the two signals
iii. Multiplication of two signals
X1 = [1 2 4 6]; % First signal
X2 = [2 4 1 2]; % Second signal
n = 0:3;
% 1. Amplitude Scaling
X1_scaled = 2 * X1;
% 2. Addition
X_add = X1 + X2;
% 3. Multiplication
X_mul = X1 .* X2;
subplot(3,2,1);
stem(n, X1, 'b', 'filled');
title('X1(n) = [1 2 4 6]');
xlabel('n'); ylabel('Amplitude');
subplot(3,2,2);
stem(n, X2, 'r', 'filled');
title('X2(n) = [2 4 1 2]');
xlabel('n'); ylabel('Amplitude');
subplot(3,2,3);
stem(n, X1_scaled, 'm', 'filled');
title('Amplitude Scaled X1 (2 × X1)');
xlabel('n'); ylabel('Amplitude');
subplot(3,2,4);
stem(n, X_add, 'g', 'filled');
title('X1 + X2');
xlabel('n'); ylabel('Amplitude');
subplot(3,2,5);
stem(n, X_mul, 'g', 'filled');
title('X1 × X2');
xlabel('n'); ylabel('Amplitude');
Results: (Paste the outputs of the waveforms here)
Bansilal Ramnath Agarwal Charitable Trust’s
VISHWAKARMA INSTITUTE OF TECHNOLOGY –
PUNE
Conclusion: (Write the conclusion in your word)
In this lab, I generated different elementary signals and performed basic operations on them using
MATLAB. I was able to see how signals change when shifted, scaled, or reversed, and also how they
interact through addition and multiplication. This helped me clearly understand the basics of signal
generation and transformations, which will be useful for further study in signal processing.