GOPALGANJ SCIENCE AND TECHNOLOGY UNIVERSITY, GOPALGANJ-8100.
Lab Report
COURSE CODE: EEE402
COURSE TITLE: Digital Signal Processing Lab.
SUBMITTED BY SUBMITTED TO
Name: Md Moniruzzaman Sojol Dr. Mohammad Asaduzzaman Khan,
Student ID: 19EEE019 Assistant Professor,
Year: 4th, Semester: 1st Department of ELECTRICAL AND
Session: 2019-20 ELECTRONIC ENGINEERING, GSTU.
Department of ELECTRICAL AND ELECTRONIC
ENGINEERING, GSTU.
Submission Date: 12-05-25
1
Index
Exp. No Exp. Name Page No.
01 Spectrum Analysis Using MATLAB 3
02 Plotting Analog and Discrete Sinusoidal Signals using MATLAB 7
03 Illustration and computation of Impulse Response using MATLAB 11
04 Find out the even and odd signals from the discrete time using MATLAB 15
05 Fourier series Analysis using MATLAB. 18
06 Convolution Coefficients in the Identification of Discrete Time Sequences 22
using MATLAB
07 Cross-correlation and Auto-correlation coefficients in the identification of 26
Discrete Time Sequences and any image data with MATLAB
08 DFT and FFT Analysis – I with MATLAB 31
09 Determination of the rational z-Transform from its Poles and Zeros using 34
MATLAB
2
Experiment No: 01
Experiment Name: Spectrum Analysis – Sinusoids with MATLAB
Objective:
1. To generate and visualize sinusoidal signals using MATLAB.
2. To modify the given MATLAB program to display only three cycles of a sinusoid.
3. To design a reusable function, sinwave(A, F, Th) that generates a sinusoid with
customizable amplitude, frequency, and phase delay while displaying exactly three cycles.
Theory:
A sinusoidal signal is a fundamental waveform in signal processing, defined by:
x(t)=Acos(2πft+θ)
• A: Amplitude (peak value of the signal).
• f: Frequency (number of oscillations per second, in Hz).
• θ: Phase delay (shift in the waveform along the time axis).
The period (T) of a sinusoid is the time taken to complete one full cycle:
T=1/f
In MATLAB, sinusoids can be generated using the cos function, and plots can be
customized using plot, axis, xlabel, and grid commands.
Program:
clc;
clear;
close all;
1.1: Displaying the Given Sinusoid
A = 2; f0 = 1000; phi = pi/2;
T0 = 1/f0;
tt = 0 : T0/40 : 4*T0;
xx = A*cos(2*pi*f0*tt + phi);
plot(tt, xx)
axis([0, 0.004, -4, 4])
xlabel('Time (sec)');
grid on
3
1.2: Modifying the Program to Show Only 3 Cycles
A = 2; f0 = 1000; phi = pi/2;
T0 = 1/f0;
tt = 0 : T0/40 : 3*T0; % Changed 4*T0 to 3*T0
xx = A*cos(2*pi*f0*tt + phi);
plot(tt, xx)
axis([0, 3*T0, -4, 4])
xlabel('Time (sec)');
grid on
1.3: Designing the sinwave(A,F,Th) Function
function sinwave(A, F, Th)
T = 1/F;
tt = 0 : T/40 : 3*T;
xx = A*cos(2*pi*F*tt + Th);
plot(tt, xx)
axis([0, 3*T, -A*1.5, A*1.5]) % Dynamic axis scaling
xlabel('Time (sec)');
grid on
title(['Sinusoid: A=', num2str(A), ', F=', num2str(F), 'Hz, Th=',
num2str(Th)]);
end
Result:
Figure 1: Original Sinusoid Waveform Figure 2: Modified Program (3 Cycles)
4
Figure 3: sinwave(A,F,Th) Function
1.1: Original Sinusoid Waveform
The generated waveform displayed 4 cycles of a cosine wave with:
• Amplitude = 2
• Frequency = 1000 Hz
• Phase delay = π/2
1.2: Modified Program (3 Cycles)
The modified code successfully displayed only 3 cycles of the sinusoid.
1.3: sinwave(A,F,Th) Function
• The function works as expected, generating a sinusoid with:
• Adjustable amplitude, frequency, and phase.
• Exactly 3 cycles displayed.
Discussion:
The original code produced a smooth cosine wave with a phase shift of 90° (π/2),
confirming the theoretical expectation, which is shown in Figure 1. By adjusting the time
vector to 3*T0, the plot correctly displayed only three cycles in Figure 2, demonstrating
control over signal duration. The sinwave(A, F, Th) function successfully generalized the
process for A=5, F=100, and Th=4, respectively, amplitude, frequency, and phase delay,
which allows for flexible parameter inputs while maintaining a consistent display of three
cycles in Figure 3.
5
Conclusion:
Sinusoidal signals were successfully generated and visualized in MATLAB. The program
was modified to display a specific number of cycles. In this experiment, it was 3, ensuring
clarity in signal representation. The sinwave(A, F, Th) function provides a reusable tool for
generating customizable sinusoids, demonstrating the importance of modular
programming in signal processing.
6
Experiment No: 02
Experiment Name: Plotting Analog and Discrete Sinusoidal Signals using MATLAB
Objective:
• To familiarize oneself with MATLAB programming commands for plotting figures.
• To generate and plot an analog sinusoidal signal.
• To generate and plot a discrete sinusoidal signal.
Theory:
Analog Sinusoidal Signal
An analog sinusoid is continuous and defined for all time values:
x(t)=Acos(2πft+θ)
• A: Amplitude
• f: Frequency (Hz)
• θ: Phase (radians)
Discrete Sinusoidal Signal
A discrete sinusoid is sampled at specific time intervals:
x[n]=Acos(2πfnTs+θ)
• n: Sample index (integer)
• T_s: Sampling period (Ts=1/fs)
7
Program:
clc;
clear;
close all;
1. Analog Sinusoidal Signal
A = 1;
f = 2;
theta = pi/4;
t_start = 0;
t_end = 2;
t_step = 0.001;
% Generate analog signal
t = t_start:t_step:t_end;
x_analog = A * cos(2*pi*f*t + theta);
% Plot
figure('Name', 'Analog_Sinusoid');
plot(t, x_analog, 'b', 'LineWidth', 1.5);
xlabel('Time (s)');
ylabel('Amplitude');
title('Analog Sinusoidal Signal: A=1, f=2Hz, \theta=\pi/4');
grid on;
2. Discrete Sinusoidal Signal
A = 1;
f = 2;
theta = pi/4;
t_start = 0;
t_end = 2;
t_step = 0.001;
% Generate discrete signal
t = t_start:t_step:t_end;
x_analog = A * cos(2*pi*f*t + theta);
% Plotting
figure('Name', 'Analog_Sinusoid');
plot(t, x_analog, 'b', 'LineWidth', 1.5);
xlabel('Time (s)');
ylabel('Amplitude');
title('Analog Sinusoidal Signal: A=1, f=2Hz, \theta=\pi/4');
grid on;
8
Result:
Figure 1: Analog Sinusoid Signal
Figure 2: Discrete Sinusoid Signal
9
1. Analog Signal (Figure 1):
o Smooth, continuous waveform.
o Matches theoretical expectations for A=1, f=2 Hz, and θ=π/4.
2. Discrete Signal (Figure 2):
o Sampled points (stem plot) at fs=20 Hz.
o Clearly shows the discrete nature of the signal.
Discussion:
The experiment successfully demonstrated the generation and visualization of both
analog and discrete sinusoidal signals using MATLAB. The analog signal (Figure 1)
displayed a smooth, continuous waveform, confirming the theoretical behavior of a
sinusoid in continuous time. In contrast, the discrete signal (Figure 2) clearly showed the
sampled nature of the signal, with individual data points representing the sinusoid at
specific time intervals. The sampling frequency (fs=20Hz=20Hz) was chosen to satisfy the
Nyquist criterion, ensuring accurate representation of the 2Hz2Hz sinusoid without
aliasing. The use of plot() for analog signals and stem() for discrete signals effectively
highlighted the key differences between continuous and discrete-time representations.
Conclusion:
This experiment provided a clear understanding of how analog and discrete sinusoidal
signals are generated and plotted in MATLAB. The results confirmed the theoretical
expectations for both signal types, emphasizing the importance of proper sampling in
discrete signal processing. The exercise also reinforced practical familiarity with
MATLAB's plotting commands, which are essential for signal analysis and visualization in
engineering applications.
10
Experiment No: 03
Experiment Name: Illustration and Computation of Impulse Response using
MATLAB
Objective:
• To understand the representation of impulse functions in MATLAB.
• To compute and analyze different impulse responses for various input vectors.
for example:
y[n]=x[n]+0.5x[n−1]+0.25x[n−2]
Theory:
Impulse Function
An impulse function is a signal that is equal to 1 at a specific point and zero everywhere
else. It is also known as a delta function or a unit impulse function. The impulse response
is the signal that exits a system when an impulse function is the input. It can be used to
characterize the behavior of a system, such as a signal delay or shift.
An impulse function, denoted as δ[n], is defined as:
In MATLAB, the impulse function can be generated using the dirac function or by
manually defining a vector with a single non-zero value.
Impulse Response
The impulse response of a system, h[n], is the output of the system when the input is an
impulse function. It characterizes the system's behavior and is fundamental in digital
signal processing.
11
Program:
clc;
clear;
close all;
% 1. Generating an Impulse Function
n = -5:5;
% Generate the impulse function
impulse = zeros(size(n));
impulse(n == 0) = 1;
% Plot the impulse function
figure('Name', 'Impulse_Function');
stem(n, impulse, 'b', 'LineWidth', 1.5, 'Marker', 'o');
xlabel('Sample Index (n)');
ylabel('Amplitude');
title('Discrete Impulse Function \delta[n]');
grid on;
% 2. Computing Impulse Response for a System
% Define the impulse input
x = [1, zeros(1, 10)];
y = zeros(size(x));
for n = 3:length(x)
y(n) = x(n) + 0.5*x(n-1) + 0.25*x(n-2);
end
% Plot the impulse response
figure('Name', 'Impulse_Response');
stem(0:length(y)-1, y, 'r', 'LineWidth', 1.5, 'Marker', 'o');
xlabel('Sample Index (n)');
ylabel('Amplitude');
title('Impulse Response of the System');
grid on;
12
Result:
Figure 1: Impulse Function
Figure 2: Impulse Response of y[n]
1. Figure 1 illustrates the discrete impulse function δ[n], showing a single non-zero value
at n=0.
13
2. Figure 2 illustrates the impulse response of the given system, revealing how the system
reacts to an impulse input. The response decays over time due to the coefficients in the
difference equation. The system is y[n]=x[n]+0.5x[n−1]+0.25x[n−2].
Discussion:
The experiment effectively demonstrated the generation of an impulse function and the
computation of an impulse response for a linear time-invariant (LTI) system. The impulse
function served as a fundamental test input, while the impulse response provided insights
into the system's behavior. The decaying nature of the response in Figure 2 aligns with
the system's difference equation, confirming the theoretical expectations.
Conclusion:
This experiment successfully illustrated the representation of impulse functions in
MATLAB and the computation of impulse responses for different systems. The results
highlighted the importance of impulse response in analyzing system characteristics, laying
a foundation for further studies in signal processing and system analysis.
14
Experiment No: 04
Experiment Name: Find out the even and odd signals from the discrete time using
MATLAB
Objective:
• To analyze and visualize discrete-time signals using MATLAB.
• To understand the relationship between time indices and signal amplitude.
• To visualize the original signal, odd component, and even component in a single
figure.
Theory:
Any discrete-time signal x[n] can be decomposed into:
• Even Component (symmetric about n=0):
xe[n]=x[n]+x[−n]2xe[n]=2x[n]+x[−n]
• Odd Component (anti-symmetric about n=0):
xo[n]=x[n]−x[−n]2xo[n]=2x[n]−x[−n]
The original signal is the sum of these components:
x[n]=xe[n]+xo[n]x[n]=xe[n]+xo[n]
Program:
% Finding Even and Odd Components
clc;
clear;
close all;
% Given signal
n = -2:2;
x = [2 3 1 -1 4];
x_neg_n = fliplr(x);
% Calculate even and odd parts
x_even = (x + x_neg_n) / 2;
x_odd = (x - x_neg_n) / 2;
figure;
subplot(3,1,1);
stem(n, x, 'filled');
title('Original Signal x[n]');
xlabel('n'); ylabel('Amplitude');
15
grid on;
subplot(3,1,2);
stem(n, x_even, 'filled');
title('Even Part x_e[n]');
xlabel('n'); ylabel('Amplitude');
grid on;
subplot(3,1,3);
stem(n, x_odd, 'filled');
title('Odd Part x_o[n]');
xlabel('n'); ylabel('Amplitude');
grid on;
Result:
Figure 1: Top: original signal, Middle: Even Part, Bottom: Odd Part
16
Discussion:
The experiment successfully demonstrated even-odd illustration of a discrete-time signal
x[n]. The asymmetric original signal was clearly separated into:
• An odd component (anti-symmetric about n=0)
• An even component (perfectly symmetric)
The sum of these components can perfectly reconstruct the original signal.
Conclusion:
The results confirm that any discrete-time signal can be decomposed into even and odd
parts. This fundamental concept is crucial for signal analysis and processing applications.
The MATLAB implementation effectively translated theory into clear visual results,
demonstrating the power of computational tools in signal processing.
17
Experiment No.: 5
Experiment Name: Fourier Series Analysis with MATLAB
Objective:
• To understand the concept of the Fourier series and its application in signal analysis.
• To compute and visualize the Fourier series representation of periodic signals using
MATLAB.
• To analyze the convergence of Fourier series approximations.
Theory:
A periodic signal x(t) with period T can be represented as an infinite sum of sinusoidal
components:
where:
• a0 is the DC component (average value).
• ak and bk are the Fourier coefficients, computed as:
Key Properties
• Orthogonality: Sinusoids of different frequencies are orthogonal over one period.
• Convergence: The Fourier series converges to x(t) for piecewise smooth signals.
18
Program:
% Fourier series of square wave
T = 2*pi;
t = linspace(0, 3*T, 1000);
N = 20;
x_square = zeros(size(t));
% Fourier Series
for k = 1:2:N
x_square = x_square + (4/(pi*k)) * sin(2*pi*k*t/T);
end
% Plot
figure('Name', 'Square_Wave_Fourier_Series');
plot(t, x_square, 'LineWidth', 1.5);
title('Fourier Series Approximation of Square Wave (N=20)');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;
% Fourier series of sawtooth wave
x_sawtooth = zeros(size(t));
% Fourier Series
for k = 1:N
x_sawtooth = x_sawtooth + ((-1)^(k+1)) * (2/(k*pi)) * sin(2*pi*k*t/T);
end
% Plot
figure('Name', 'Sawtooth_Wave_Fourier_Series');
plot(t, x_sawtooth, 'LineWidth', 1.5);
title('Fourier Series Approximation of Sawtooth Wave (N=20)');
xlabel('Time (s)');
ylabel('Amplitude');
grid on;
19
Result:
Figure 1: Fourier Series Approximation of a Square Wave
Figure 2: Fourier Series Approximation of a Sawtooth Wave
20
1. Square Wave (Figure 1):
o The Fourier series approximation shows the Gibbs phenomenon (overshoot at
discontinuities).
o Higher harmonics improve the approximation but introduce ripples.
2. Sawtooth Wave (Figure 2):
o The approximation converges more smoothly compared to the square wave.
o Amplitude decreases with higher harmonics (∼1/k decay).
Discussion
The experiment demonstrated Fourier series decomposition for periodic signals,
revealing key insights about signal approximation. The Gibbs phenomenon was observed
at discontinuities for the square wave, showing how high-frequency components
contribute to edge sharpness but introduce oscillations. The sawtooth wave exhibited
smoother convergence, with harmonic amplitudes decaying proportionally to their order.
MATLAB's implementation effectively illustrated the trade-off between the number of
harmonics and reconstruction accuracy, emphasizing the practical challenges in
representing non-smooth signals with finite Fourier series terms.
Conclusion
This experiment confirmed the Fourier series as a powerful tool for analyzing periodic
signals, while highlighting its limitations in handling discontinuities. The results
underscore the importance of harmonic content in signal representation and MATLAB's
utility for visualizing these concepts. Fourier series remain indispensable in engineering
applications, from audio processing to communications systems.
21
Experiment No: 06
Experiment Name: Convolution coefficients in identification of Discrete Time
Sequences with MATLAB
Objective:
• To represent discrete-time sequences in MATLAB.
• To compute the linear convolution of two discrete sequences.
• To visualize the input sequences and their convolution result.
Theory:
For two discrete-time sequences x[n] (length M) and h[n] (length N), their linear
convolution y[n] is given by:
where:
• The resulting sequence y[n] has length M+N−1.
• Convolution identifies the overlap between two sequences under time shifts.
Key Properties
1. Commutative.
2. Associative.
22
Program:
% Sequence 1: x[n]
x = [1, 1, 1, 1, 1];
% Sequence 2: h[n]
h = [0.5, 0.25, 0.125, 0.0625];
% Time indices for plotting
n_x = 0:length(x)-1;
n_h = 0:length(h)-1;
y = conv(x, h);
n_y = 0:length(y)-1;
figure('Name', 'Convolution_Results');
% Plot x[n]
subplot(3,1,1);
stem(n_x, x, 'b', 'filled', 'LineWidth', 1.5);
title('Input Sequence x[n]');
xlabel('Time Index (n)');
ylabel('Amplitude');
grid on;
% Plot h[n]
subplot(3,1,2);
stem(n_h, h, 'r', 'filled', 'LineWidth', 1.5);
title('Impulse Response h[n]');
xlabel('Time Index (n)');
ylabel('Amplitude');
grid on;
% Plot y[n]
subplot(3,1,3);
stem(n_y, y, 'g', 'filled', 'LineWidth', 1.5);
title('Convolution Result y[n] = x[n] * h[n]');
xlabel('Time Index (n)');
ylabel('Amplitude');
grid on;
23
Result:
Figure 1: Fourier Series Approximation of a Square Wave
1. Input Sequences:
o x[n]: Rectangular pulse (length = 5).
o h[n]: Exponentially decaying sequence (length = 4).
2. Convolution Output:
o y[n] has length 5+4−1=8.
o The output shows how the rectangular pulse "smears" due to the exponential
decay.
Discussion
The experiment demonstrated how convolution combines two sequences by flipping and
shifting one across the other. The result y[n] captures the combined effect of both
sequences, with the exponential decay smoothing the sharp edges of the rectangular
pulse. This operation is fundamental in signal processing for applications like filtering and
system identification.
24
Conclusion
Linear convolution was successfully implemented in MATLAB, revealing how discrete
sequences interact under time shifts. The results align with theoretical expectations,
validating convolution’s role in analyzing LTI (Linear Time-Invariant) systems.
25
Experiment No: 07
Experiment Name: Cross-correlation and Auto-correlation coefficients in the
identification of Discrete Time Sequences and any image data with MATLAB
Objective:
• To represent discrete-time sequences in MATLAB.
• To compute and analyze cross-correlation between two sequences.
• To compute and analyze autocorrelation of a single sequence.
• To visualize input sequences and their correlation results.
Theory:
Measures similarity between two sequences x[n] and y[n] at different time lags:
Peak indicates the best alignment between sequences.
Auto-Correlation
Measures similarity of a sequence x[n]x[n] with its time-shifted self:
Maximum at k=0 (perfect alignment).
26
Program:
% Sequence 1: x[n]
x = [1, 0, 1, 0, 1]; % Signal 1
y = [0, 1, 0, 1, 0]; % Signal 2
n = 0:length(x)-1;
figure;
subplot(2,1,1);
stem(lags_xx, R_xx, 'b', 'filled');
title('Auto-Correlation R_{xx}[k]');
xlabel('Lag (k)'); ylabel('Correlation');
subplot(2,1,2);
stem(lags_xy, R_xy, 'r', 'filled');
title('Cross-Correlation R_{xy}[k]');
xlabel('Lag (k)'); ylabel('Correlation');
Result:
Figure 1: Results
• The input sequence x[n] was plotted.
27
• The cross-correlation between x[n] and y[n] showed the similarity and lag
relationship.
• The auto-correlation x[n] peaked at zero lag, confirming maximum similarity at no
shift.
Discussion
Cross-correlation identified the optimal alignment between x[n] and y[n], while auto-
correlation revealed the inherent periodicity of x[n]. MATLAB’s xcorr function efficiently
computed these metrics, demonstrating their utility in signal matching and system
analysis.
• Discrete sequences were successfully represented and processed.
• Cross-correlation effectively identifies the similarity between two signals.
• Auto-correlation highlights self-similarity and periodicity.
Conclusion
The experiment validated correlation techniques for sequence analysis, highlighting their
importance in pattern recognition and time-delay estimation. Results aligned with
theoretical expectations, confirming MATLAB’s effectiveness for correlation-based signal
processing.
28
Experiment No: 08
Experiment Name: DFT and FFT Analysis – I
Objective:
• To compare the computational efficiency of FFT and DFT for sequences of different
lengths
• To analyze 8-point FFTs of real-valued signals with even/odd symmetry
• To validate theoretical predictions about FFT optimization.
Theory:
The Discrete Fourier Transform (DFT) converts a finite sequence of equally spaced
samples into a frequency-domain representation. For a discrete-time signal x[n] of length
N, the DFT is defined as:
The Fast Fourier Transform (FFT) is an optimized algorithm to compute the DFT
efficiently. While the DFT has a computational complexity of O(N2), the FFT reduces this
to O(NlogN) when N is a power of two. The FFT exploits symmetry and periodicity in the
DFT calculation to minimize redundant operations.
Key differences between DFT and FFT:
• DFT computes all frequency components directly, making it slower for large N.
• FFT recursively breaks the problem into smaller subproblems, significantly
speeding up computation for power-of-two lengths.
29
Program:
% FFT/DFT Time Comparison
x = rand(1,65536); % Power-of-two length (2^16)
y = rand(1,65213);
tic; fft(x);
t1 = toc; % FFT optimized
tic; fft(y);
t2 = toc; % Defaults to DFT
disp(['FFT time (x): ',num2str(t1),' s']);
disp(['DFT time (y): ',num2str(t2),' s']);
% 8-Point FFT Analysis
xa = [1 1 1 1 0 0 0 0];
xb = [1 1 -1 0 1 0 -1 1];
xd = [0 1 1 1 0 -1 -1 -1];
Xa = fft(xa,8); Xb = fft(xb,8); Xd = fft(xd,8);
Result:
Q1: FFT/DFT Time Comparison
From MATLAB output
>> dft_fft
FFT time (x): 0.2452 s
DFT time (y): 0.032291 s
Q2: FFT/DFT Time Comparison
From MATLAB output
>> dft_fft
Xa: 4+0i 1-2.4142i 0+0i 1-0.41421i 0+0i 1+0.41421i
0-0i 1+2.4142i
Xb: 2 1.4142 4 -1.4142 -2 -1.4142 4 1.4142
Xd: 0+0i 0-4.8284i 0+0i 0-0.82843i 0+0i
30
Discussion
The experiment demonstrated FFT's superior computational efficiency, showing an 8.36×
speed advantage over DFT for power-of-two sequence lengths. Analysis of 8-point FFTs
confirmed theoretical symmetry properties: even-symmetric signals produced purely real
transforms (Xb), odd-symmetric signals yielded purely imaginary results (Xd), while
arbitrary real signals generated complex outputs (Xa). These findings validate
fundamental Fourier transform principles and highlight critical practical considerations
for signal processing - optimal length selection (preferring powers of two) and symmetry
awareness can significantly enhance computational efficiency and output predictability in
spectral analysis applications
Additionally, the analysis of 8-point FFTs for symmetric signals confirmed theoretical
expectations. The FFT of an even-symmetric signal resulted in purely real coefficients,
while an odd-symmetric signal produced purely imaginary coefficients. These
observations align with Fourier transform properties, reinforcing the importance of signal
symmetry in frequency-domain analysis.
Conclusion
The experiment successfully validated the efficiency of FFT for power-of-two sequence
lengths and demonstrated the impact of signal symmetry on FFT results. The findings
highlight the practical significance of choosing appropriate transform lengths and
leveraging symmetry to optimize computations. MATLAB's implementation effectively
illustrated these concepts, providing clear insights into DFT and FFT performance. These
principles are fundamental in digital signal processing, influencing applications ranging
from audio processing to telecommunications.
31
Experiment No.: 09
Experiment Name: Determination of the rational z-Transform from its Poles and
Zeros using MATLAB
Objective:
• To represent discrete-time sequences in MATLAB.
• To derive the transfer function H(z) from given poles and zeros.
• To analyze the pole-zero plot for system stability.
• To simulate and visualize the system's response to a user-defined input.
Theory:
Rational Z-Transform
For a discrete system with zeros and poles, the transfer function is:
• Zeros: Roots of the numerator (where H(z)=0).
• Poles: Roots of the denominator (where H(z)→∞).
Stability Criterion
A system is stable if all poles lie inside the unit circle (∣pj∣<1).
32
Program:
% Define numerator and denominator coefficients
num = [1 0.5];
den = [1 -0.8 0.15];
% Find poles and zeros
[z, p, k] = tf2zpk(num, den);
% Display poles and zeros
disp('Zeros:'), disp(z);
disp('Poles:'), disp(p);
% Plot pole-zero plot
figure;
zplane(num, den);
title('Pole-Zero Plot');
n = 0:20;
x = [1, zeros(1,20)];
y = filter(num, den, x);
figure;
stem(n, x, 'filled');
title('Input Sequence');
xlabel('n');
ylabel('Amplitude');
grid on;
figure;
stem(n, y, 'filled');
title('Output Sequence');
xlabel('n');
ylabel('Amplitude');
grid on;
33
Result:
Figure 1: Pole-zero plot
Figure 2: Input Sequence
34
Figure 3: Output Sequence
Zeros:
-0.5000
Poles:
0.5000
0.3000
• Poles and zeros of the defined system were successfully computed in Figure 1. The
experimental system is stable because all poles are inside the unit circle.
• Pole-zero plot was obtained, showing the system behavior.
• The input (impulse) and the corresponding output sequences were plotted in Figures
2 and 3.
35
Discussion
In this experiment, we focused on understanding the relationship between a system’s
poles and zeros and its behavior in the Z-domain. By defining the transfer function
through its numerator and denominator polynomials, we could easily identify and plot
the poles and zeros, which provided insight into the system’s stability and frequency
response. The pole-zero plot visually demonstrates the location of poles and zeros on the
z-plane, helping to predict the nature of the output sequence. Using a simple impulse
input allowed us to observe the system's natural response, reinforcing the theoretical
concepts studied in discrete-time signal analysis.
Conclusion
The experiment successfully demonstrated the method of determining the rational Z-
transform from the poles and zeros of a discrete-time system. By analyzing the pole-zero
distribution, we could understand the system characteristics and verify them by observing
the system's response to a given input. The practical implementation through MATLAB
matched well with theoretical expectations, enhancing our understanding of system
behavior in the z-domain.
36