0% found this document useful (0 votes)
7 views19 pages

Lab 5

This document outlines a laboratory report for a Digital Signal Processing course, focusing on Z-transform and transfer functions. It includes a grading checklist, team contributions, a table of contents, and detailed discussions on discrete-time systems, transfer functions, and experimental procedures. The report also presents various problems related to system stability, impulse responses, and frequency analysis, along with MATLAB code for implementation.

Uploaded by

ngannguyen999xxx
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)
7 views19 pages

Lab 5

This document outlines a laboratory report for a Digital Signal Processing course, focusing on Z-transform and transfer functions. It includes a grading checklist, team contributions, a table of contents, and detailed discussions on discrete-time systems, transfer functions, and experimental procedures. The report also presents various problems related to system stability, impulse responses, and frequency analysis, along with MATLAB code for implementation.

Uploaded by

ngannguyen999xxx
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/ 19

International University

School of Electrical Engineering

Digital Signal Processing Laboratory

EE093IU

Z TRANSFORM AND TRANSFER FUNCTION

Submitted by

Student Name Student ID

Lê Tiến Phát ITITIU21273

Nguyễn Ngọc Ngân SESEIU21025

Date Performed: 09/05/2025


Date Submitted: 06/06/2025
Lab Section: Lab 5
Course Instructor: M. Eng Nguyen Minh Thien

International University 1
EE093IU
School of CSE
GRADING CHECKLIST

Number Content Satisfied? Score Comment


Format (max 9%)
- Font type Yes No
1
- Font size Yes No

- Lab title Yes No

- Page number Yes No

- Table of contents Yes No

- Header/Footer Yes No

- List of figures (if exists) Yes No

- List of tables (if exists) Yes No

- Lab report structure Yes No

2 English Grammar and Spelling (max 6%)


- Grammar Yes No

- Spelling Yes No

3 Data and Result Analysis (max 85%)

Total Score

Date:

Signature

International University 2
EE093IU
School of CSE
TEAM CONTRIBUTION
Task Lê Tiến Phát Nguyễn Ngọc Ngân
Collaborated on all coding tasks, participated in problem-solving
Collaboration
discussions, and jointly tested MATLAB implementations
Lab preparation Answer in-class questions
and experiment
Data analysis Jointly analyzed & verified the results for all problems
Write fundamental background & Write experiment procedure &
Report writing
Conclusion Results

International University 3
EE093IU
School of CSE
Table of Contents
List of Figures ........................................................................................….….............................. 4
Discussion of Fundamentals.............................................................................................…….... 5
Experimental Procedure.............................................................................................……........... 6
Results .......................................................................................................................................... 9
Conclusions………...................................................................................................................... 17
List of Figures
Figure 1 – Plotting the Impulse Response 10
Figure 2 – The closed-loop transfer function H(z) 10
Figure 3 – The system stability, zero-pole-gain form, and Partial fraction form 11
Figure 4 – Poles, Zeros, and Impulse Response 12
Figure 5 – Impulse Response of H1(z) and H2(z). 13
Figure 6 – Response to Unit Step and Unit Impulse. 14
Figure 7 – Frequency and Impulse Responses 16
Figure 8 – Step Response 17

International University 4
EE093IU
School of CSE
Discussion of Fundamentals

Discrete-time System
A discrete-time system is any device or algorithm that takes a discrete-time signal x[n] as
input and produces another discrete-time signal y[n] as output. The signals are sequences defined
only at integer time indices n, representing samples of a continuous-time signal or inherently
discrete data. The discrete-time signals involve recognizing sequences, such as unit impulse
(𝛿[n]) and unit step (u[n]), which are fundamental for defining system inputs, such as computing
transfer functions from impulse responses.

Basic Properties and Classification


Discrete-time systems can be classified based on several key properties:
● Linearity: A system is linear if it satisfies the principles of superposition (additivity and
homogeneity).
● Time-Invariance: A system is time-invariant if its behavior and characteristics do not
change over time. Formally, if the input is shifted in time, the output shifts by the same
amount without changing shape.
● Causality: A system is causal if the output at any time depends only on the present and
past inputs, not future inputs.
● Memory: Systems with memory depend on past or future inputs; memoryless systems
depend only on the current input.
● Stability: A system is stable if bounded inputs produce bounded outputs.
● Nonlinearity and Time-Variability: Some systems may be nonlinear or time-varying,
such as median filters, which are nonlinear and may depend on time

