UNIVERSITY OF TORONTO Department of Electrical and Computer Engineering ECE356S Spring 1999 Problem Set #7

Due: March 25, 1999

1. (a) In our discussion of digital filters, we often consider noncausal filters of the form

y_{n} = ∑_{k=−N}^{N} c_{k}u_{n−k}  (1.1)

Such a filter can be made causal by changing the output to

z_{n} = ∑_{k=−N}^{N} c_{k}u_{n−N−k}  (1.2)

How are the magnitude and phase of the frequency response of the filter given in (1.2) related to that given in (1.1)?

(b) Part (a) shows that causal filters will generally have nonzero phase. This part shows that you can obtain a filter with zero phase if the processing need not be carried out in real time. Two methods are given. h_{k} denotes the impulse response of the filter H(z).

Method 1:

(i)

h_{k} i.e. w_{k} = ∑ h_{j}u_{k−j} u_{k}  w_{k}

(ii)

w_{−k}  h_{k}  r_{k}

(iii) y_{k} = r_{−k}. Show that the overall frequency response H_{1}(e^{iω}) from u_{k} to y_{u} has zero phase. Determine H_{1}(e^{iω}) in terms of H(e^{iω}) and h_{1}(k) in terms of h_{k}.

Method 2:

(i)

u_{k}  h_{k}  w_{k}

(ii)

u_{−k}  h_{k}  r_{k}

(iii) y_{k} = w_{k} + r_{−k}. Denote the frequency response from u_{k} to y_{k} in method 2 by H_{2}(e^{iω}). Determine H_{2}(e^{iω}) in terms of H(e^{iω}) and again show that it has zero phase. Determine also h_{2}(k) in terms of h_{k}.

2. This problem shows how you can get a high pass filter from a low pass filter. Suppose we want to synthesize the ideal high pass filter

H(f) = 0 |f| < \frac{1}{2} − Δ
= 1 |f| ≥ \frac{1}{2} − Δ

Let H_{L}(f) have the ideal low pass filter characteristic

H_{L}(f) = 1 |f| ≤ Δ
= 0 |f| > Δ

Verify that H(f) = H_{L}(\frac{1}{2} − f). Determine the high pass filter coefficients h_{k} in terms of the low pass filter coefficients h_{L}(k). Furthermore, show that H(f) may be implemented as follows (⨂ denotes multiplication):

u_{k}  (−1)^{k}  H_{L}(f)  (−1)^{k} y_{k}

3. The basic digital filter design problem is to design a low pass filter to satisfy given performance specifications. This problem looks at using different approaches to designing an approximation to an ideal low pass filter with the following frequency response: H_{d}(ω) = 1, |ω| ≤ \frac{π}{2}, H_{d}(ω) = 0, |ω| > \frac{π}{2}. Since it is usually more convenient to work with f = \frac{ω}{2π}, we want H̃_{d}(f) = 1, |f| ≤ \frac{1}{4}, H̃_{d}(f) = 0, |f| > \frac{1}{4}. You should do your calculations using MATLAB.

(a) Suppose we use a filter of the form H(ω) = ∑_{k=−N}^{N} c_{k}e^{−iωk}. Because we require

H(ω) = H(−ω), c_{k} = c_{−k}. Thus H(ω) = c_{0} + ∑_{k=1}^{N} 2c_{k} cos ωk. As a first attempt,

we can try to determine the coefficients c_{k} by specifying N + 1 values of H̃(f) at N + 1 frequency points. Take

(i) \begin{matrix}f & 0 & 0.1 & 0.2 & 0.4 & 0.5 \\ H̃(f) & 1 & 1 & 1 & 0 & 0 \end{matrix}

Determine the coefficients c_{k}, 0 ≤ k ≤ N and plot the resulting frequency response H̃(f). What is the maximum amplitude of the ripple in the stop band? Repeat your calculations for the following two sets of specs:

(ii) \begin{matrix}f & 0 & .05 & .1 & .15 & .17 & .2 & .22 & .25 & .3 & .4 & .5 \\ H̃(f) & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 \end{matrix}

(iii) \begin{matrix}f & 0 & .05 & .1 & .15 & .17 & .2 & .3 & .35 & .4 & .45 & .5 \\ H̃(f) & 1 & 1 & 1 & 1 & 1 & 1 & 0 & 0 & 0 & 0 & 0 \end{matrix}

Are there significant differences in the frequency response of the filters? What conclusions can you draw?

(b) The way in which the filter processes the input can be illustrated by using u_{k} = cos 2πfk, with f chosen to be passed or stopped by the filter. For the first filter designed (specs (i)) take f = 0.1 and 0.3, and 0.4. Determine the outputs for these cases. You need to have a long enough input sequence to allow the full filter to operate.

(c) We now investigate the design based on Fourier techniques. First obtain the

Fourier series expansion for H̃_{d}(f) = ∑_{k=−∞}^{∞} c_{k}e^{−i2πfk}. Take N = 4, and use the

Hamming window to design your low pass digital filter. Plot the frequency response of your digital low pass filter and compare it to those in part (a).