Lecture XII: Ideal filters Maxim Raginsky BME 171: Signals and Systems Duke University October 29, 2008 Maxim Raginsky Lecture XII: Ideal filters This lecture Plan for the lecture: 1 LTI systems with sinusoidal inputs 2 Analog filtering frequency-domain description: passband, stopband amplitude and phase response of ideal filters time-domain description 3 Detailed example: ideal lowpass filter 4 Nonideal filters Maxim Raginsky Lecture XII: Ideal filters LTI systems with sinusoidal inputs Consider an LTI system with impulse response h(t): x(t) h(t) y(t) LTI y(t) = x(t) ⋆ h(t) = ∞ Z x(t − λ)h(λ)dλ −∞ In the frequency domain we have Y (ω) = H(ω)X(ω), where X(ω) = F [x(t)], H(ω) = F [h(t)], Y (ω) = F [y(t)]. Consider a sinusoidal input of the form x(t) = A cos(ω0 t + θ0 ), where A is the amplitude, ω0 is the frequency, and θ0 is the phase. Maxim Raginsky Lecture XII: Ideal filters LTI systems with sinusoidal inputs x(t) = X(ω) = Y (ω) = = = = A cos(ω0 t + θ0 ) πA e−jθ0 δ(ω + ω0 ) + ejθ0 δ(ω − ω0 ) H(ω)X(ω) πA e−jθ0 H(ω)δ(ω + ω0 ) + ejθ0 H(ω)δ(ω − ω0 ) πA e−jθ0 H(−ω0 )δ(ω + ω0 ) + ejθ0 H(ω0 )δ(ω − ω0 ) h πA e−j(θ0 +∠H(ω0 )) |H(ω0 )|δ(ω + ω0 ) i +ej(θ0 +∠H(ω0 )) |H(ω0 )|δ(ω − ω0 ) y(t) = = F −1 [Y (ω)] A|H(ω0 )| cos(ω0 t + θ0 + ∠H(ω0 )) Thus, the action of the LTI system with impulse response h(t) on a sinusoid with amplitude A, frequency ω0 and phase θ0 is to transform the amplitude as A → A|H(ω0 )| and the phase as θ0 → θ0 + ∠H(ω0 ). Maxim Raginsky Lecture XII: Ideal filters LTI systems with sinusoidal inputs Many signals encountered in practice are finite sums of sinusoids: x(t) = N X Ak cos(ωk t + θk ) k=1 The action of an LTI system with impulse response h(t) on such an input is, by linearity, given by y(t) = N X Ak |H(ωk )| cos(ωk t + θk + ∠H(ωk )) k=1 k Thus, an LTI system changes the amplitude ratios A Al and the relative phases θk − θl among the different frequency components k, l = 1, . . . , N : Ak Al θk − θl Ak H(ωk ) · Al H(ωl ) → θk − θl + ∠H(ωk ) − ∠H(ωl ) → Maxim Raginsky Lecture XII: Ideal filters Analog filtering These considerations naturally lead us to the notion of filtering: processing of signals in order to enhance certain frequency components and to reject certain others. For example, if a signal consists of a low-frequency information-bearing portion and a high-frequency noise portion, we can employ a filter to reject the high frequencies and thus remove the noise. We will look at four kinds of filters: 1 low-pass filters pass all frequencies in the range |ω| ≤ B, for some B > 0 and reject all others 2 high-pass filters pass all frequencies in the range |ω| ≥ B, for some B > 0 and reject all others 3 bandpass filters pass all frequencies in the range B1 ≤ |ω| ≤ B2 for some B1 , B2 > 0 with B1 < B2 and reject all others 4 bandstop filters pass all frequencies in the range |ω| ≤ B1 and |ω| ≥ B2 for some B1 , B2 > 0 with B1 < B2 and reject all others Maxim Raginsky Lecture XII: Ideal filters Analog filtering: frequency domain description It is convenient to look at filters in the frequency domain. For each of the four kinds of filters, we will specify the amplitude response |H(ω)| and the phase response ∠H(ω). We start with the amplitude response. For the four filters we have defined above we have: |HLP(ω)| 1 -B B 0 |HHP(ω)| 1 ω -B lowpass |HBP(ω)| -B1 0 B1 ω highpass |HBS(ω)| 1 1 -B2 B 0 B2 ω bandpass Maxim Raginsky -B2 -B1 0 B1 bandstop Lecture XII: Ideal filters B2 ω Some filtering terminology Given a filter H(ω), the set of frequencies ω such that |H(ω)| > 0 is called the passband of the filter; the set of frequencies ω such that |H(ω)| = 0 is called the stopband of the filter. filter lowpass highpass bandpass bandstop passband |ω| ≤ B |ω| ≥ B B1 ≤ |ω| ≤ B2 |ω| ≤ B1 and |ω| ≥ B2 stopband |ω| > B |ω| < B |ω| < B1 and |ω| > B2 B1 < |ω| < B2 If the input to a filter is a sinusoid A cos(ω0 t + θ0 ), then the amplitude of the output will be equal to: A, if the frequency ω0 is in the passband of the filter 0, if the frequency ω0 is in the stopband of the filter Maxim Raginsky Lecture XII: Ideal filters Ideal filters Next, we need to specify the phase response ∠H(ω) of the filter. We will call a filter H(ω) ideal if 1, if ω is in the passband |H(ω)| = 0, if ω is in the stopband and ∠H(ω) = −ωtd , if ω is in the passband 0, if ω is in the stopband where td > 0 is some constant. The reason for calling such filters “ideal” will become clear shortly. Maxim Raginsky Lecture XII: Ideal filters Phase response of ideal filters ∠HLP(ω) ∠HHP(ω) Btd Btd -B B 0 ω -B -Btd -B1td -B2td ω -Btd lowpass -B1 -B2 B 0 highpass ∠HBP(ω) ∠HBS(ω) B2td B1td B2td B1td 0 B1 B2 ω bandpass Maxim Raginsky -B1 -B2 0 -B1td -B2td B1 B2 ω bandstop Lecture XII: Ideal filters Ideal filters with sinusoidal inputs Let’s see what happens when we feed a sinusoidal signal x(t) = A cos(ω0 t + θ0 ) into an ideal filter H(ω). We have already seen that the output will be y(t) = A|H(ω0 )| cos(ω0 t + θ + ∠H(ω0 )). Since |H(ω)| = 1 when ω is in the passband and 0 when ω is in the stopband, while ∠H(ω) = −ωtd when ω is in the passband and 0 otherwise, we can further write A cos(ω0 (t − td ) + θ0 ), if ω0 is in the passband y(t) = 0, if ω0 is in the stopband In other words, if the frequency of the sinusoid ω0 is in the passband of the filter, then the output y(t) of the filter is a time-delayed version of the input x(t): y(t) = x(t − td ). Maxim Raginsky Lecture XII: Ideal filters Ideal filters with sinusoidal inputs This explains why we use the term “ideal:” an ideal filter does not distort the input signal, only delays it (provided the input frequency is in the passband). We can generalize these results to periodic signals that can be represented by sums of sinusoids, x(t) = ∞ X Ak cos(ωk t + θt ), k=1 as well as to aperiodic signals that have a Fourier transform, x(t) ↔ X(ω). In the latter case, it is convenient to visualize the action of the filter in the frequency domain. Maxim Raginsky Lecture XII: Ideal filters Detailed example: ideal lowpass filter Let us consider in detail the lowpass filter whose amplitude and phase response are given by |HLP (ω)| = p2B (ω) and ∠HLP (ω) = −ωtd p2B (ω), where p2B (ω) is a rectangle of unit height and width 2B centered at ω = 0. We have HLP (ω) = e−jωtd p2B (ω), so that the impulse response has the form B B (t − td ) hLP (t) = F −1 e−jωtd p2B (ω) = sinc π π Note that the frequency response HLP (ω) is bandlimited, hence the impulse response hLP (t) cannot be timelimited. This implies that an ideal lowpass filter is acausal and therefore cannot be operated in real time. Maxim Raginsky Lecture XII: Ideal filters Nonideal filters In fact, it can be shown that any ideal filter is necessarily acausal, and therefore cannot be operated in real time. In practice, we have to resort to causal approximations of ideal filters. For example, an ideal lowpass filter can be approximated by an RC filter whose frequency response is described by 1 |HRC (ω)| = p (ωRC)2 + 1 and ∠HRC (ω) = tan−1 (−ωRC) 1 -B 0 -B 0 Maxim Raginsky ω B B ω Lecture XII: Ideal filters