Mathematical Representation
Discrete-time systems are often described by linear constant-coefficient difference
equations such as:
y[n] = a1y[n−1] + a2y[n−2] + ⋯ + b0x[n] + b1x[n−1] +…
where y[n] is the output, x[n] the input, and ai, bi are system coefficients. The ability to
perform discrete-time convolution is critical, as it relates to impulse responses, and solving
difference equations is necessary for modeling systems.

Approximations
Discrete-time systems can approximate continuous-time operations, for example:
● Discrete-time differentiator:
𝑥[𝑛] − 𝑥[𝑛 − 1]
𝑦[𝑛] =
𝑇
● Discrete-time integrator:
𝑦[𝑛] = 𝑦[𝑛 − 1] + 𝑇. 𝑥[𝑛]
where T is the sampling period. These approximations become more accurate as T decreases

Transfer Functions

International University 5
EE093IU
School of CSE
The transfer function of a discrete-time system is a fundamental concept that provides a
frequency-domain representation of the system, relating the Z-transform of the output to the Z-
transform of the input. It is a powerful tool for analyzing and designing discrete-time systems,
especially linear time-invariant (LTI) systems.
The discrete-time transfer function H(z) is defined as the ratio of the Z-transform of the
output Y(z) to the Z-transform of the input U(z):
𝑌(𝑧)
𝐻(𝑧) =
𝑈(𝑧)
This function characterizes the system completely in the Z-domain and is typically
expressed as a rational function of z:
𝑏𝑛𝑧𝑛 + 𝑏𝑛−1𝑧𝑛−1+. . . +𝑏1𝑧 + 𝑏0
𝐻(𝑧) =
𝑧𝑚 + 𝑎𝑚−1𝑧𝑚−1+. . . +𝑎1 𝑧 + 𝑎0
where the numerator coefficients 𝑏𝑖 and 𝑎𝑖 denominator coefficients define the system's
zeros and poles, respectively.

Poles and Zeros


The roots of the numerator polynomial b(z) are called zeros, and the roots of the
denominator polynomial a(z) are called poles. The locations of poles and zeros in the complex z-
plane determine the system's frequency response and stability. Poles inside the unit circle imply a
stable system.

Experimental Procedure

Problem 1: Closed-Loop Transfer Function and Inverse Z-Transform


Objective: Compute the closed-loop transfer function H(z) of the system that is depicted
in the figure and find the inverse z – transform of the obtained transfer function.

Given:
0.5
● 𝐺(𝑧) = 𝑧−0.1
0.2
● 𝐹(𝑧) = 𝑧−0.1
● 𝐾=2
Procedure:

International University 6
EE093IU
School of CSE
1. Determine the structure of the closed control system
𝑌(𝑧) 𝐺(𝑧)𝐾
𝐻(𝑧) = =
𝑈(𝑧) 1 + 𝐺(𝑧)𝐾 𝐹(𝑧)
2. Compute the closed-loop transfer function
𝑧 − 0.4
𝐻(𝑧) =
𝑧2 − 0.5𝑧 + 0.24
3. Find the inverse Z-transform of H(z): using residuez command in MATLAB /
Analyze into partial fractions and look up the reverse Z-transform table, then use
the command impz(num, den) to find the sequence h[n]

Problem 2: Stability and Transfer Function Forms


Objective:
a. Check if the system is stable.
b. Express the transfer function as zero-pole-gain.
c. Express the transfer function as partial fraction.
Given Function:

8𝑧2 + 10𝑧 − 6
𝐻(𝑧) =
𝑧3 + 2𝑧2 − 𝑧 − 2
Principle:
a. A discrete system is stable if every pole of the transfer function H(z) lies inside
the unit circle, i.e. |p| < 1 for every pole p.
- Determine the poles using the roots of the denominator (the numerator
does not affect stability).
- Calculate the modulus (magnitude) of each pole.
- Compare with 1.
b. Represent the transfer function by “tf2zp”:
(𝑧 − 𝑧1 )(𝑧 − 𝑧2 ) ...
𝐻(𝑧) = 𝑘
(𝑧 − 𝑝1 )(𝑧 − 𝑝2 ) ...
c. Convert the rational fraction H(z) into the sum of simpler fractions by “residue”:
𝐴𝑖
𝐻(𝑧) = ∑ 𝑧 − 𝑝𝑖

