0% found this document useful (0 votes)
31 views4 pages

DSP Exp 1 Report 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views4 pages

DSP Exp 1 Report 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

VOLUME 11, 2023 1

Date of Submission 03 12 2024.


Digital Object Identifier

INTRODUCTION TO DISCRETE TIME SIGNAL


PROCESSING IN MATLAB
OMAR ABDULLAH, (Undergraduate Student),
Chittagong University of Engineering And Technology, Pahartoli, Raozan-4349 Chittagong, Bangladesh (e-mail: www.cuet.ac.bd)

‘‘This lab work was assigned by Mr. Kamrul Hasan Hira (Lecturer , Department of Electrical and Electronic Engineering,CUET’’

I. OBJECTIVE set(gca,’XGrid’,’on’,’YGrid’,’on’)
legend(’Amplitude’);
T This experiment focused on discrete-time signal pro-
cessing using MATLAB, involving signal plotting and
manipulation. We visualized basic signals such as step, im-
print(′ exp11 .jpeg′ ,′ −djpeg′ ,′ −r312′ );
gridon
pulse, and ramp functions, which serve as building blocks
for more complex signals. We then explored essential signal
manipulation techniques, including scaling (adjusting ampli- 2) Graph
tude), shifting (displacing in time), and addition/subtraction
(combining signals). Mastering these operations is crucial for
effective analysis and processing of various signals in diverse
engineering and scientific applications

II. CODE AND GRAPH PLOT


A. CODE AND GRAPH OF DELTA(N-N0)
1) Code
clc;
close all;
clear all;

n = 90:1:100;
n0 = 095;
x = zeros(size(n));

for i = 1:length(n)
if n(i) == n0 FIGURE 1. Plot of delta(n-095)
x(i) = 1;
else
x(i) = 0;
B. PLOT OF U(N-N0)
end
end 1) Code
figure clc;
stem(n,x) close all; clear all;
n = 90:1:100;
title(’Decrete plotted shifted Delta function x(n-n0) ’) n0 = 095;
xlabel(’n’); x = zeros(size(n));
ylabel(’x(i)’);

2 VOLUME 11, 2023


for i = 1:length(n) end
if n(i) >= n0 figure
x(i) = 1; stem(n,x)
else
x(i) = 0; title(’Decrete plotted shifted unit step function r(n-n0)=(n-
end n0)u(n-n0)’)
end
xlabel(’n’);
figure
stem(n,x) ylabel(’x(i)’);
title(’Decrete plotted shifted unit step function u(n-n0) ’)
xlabel(’n’); set(gca,’XGrid’,’on’,’YGrid’,’on’)
ylabel(’x(i)’);
set(gca,’XGrid’,’on’,’YGrid’,’on’)
legend(’Amplitude’,’Location’,’NorthWest’);
legend(’Amplitude’,’Location’,’NorthWest’);
print(′ exp12 .jpeg′ ,′ −djpeg′ ,′ −r312′ );
print(′ exp13 .jpeg′ ,′ −djpeg′ ,′ −r312′ );

2) Graph
2) Graph

FIGURE 2. Plot of u(n-095)


FIGURE 3. Plot of r(n-095)

C. PLOTTING SHIFTED RAMP FUNCTION R(N-N0) =


(N-N0)U(N-N0)
III. EQUATION, CODE AND GRAPH PLOT EQUATION,
1) Code
CODE AND GRAPH PLOT
clc;
A. EQUATION OF DISCRETE RANDOM SIGNAL
close all;
clear all; x[n] = 95*sin(0.5*πn) + 0.2*n([(n-n0]) + 3δ[n-95] + 0.8n ∗
u[n − 95]
n = 93:0.5:100;
n0 = 095; Breakdown of the components:
x = zeros(size(n));
1. Sinusoidal: 2*sin(0.5*πn) - A sinusoidal signal with
for i = 1:length(n) amplitude 2 and frequency 0.5π radians per sample.
if n(i) >= n0
x(i) = n(i)-n0; 2. Ramp: 0.2*n * u[n] - A ramp signal with slope 0.2,
else starting at n=0. u[n] is the unit step function, ensuring the
x(i) = 0; ramp starts at n=0.
end
VOLUME 11, 2023 3
3. Delta: 3*δ[n-2] - A delta function with amplitude 3, functions, which serve as building blocks for more com-
occurring at n=2. plex signals. We then explored essential signal manipulation
techniques, including scaling (adjusting amplitude), shifting
4. Impulse: 0.8n ∗ u[n − 5] - An exponentially decaying (displacing in time), and addition/subtraction (combining sig-
impulse with decay rate 0.8, starting at n=5. u[n-5] delays the nals). Mastering these operations is crucial for the effective
impulse by 5 samples. analysis and processing of various signals in diverse engineer-
ing and scientific applications.

1) Code REFERENCES
clc [1] Alan V Oppenheim. Discrete-time signal processing. Pearson Education
close all India, 1999.
[2] John G Proakis. Digital signal processing: principles, algorithms, and
clear all applications, 4/E. Pearson Education India, 2007.
n = 70:0.1:100;
n0 = 95;
delta = zeros(size(n));
delta(n == n0) = 1;
ramp = max(2*(n - n0), 0);
units tep = zeros(size(n));
units tep(n >= n0) = 1;
sinw ave = 95 ∗ sin(0.5 ∗ pi ∗ n);
x = sinwave + 0.2 ∗ ramp + 3 ∗ delta + 0.8 ∗ units tep;
figure
stem(n,x)
title(’Random Discrete-Time Signal’)
xlabel(’n’);
ylabel(’x(i)’);
set(gca,’XGrid’,’on’,’YGrid’,’on’)
legend(’Amplitude’,’Location’,’NorthEastOutside’);
print(′ exp14 .jpeg′ ,′ −djpeg′ ,′ −r312′ );

OMAR ABDULLAH pursuing B.Sc(Engg.) in


electrical and electronic engineering from Chit-
2) Graph
tagong University of Enginnering and Technol-
ogy,Chattogram,Bangladesh
Enthusiastic and motivated electrical engineering
undergraduate student with a strong passion for
innovation and technology. Skilled in circuit de-
sign, programming languages, and proper idea in
MATLAB. Seeking research internship or co-op
opportunities to further develop skills and con-
tribute to cutting-edge projects. Eager to apply theoretical knowledge in a
practical setting and make a positive impact in the field of power electronic

FIGURE 4. Plotting of random discrete signal

IV. DISCUSSION
This experiment focused on discrete-time signal processing
using MATLAB, involving signal plotting and manipulation.
We visualized basic signals such as step, impulse, and ramp
4 VOLUME 11, 2023

You might also like