Fill This Form To Receive Instant Help
Homework answers / question archive / An Nth-order discrete-time infinite impulse response (IIR) filter can be represented by the system function H(z) = c0 + c1z +
An Nth-order discrete-time infinite impulse response (IIR) filter can be represented by the system function H(z) = c0 + c1z + . . . + cM?1zM?1 + cMzM d0 + d1z + . . . + dN?1zN?1 + zN (1) where Y (z) = H(z)X(z), and X(z) and Y (z) are the z-transforms of the input sequence x[n] and the output sequence y[n], respectively. Note that this expression is different than but equivalent to the one we have discussed in class since it is written in powers of z instead of powers of z?1. Also, note that the filter coefficients have been normalized by the last coeffi- cient in the denominator so that this coefficient becomes one after normalization. Therefore, the feedforward and feedback coefficients have been renamed as {ck} for k = 0, 1, . . . , M and {dl} for l = 0, 1, . . . , N ? 1, respectively. In this assignment, you will write two MATLAB functions to plot the pole-zero diagram and the frequency response of an Nth-order IIR system that will take the coefficients {ck} for k = 0, 1, . . . , M and {dl} for l = 0, 1, . . . , N ? 1 as input. Note: You are not allowed to use any MATLAB functions such as freqz or zplane, or toolboxes such as Filter Design and Analysis Tool that plot the pole-zero diagram or the frequency response of a system. You will not receive any credit if you use such tools. If you need, you may use the roots function to find the roots of a polynomial. 1) Write a MATLAB function to plot the pole-zero diagram of an arbitrary IIR system whose system function is defined by Equation (1). The function must have the form pole_zero_plot(c, d) where the input vectors are defined as c = [c0, c1, . . . , cM] and d = [d0, d1, . . . , dN?1]. The function must show the poles by “×,” zeros by “?,” double poles by “+,” double zeros by “?,” triple poles by ?,” triple zeros by “•” on the complex z-plane. (Ignore the cases where more than three poles or zeros exist at the same location.) Show the vertical axis (the imaginary z axis) and the horizontal axis (the real z axis) by vertical and horizontal lines, respectively. Also plot the unit circle. Use an aspect ratio of one between the horizontal and vertical axes so that the unit circle is shown as a circle, not an ellipse. Make sure that all the poles and zeros as well as the unit circle are always shown and labeled for all systems, including the poles and zeros at z = ?, if any. To this end, the function must determine the number of poles or zeros at z = ?, and write one of the following texts at the top right corner of the z-plane figure: no poles or zeros at z = ? P poles at z = ? Z zeros at z = ? where P and Z are the number of poles and zeros at z = ?, respectively. 1 Hint: Consider the system function H(z) of the filter defined in Equation (1). The poles and zeros are indeed the roots of the polynomials in the numerator and the denominator. Then, you may use the roots function to calculate their roots corresponding to the poles and zeros. Note that there cannot be both poles and zeros (of the same order) at the same point on the z-plane because they cancel out in the system function. Also, do not forget to check for double poles and zeros before plotting them because you need to show them with different symbols, as explained above. 2) Write a MATLAB function to plot the magnitude and phase responses of an IIR system represented by Equation (1). The function must be called plot_freq_response(c, d) where c and d are defined as in Part 1. The function must create a window and plot the magnitude response ??H ? ejˆ???? at the top half and the phase response ? ? H ? ejˆ??? at the bottom half of the window. The horizontal ˆ? axis must have the range [??, ?] in both plots. The magnitude must be in linear scale (not in logarithmic or dB scale), and the phase angles must remain within the principal range (??, ?]. Make sure that the lower axis limit of ??H ? ejˆ???? is zero; that is, the magnitude range always starts from zero. 3) Use the pole_zero_plot and plot_freq_response functions to generate pole-zero plots and frequency responses of the following systems. For each system, first write the system function H(z) in the form provided in Equation (1), and explicitly explain how you obtain it. Do not forget that the highest-order coefficient in the denominator is 1 in Equation (1). Show the values of the two functions’ input vectors c and d for each system. a) y[n] = y[n ? 1] + x[n] + x[n ? 1] b) H(z) = (10z2 ? 1) z c) H(z) = ? 1 ? ? 2 2 (1 + j)z?1? ? 1 ? ? 2 2 (1 ? j)z?1? d) H(z) = z3 + 7z2 ? 5z ? 75 2z2 ? 7z + 3 e) h[n] = 1 3?[n ? 1]