Problem 3: Poles, Zeros, and Impulse Response


Objective:
- Represents the pole and zero positions of H(z), which helps in stability
assessment.
- Displays the first 80 values of the impulse response sequence h[n], which
describes the system's response to a unit impulse input signal.
Process:
1. Transfer function analysis: num, den
2. Use the zplane(num, den) command to draw the z-space (z-plane):
- The zeros are roots of the numerator.

International University 7
EE093IU
School of CSE
- The poles are roots of the denominator.
- The unit circle is drawn to evaluate stability.
3. Calculate and plot the impulse response
- Use the impz(num, den, 80) command to calculate the first 80 samples of
the impulse response.
- Use the stem() or stairs() command to plot.

Problem 4: Delay System and Impulse Responses


Objective:
a. Find the new transfer function 𝐻2 (𝑧) of the system with a delay of 2
samples compared to the original system. Plot the system
response in the range 0 ≤ n ≤ 8.
b. Find the impulse response ℎ1 [𝑛] of the original system 𝐻(𝑧).
c. Find the impulse response ℎ2 [𝑛] of the new system 𝐻2 (𝑧).

Principle:
a. Create a 2 time unit delay for the system:
- The k-sample delay corresponds to multiplying the system by 𝑧 −𝑘 , so
𝐻2 (𝑧) = 𝑧 −2 . 𝐻(𝑧)
- Plot the impulse response from 0 to 8
b. Find the impulse response of the initial system H(z) by “impz”
c. ℎ2 [𝑛] is to shift ℎ1 [𝑛] 2 units to the right

Problem 5: Response to Impulse and Step Inputs


Objective: Calculate and plot the system response y[n] when:
- x[n] is unit impulse (δ[n])
- x[n] is unit step (u[n])

Process:
1. Determine the numerator and denominator of the system
2. Calculate and plot the response with x[n] as unit impulse: Use the function
impz(num, den, N) to take the first N samples of the impulse response.
3. Calculate and plot the response with x[n] as unit step: Use the function stepz(num,
den, N) to take the first N samples of the step response.

Problem 6: Frequency and Time Domain Analysis


Objective:
- Plot the frequency response (amplitude in dB and phase in radians).
- Calculate and plot the impulse response and step response of the system.

International University 8
EE093IU
School of CSE
Process:
1. Determine the numerator and denominator coefficients from the expression
𝐻(𝑒 𝑗𝜔 )
2. Plot the frequency response (amplitude and phase)
3. Calculate and plot the impulse and step response
- Use impz() to calculate the impulse response
- Use stepz() to calculate the step response
Experimental Results
Problem 1:

clear; clc;
% Define G(z) and F(z)
num_G = [0.5]; den_G = [1, -0.1]; % G(z) = 0.5/(z-0.1)
num_F = [0.2]; den_F = [1, -0.4]; % F(z) = 0.2/(z-0.4)
K = 2;

% Compute K*G(z)
num_KG = K * num_G; den_KG = den_G; % num_KG = [1], den_KG = [1, -0.1]

% Compute K*G(z)*F(z)
num_KGF = conv(num_KG, num_F); % [1] * [0.2] = [0.2]
den_KGF = conv(den_KG, den_F); % [1, -0.1] * [1, -0.4] = [1, -0.5, 0.04]

% Denominator of H(z): 1 + K*G(z)*F(z)


% Represent 1 as [0, 0, 1] to match den_KGF's degree (2)
num_KGF_padded = [0, 0, num_KGF(1)]; % Pad [0.2] to [0, 0, 0.2]
den_H = den_KGF + num_KGF_padded; % [1, -0.5, 0.04] + [0, 0, 0.2] = [1, -0.5, 0.24]

% Numerator of H(z): K*G(z) * den_KGF to match degrees


num_H = conv(num_KG, den_F); % [1] * [1, -0.4] = [1, -0.4]

% Display H(z)
H = tf(num_H, den_H, -1); % -1 for z^-1 convention
disp('Problem 1: Closed-loop transfer function H(z):');
printsys(num_H, den_H, 'z');

% Compute and plot impulse response (inverse z-transform)


