UNIVERSIDAD TECNOLÓGICA DE BOLÍVAR
SIGNALS & SYSTEMS
                               LAB 4. Laplace and Z transforms
Objectives
By the end of this laboratory assignment, you should be able to:
•   Use numerical simulation to do the analysis of continuous-time systems.
•   Implement a discrete-time system and obtain its transfer function.
Background
Laplace Transform
The Laplace transform is a very useful mathematical tool for the analysis of continuous-
time signals and systems.
The Laplace transform of a continuous-time signal x(t) can be evaluated with the following
integral:
                                                  ∞
                                       X (s ) =   ∫ x(t )e
                                                             − st
                                                                    dt
                                                  −∞
Using the Laplace transform, it is possible to obtain the transfer function representation of
a causal linear time-invariant continuous-time system. Based on the transfer function, the
properties of the system can be analyzed and the output response can be computed
algebraically for a large class of input signals.
The equation to obtain the inverse Laplace transform is hard to solve and it is rarely used.
Instead, algebraic procedures are used to compute the inverse Laplace transform of a
signal based on common Laplace transform pairs and the properties of the Laplace
transform.
Z transform
The z-transform of the discrete signal x[n], denoted by X(z), is defined by:
                                                      ∞
                                       X (z ) =   ∑ x[n]z
                                                  n = −∞
                                                                    −n
Given a discrete-time signal x[n] with z-transform X(z), the set of all complex numbers z
such that the summation on the right-hand side of (4) converges (i.e. is less than infinite)
is called the region of convergence of X(z).
The z-transform X(z) of x[n] is rational if it can be written in the form:
                             UNIVERSIDAD TECNOLÓGICA DE BOLÍVAR
                                                                      B(z )
                                               X (z ) =
                                                                      A( z )
where B(z) and A(z) are polynomials in z with real coefficients. The roots of A(z) = 0 are the
poles pk of X(z), and the roots of B(z) = 0 are the zeros zl of X(z). When z = pk the
denominator of X(z) is equal to zero, so X(z) is infinite. When z = zl, the numerator of X(z) is
zero and X(z) is zero. The signal x[n] has a limit as n →∞ if the poles are located in the unit
disk of the complex plane. The open unit disk is the part of the complex plane consisting of
all complex numbers whose magnitude is strictly less than 1. For example, consider the
signal x[n] = 2 n u[n] whose graph is shown in fig. 1 a). Note that the signal increases with
time up to infinite. The z-transform X(z) is given by:
                                               X (z ) =
                                                                       z
                                                                      z−2
X(z) has one zero at z = 0 and one pole at z = 2, as seen in fig. 4 b). Note that the pole is
outside of the unit disk, so it shows that the signal has no limit in time domain.
                              a) Time domain                                      b) z-plane
                       35
                                                                       2.5
                       30                                               2
                                                                       1.5
                       25
                                                                        1
                                                     Imaginary Part
                                                                       0.5
                       20
                x[n]
                                                                        0
                       15                                             -0.5
                                                                        -1
                       10
                                                                      -1.5
                       5                                                -2
                                                                      -2.5
                       0
                        -2    0         2      4                             -1   0        1   2
                                    n                                             Real Part
                                  Figure 1. The signal x[n] = 2nu[n].
Procedure
Part 1. Laplace transform and systems analysis using numerical simulation.
The output of a system can be computed numerically using the functions tf and lsim.
The numerator and denominator polynomials are represented as vectors containing the
                        UNIVERSIDAD TECNOLÓGICA DE BOLÍVAR
coefficients of the polynomial in descending powers of s. For example, the transfer
                    s −8
function H (s ) = 3           , can be defined as follows:
                 s + 2 s + 10
       num = [1 -8];
       den = [1 0 2 10];
       H = tf(num,den)
The impulse response and the step response can be obtained for a specific time interval
using the commands:
       t = 0:0.1:10;
       h = impulse(H,t);
       y = step(H,t);
If you do not provide output arguments, the signal is graphed. The output for a particular
input signal can be computed as:
       x = sin(pi*t);
       y = lsim(H,x,t);
If the zeros, poles and gain of a system are known, you can use the Matlab command zpk
to find its transfer function. zpk creates a continuous-time zero-pole-gain (ZPK) model
with zeros Z, poles P, and gains K.
1. A system has three poles and two zeros located in the following locations:
                 Zeros:       s = 3+j,3-j
                 Poles:       s = -1+2j, s = -1-2j, s = -2
   If the gain is 1, find the transfer function using zpk.
2. Using numerical simulation, obtain the graphs of the step response of the system, and
   the output when the input signal is: x (t ) = cos(3t )u (t ) .
3. Obtain the graph of the step response when the complex poles are moved to the
   following locations, and analyze the results
       a. s = 2j and s = -2j
       b. s = 1+2j and s = 1-2j
                       UNIVERSIDAD TECNOLÓGICA DE BOLÍVAR
Part 2. Discrete systems and Z transform.
We want to remove noise from an audio signal using digital filters. Download the files
bluesA1.wav and bluesA2.wav into the MATLAB folder.
4. Import the audio files to MATLAB using the command wavread as follows
   [x1,fs] = wavread(‘bluesA1.wav’);
5. Listen to both signals. Note that the sampling frequency is 11025Hz.
6. Define a time vector as follows:
   L = length(x1);
   t = 0:1/11025:(L-1)/11025;
7. Plot the signals with respect to time in the same figure using the command subplot
8. Calculate and graph the Discrete Fourier Transform of the signals as follows
   X1 = fft(x1);
   w = linspace(0,2,L);
   plot(w,abs(X1))
   The graph shows the magnitude of the spectra vs the normalized frequency (ω from 0
   to 2, where 2 corresponds to 2π). Plot both Fourier transforms in the same figure.
9. Can you identify the noise in the spectrum of the second signal? What kind of filter do
   we need in order to remove the noise? Determine an appropriate cutoff frequency.
The Signal processing Toolbox in MATLAB contains several functions for designing digital
filters. One of these functions is explained next.
BUTTER: Butterworth digital and Designs an Nth order lowpass digital Butterworth
analog filter design.           filter and returns the filter coefficients in length
                                N+1 vectors B (numerator) and A (denominator).
[B,A] = BUTTER(N,Wn)
                                The coefficients are listed in descending powers of
                                z. The cutoff frequency Wn must be normalized to 1
                                rad, i.e., 0.0 < Wn < 1.0, with 1.0 corresponding to
                                half the sample rate.
10. Use the function butter to obtain the coefficients of the transfer function of a
    second-order filter. Provide an appropriate value for the normalized cutoff frequency.
11. Type fvtool(B,A) in the command window, where B and A are the coefficients
    of numerator and denominator respectively (calculated with the function butter).
                          UNIVERSIDAD TECNOLÓGICA DE BOLÍVAR
    fvtool (filter visualization tool) is a graphic interface that allows you to analyze
    filters. Observe magnitude, phase, group delay, and impulse response of the filter.
12. Filter the signal as follows:
    y = filter(B,A,x2);
13. Playback the filtered signal. Calculate and plot its spectrum. Where you able to
   remove the noise? If not, go back to numeral 10 and design your filer again.
14. Try different values of N for the filter, and describe the results.
Analysis
•   Describe the step response of the system in exercise 2 and how it changes when the
    poles are moved to the right. What happens to the system? Evaluate stability and
    causality
•   Obtain the transfer function of the second-order filter in Part 2. What is the ROC?
    Obtain the impulse response using the inverse Z transform.
•   Compare the input signal and the output of the filter in Part 2. Was the filter effective
    to remove the noise? What happens if N is increased?