Signals and Systems - Electrical Engineering

(avery) #1

704 C H A P T E R 11: Introduction to the Design of Discrete Filters


11.12. Butterworth versus Chebyshev filtering—MATLAB
If we wish to preserve low-frequency components of the input, a low-pass Butterworth filter could perform
better than a Chebyshev filter. MATLAB provides a second Chebyshev filter functioncheby2that has a
flat response in the passband and a rippled one in the stopband. Let the signal to be filtered be the first
100 samples from MATLAB’s “train” signal. To this signal add some Gaussian noise to be generated by
randn, multiply it by0.1, and add it to the 100 samples of the train signal. Design three discrete filters,
each of order 20, and a half frequency (for Butterworthbutter) and passband frequency (for the Chebyshev
filters) ofωn=0.5. For the design withcheby1let the maximum passband attenuation be0.01dB, and
for the design withcheby2let the minimum stopband attenuation be 60 dB. Obtain the three filters and
use them to filter the noisy “train” signal.
Using MATLAB plot the following for each of the three filters:
(a) Using thefftfunction compute the DFT of the original signal, the noisy signal, and the noise, and plot
their magnitudes. Is the cut-off frequency of the filters adequate to get rid of the noise? Explain.
(b) Compute and plot the magnitude and the unwrapped phase and the poles and the zeros for each of
the three filters. Comment on the differences in the magnitude responses.
(c) Use thefilterfunction to obtain the output of each of the filters, and plot the original noiseless signal
and the filtered signals. Compare them.
11.13. Butterworth, Chebyshev, and elliptic filters—MATLAB
The gain specifications of a filter are:

−0.1≤20 log 10 |H(ejω)|≤ 0 (dB) 0 ≤ω≤0.2π
20 log 10 |H(ejω)|≤− 60 (dB) 0.3π≤ω≤π

(a) Find the loss specifications for this filter.
(b) Design using MATLAB a Butterworth, a Chebyshev (usingcheby1), and an elliptic filter. Plot in one
plot the magnitude response of the three filters, and compare them and indicate which gives the
lowest order.
11.14. Notch and all-pass filters—MATLAB
Notch filters are a family of filters that include the all-pass filter. For the filter

H(z)=K
( 1 −α 1 z−^1 )( 1 +α 2 z−^1 )
( 1 −0.5z−^1 )( 1 +0.5z−^1 )

(a) Determine the values ofα 1 ,α 2 , andKthat would makeH(z)an all-pass filter of unit magnitude. Use
MATLAB to compute and plot the magnitude response ofH(z)using the obtained values forαand
K. Plot the poles and the zeros of this filter.
(b) If we would like the filterH(z)to be a notch filter of unit gain atω=π/ 2 rad, determine the values of
αandKto achieve this and then determine where the notch(es) are. Use MATLAB functions to verify
that the filter is a notch filter, and to plot the poles and the zeros.
(c) Place the zeros ofH(z)at positions between the zeros for the all-pass and the notch filters, and use
MATLAB to plot the magnitude responses. Each of these filters must have unit gain atω=π/ 2 rad.
Explain the connection between the all-pass and the notch filters.
(d) Suppose we use the transformationz−^1 =jZ−^1 to obtain a filterH(Z). Repeat the above part of the
problem forH(Z). Where are the notches of this new filter. What would be the difference between the
all-pass filtersH(z)andH(Z)?
Free download pdf