[h, n] = impz(num_H, den_H, 50);
figure;
stem(n, h);
xlabel('n'); ylabel('h(n)'); title('Problem 1: Impulse Response');

Result

International University 9
EE093IU
School of CSE
Figure 1. Result of the program in Problem 1 – Plotting the Impulse Response

Figure 2. Result of the program in Problem 1 – The closed loop transfer function H(z)

Problem 2:

clear; clc;
num = [8, 10, -6]; den = [1, 2, -1, -2];

% a. Check stability
poles = roots(den);
is_stable = all(abs(poles) < 1);
disp('Problem 2a: System stability:');
if is_stable
disp('System is stable (all poles inside unit circle).');
else
disp('System is unstable (some poles outside unit circle).');
International University 10
EE093IU
School of CSE
end
% b. Zero-pole-gain form
[z, p, k] = tf2zp(num, den);
disp('Problem 2b: Zero-pole-gain form:');
disp(['Zeros: ', num2str(z')]);
disp(['Poles: ', num2str(p')]);
disp(['Gain: ', num2str(k)]);
% c. Partial fraction form
[r, p, k] = residue(num, den);
disp('Problem 2c: Partial fraction form:');

syms z
H_partial = 0;

for i=1:length(r)
H_partial = H_partial + r(i)/(z-p(i));
end

disp(vpa(H_partial, 4))

for i = 1:length(r)
disp(['Residue ', num2str(r(i)), ' at pole ', num2str(p(i))]);
end
if ~isempty(k)
disp(['Direct term: ', num2str(k)]);
end

Result

Figure 3. Result of the program in Problem 2 – The system stability, zero - pole - gain form, and Partial fraction form

Problem 3:

clear; clc;
num = [1, 0, 1]; den = [1, -1.39, 1.21];
figure;

% Left subplot: poles and zeros


subplot(1,2,1);
zplane(num, den);
International University 11
EE093IU
School of CSE
title('Poles and Zeros');

% Right subplot: impulse response


[h, n] = impz(num, den, 80);
subplot(1,2,2);
stem(n, h);
xlabel('n'); ylabel('h(n)'); title('Impulse Response');
sgtitle('Problem 3');

Result

Figure 4. Result of the program in Problem 3 – Poles, Zeros, and Impulse Response

Problem 4:
clear; clc;
num1 = [1, 0, 0]; den1 = [1, 0.2, 0.01];
N = 9; % n from 0 to 8
% Impulse response of H_1(z)
[h1, n] = impz(num1, den1, N);
figure;
subplot(2,1,1);
stem(n, h1);
xlabel('n'); ylabel('h_1(n)'); title('Impulse Response of H_1(z)');

% Impulse response of H_2(z) = z^-2 H_1(z)


h2 = zeros(1, N);
International University 12
EE093IU
School of CSE
h2(3:N) = h1(1:N-2); % Shift by 2 (h2(n) = h1(n-2))
subplot(2,1,2);
stem(n, h2);
xlabel('n'); ylabel('h_2(n)'); title('Impulse Response of H_2(z)');
sgtitle('Problem 4');

Result

Figure 5. Result of the program in Problem 4 – Impulse Response of H1(z) and H2(z).

Problem 5:

clear; clc;
num = [0.01, 0.03, 0.015]; den = [1, -1.6, 0.8];
N = 50; % Sufficient length for visualization

% Impulse response
[h, n] = impz(num, den, N);
figure;
subplot(2,1,1);
stem(n, h);
xlabel('n'); ylabel('y[n]'); title('Response to Unit Impulse');

% Step response
% x_step = ones(1, N);
% y_step = filter(num, den, x_step);
% subplot(2,1,2);
International University 13
EE093IU
School of CSE
% stem(n, y_step);
% xlabel('n'); ylabel('y[n]'); title('Response to Unit Step');
% sgtitle('Problem 5');

% Step response by stepz


[h, n] = stepz(num, den, N);
subplot(2,1,2);
stem(n, h);
xlabel('n'); ylabel('y[n]'); title('Response to Unit Step');
sgtitle('Problem 5');

Result

Figure 6. Result of the program in Problem 5 – Response to Unit Step and Unit Impulse.

Problem 6:

clear; clc;
num = [0.1, 0.1, 0.18, 0.18, 0.09, 0.09];
den = [1, -1.5, 2.2, -1.5, 0.8, 0.18];

% Frequency response
[H, w] = freqz(num, den, 512);
figure;
subplot(3,1,1);
International University 14
EE093IU
School of CSE
plot(w/pi, 20*log10(abs(H)));
xlabel('Normalized Frequency (\times\pi rad/sample)');
ylabel('Magnitude (dB)'); title('Magnitude Response');
subplot(3,1,2);
plot(w/pi, angle(H));
xlabel('Normalized Frequency (\times\pi rad/sample)');
ylabel('Phase (radians)'); title('Phase Response');

% Impulse response
[h, n] = impz(num, den);
subplot(3,1,3);
stem(n, h);
xlabel('n'); ylabel('y[n]'); title('Impulse Response');
sgtitle('Problem 6: Frequency and Impulse Responses');

% Step response
% figure;
% x_step = ones(1, length(h));
% y_step = filter(num, den, x_step);
% stem(n, y_step);
% xlabel('n'); ylabel('y[n]'); title('Problem 6: Step Response');

% Step response by stepz


n = 0:200;
[h, t] = stepz(num, den, n);
figure;
stem(n, h);
xlabel('n'); ylabel('h[n]');
title('Step Response');

Result

International University 15
EE093IU
School of CSE
Figure 7. Result of the program in Problem 6 – Frequency and Impulse Responses.

International University 16
EE093IU
School of CSE
Figure 8. Result of the program in Problem 6 – Step Response.

Conclusion

Summary of Work
This lab focused on exploring the Z-transform and transfer functions of discrete-time
linear systems. Through a series of theoretical exercises and MATLAB implementations, students
analyzed system behavior using impulse response, step response, pole-zero plots, and frequency
response. The lab provided hands-on experience with MATLAB functions such as tf, zplane, impz,
stepz, and freqz to study system properties in both time and frequency domains.

Key Findings
Theoretical Validation: By deriving closed-loop transfer functions and computing their inverse Z-
transforms, we gained a deeper understanding of how feedback systems behave and how transfer
functions encapsulate their dynamics. Stability analysis was explored by examining the pole
locations in the z-plane, emphasizing that a system is stable only when all poles lie within the unit
International University 17
EE093IU
School of CSE
circle. Impulse and step responses were used to visualize the system's internal behavior,
highlighting how time-domain characteristics evolve in response to specific inputs. Furthermore,
frequency domain analysis using the Z-transform provided valuable insights into how systems
respond across different frequencies, with MATLAB plots closely aligning with theoretical
expectations.

Algorithm Performance: MATLAB proved to be an efficient and user-friendly environment for


signal processing simulations. The freqz function quickly calculated magnitude and phase
responses with a smooth frequency resolution. impz and stepz reliably generated impulse and step
responses with just a few lines of code. The zplane and roots functions provided visual
confirmation of system stability by clearly showing pole and zero locations. Across all problems,
algorithms executed smoothly and returned results consistent with theoretical expectations,
reinforcing MATLAB as a valuable tool for digital signal processing.

Practical Applications: The concepts and techniques explored in this lab have broad practical
relevance. In digital filter design, understanding Z-transforms and stability is crucial for ensuring
the system behaves as intended. In control systems, accurate modeling using transfer functions
allows engineers to predict and refine system responses. These tools are also widely used in
communications, audio processing, and embedded systems, where efficient and stable digital
signal handling is essential.

Difficulties and Solutions


Converting differential equations into transfer functions allows for their resolution by To
properly handle delayed terms, the Z-transform properties particularly the shift property were
carefully applied. Time-delayed modeling systems can be resolved by verifying the delay in
impulse response plots using the idea of increasing the transfer function by 𝑧 −𝑘 . System stability
can be confirmed by To verify stability criteria, pole positions were determined using roots() and
their magnitude was verified using abs().

Key Points

International University 18
EE093IU
School of CSE
𝑌(𝑧)
𝐻(𝑧) = is central to system analysis. Stability ⇔ All poles lie inside the unit circle ∣z∣<1.
𝑈(𝑧)

Delay in time domain ⇔ Multiply by 𝑧 −𝑘 in Z-domain. Impulse and step responses help understand
time-domain behavior. Frequency response provides magnitude and phase information for system
design and analysis.

THE END

International University 19
EE093IU
School of CSE

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy