Вы находитесь на странице: 1из 6

Digital Signal Processing

LAB # 4. Discrete-time systems and Z Transforms


I. OBJECTIVES By the end of this laboratory assignment, you should be able to: Analyze z-transforms using MATLAB. Implement a discrete-time system and obtain its transfer function.

II. BACKGROUND Discrete-time signals The time variable t is said to be a discrete-time variable if t takes on only integer values. For example, t could take on the integer values t = n, for n = 0, 1, 2 A discrete-time signal is a signal that is defined only at the discrete-time points t = n. Discrete-time signals arise in many areas of engineering, science and economics. We are going to denote them by x[n], where the integer value n corresponds to time points.
1

0.5

x[n]

-0.5

-1 0 5 10 n 15 20

Figure 1. Discrete-time signal. One of the most common ways in which a discrete-time signal arise is in sampling continuous-time signals. The time duration T between adjacent sampling instants can be defined as sampling interval. By definition of the sampling process, the discrete-time signal x[n] resulting from the sampling operation is given by:

x[n] = x(t ) t = nT = x(nT )


s

(1)

A discrete-time signal x[n] is periodic if there exists a positive integer N such that:
x[n + N ] = x[n] for all integers n

(2)

Page 1 of 6

Digital Signal Processing Hence x[n] is periodic if and only if there is a positive integer N such that x[n] repeats itself every N time instants, where N is called the period. The fundamental period is the smallest value of N for which the signal repeats. As an example, lets examine the periodicity of a sinusoid:

x[n] = sin ( 0 n )
Where 0 is the fundamental frequency. In the case of complex exponentials and sinusoids, the period is given by:

N=

2 m 0

(3)

Where m is the smallest positive integer that results in an integer value of N. This is a requirement for a discrete-time signal to be periodic: its period must be integer. As is a irrational number, the fundamental frequency has to be a rational number p/q times . For 3 example, the signal in fig.1 is a sinusoid with 0 = 3/4 i.e., x[n] = sin n . This 4 signal is periodic and its period is given by:
N= 8 2 2 m= m= m 3 0 3 4

So, if we choose m = 3, the period N is 8. A sinusoid with frequency 0 = 9/4 is shown in fig. 2. You can see that the signal is not periodic.
1

0.5

x[n]

-0.5

-1 0 5 10 n 15 20 25

Figure 2. Non-periodic discrete-time sinusoid. The basic discrete-time signals can be seen in fig. 3.

Page 2 of 6

Digital Signal Processing

http://www.vocw.edu.vn/content/m10810/latest/

Figure 3. Basic discrete-time signals


Z transform

The one-sided z-transform of the discrete signal x[n], denoted by X(z), is defined by: X (z ) = x[n]z n = x[0] + x[1]z 1 + x[2]z 2 + ...
n =0

(4)

As seen from (4), the one-sided z-transform is a power series in z-1 whose coefficients are the values of the signal x[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: X (z ) = B( 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, Page 3 of 6

Digital Signal Processing

consider the signal x[n] = 2 n u[n] whose graph is shown in fig. 4 a). Note that the signal increases with time up to infinite. The z-transform X(z) is given by:
X (z ) = z z2

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 35 30 25 Imaginary Part 20 x[n] 15 10 5 0 -2 2.5 2 1.5 1 0.5 0 -0.5 -1 -1.5 -2 -2.5 0 n 2 4 -1 0 1 Real Part 2 b) z-plane

Figure 4. The signal x[n] = 2nu[n].


III. REFERENCES

1. Kamen, E. W. and Heck, B. S. Fundamentals of Signals and Systems Using the Web and MATLAB. 3rd edition. Prentice Hall 2006. 2. Stonick, V. and Bradley, K. Labs for Signals and Systems using MATLAB. International Thompson Publishing. 1996.
IV. LAB PREPARATION

1. The N-point moving average (MA) filter is a discrete-time system given by the inputoutput relationship: y[n] = 1 [x[n] + x[n 1] + x[n 2] + ...x[n N + 1]] N

Where x[n] is the input applied to the filter and y[n] is the resulting output response, for example, if N = 3, the 3-point MA filter is given by the input/output relationship:

y[n] =

1 [x[n] + x[n 1] + x[n 2]] 3


Page 4 of 6

Digital Signal Processing

The output y[n] at time n of the filter is the average of the N input values x[n], x[n-1], x[n-N+1]. The filter is referred to as a moving average filter since we compute the next values of the output by moving the range of time points over which the filter output is computed. a) Calculate the z-transform Y(z) of the 3-point MA filter in terms of the z-transform of the input X(z). Use the properties of the z-transform, and assume initial conditions equal to zero. b) Obtain the transfer function of the system as H ( z ) = Y (z ) . X (z )

V. MATERIALS AND METHODS Procedure:

Part 1. Discrete systems. MA filters are often used to reduce the magnitude of the noise that may be present in a signal. Suppose that the input x[n] is given in the form: x[n] = s[n] + e[n], where s[n] is the smooth part of x[n] and e[n] is the erratic or noisy part of x[n]. If e[n] varies randomly about zero, its average can be made as small as desired (in theory) by taking the value of N to be sufficiently large. 1. Define a 1-second 440Hz sine wave. Use a time vector with sampling frequency equal to 8000Hz. Plot and listen to the signal. 2. Generate a vector of random noise with zero mean and 0.1 standard deviation. Use the function randn, and make sure that the noise vector has the same length than the sine wave. 3. Add the noise to the sinusoid, plot the signal and listen to its sound. 4. Implement a 10-point moving average filter, as follows.
for k = 10: length(x); a = x(k-9:k); y(k) = sum(a)/10; end

5. Plot the output signal and listen to the sound. 6. Modify the filter increasing and reducing the number of points N in the MA filter. Repeat numeral 5 and compare the results.

Page 5 of 6

Digital Signal Processing

Part 2. Z-transforms. Poles and zeros of a function can be obtained using the command roots, and their graph can be generated with zplane(b,a). Where b y a are row vectors with coefficients of numerator and denominator; or column vectors with poles and zeros. The function residuez obtains the partial fraction expansion of a Z-transform expressed as B(z)/A(z). It can be used as follows: [r, p, k] = residuez(b,a), where b and a are vectors that represent the polynomial coefficients of numerator and denominator in ascending powers of z-1. r and p are column vectors containing the residues and poles, respectively, and k contains the direct terms in a row vector. 7. Use zplane to graph poles and zeros of the following transfer function
H (z ) = 1 3 z 1 1 1 1 2 z z 4 8

8. Obtain the partial fraction expansion of H(z).


VI. DISCUSSION

1. Compare the input and output signals of the MA filter and describe the differences. Which value of N gave the best results in noise reduction? 2. If the system in part 2 is stable, what is the ROC? Is the system causal? 3. Calculate the impulse response h[n] using the partial fraction expansion in numeral 8 and tables. 4. Upload the .m file in SAVIO. Include the lab preparation, the code, and the answers to the questions.

Page 6 of 6

Вам также может понравиться