Chapter 5 THE APPLICATION OF THE Z TRANSFORM 5.6 Transfer Functions for Digital Filters 5.7 Amplitude and Delay Distortion c 2005- Andreas Antoniou Copyright Victoria, BC, Canada Email: aantoniou@ieee.org March 7, 2008 Frame # 1 Slide # 1 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Introduction Previous presentations dealt with the frequency response of discrete-time systems, which is obtained by using the transfer function. Frame # 2 Slide # 2 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Introduction Previous presentations dealt with the frequency response of discrete-time systems, which is obtained by using the transfer function. In this presentation, we examine some of the basic types of transfer functions that characterize some typical firstand second-order filter types known as biquads. Frame # 2 Slide # 3 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Introduction Previous presentations dealt with the frequency response of discrete-time systems, which is obtained by using the transfer function. In this presentation, we examine some of the basic types of transfer functions that characterize some typical firstand second-order filter types known as biquads. Biquads are often used as basic digital-filter blocks to construct high-order filters. Frame # 2 Slide # 4 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 First-Order Transfer Functions A first-order transfer function can have only a real zero and a real pole, i.e., z − z0 H(z) = z − p0 Frame # 3 Slide # 5 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 First-Order Transfer Functions A first-order transfer function can have only a real zero and a real pole, i.e., z − z0 H(z) = z − p0 To ensure that the system is stable, the pole must satisfy the condition −1 < p0 < 1. Frame # 3 Slide # 6 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 First-Order Transfer Functions A first-order transfer function can have only a real zero and a real pole, i.e., z − z0 H(z) = z − p0 To ensure that the system is stable, the pole must satisfy the condition −1 < p0 < 1. The zero can be anywhere on the real axis of the z plane. Frame # 3 Slide # 7 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 First-Order Transfer Functions Cont’d 2 2 1 1 jIm z jIm z If the pole is close to point (1, 0) and the zero is close to or at point (−1, 0), then we have a lowpass filter. 0 −1 −2 −2 Frame # 4 Slide # 8 0 −1 −1 0 Re z 1 2 A. Antoniou −2 −2 −1 0 Re z 1 Digital Signal Processing – Secs. 5.6 and 5.7 2 First-Order Transfer Functions Cont’d 2 2 1 1 jIm z jIm z If the pole is close to point (1, 0) and the zero is close to or at point (−1, 0), then we have a lowpass filter. If the zero and pole positions are interchanged, then we get a highpass filter. 0 −1 −2 −2 Frame # 4 Slide # 9 0 −1 −1 0 Re z 1 2 A. Antoniou −2 −2 −1 0 Re z 1 Digital Signal Processing – Secs. 5.6 and 5.7 2 First-Order Transfer Functions Cont’d Certain applications require discrete-time systems that have a constant amplitude response and a varying phase response. Such systems can be constructed by using allpass transfer functions. Frame # 5 Slide # 10 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 First-Order Transfer Functions Cont’d Certain applications require discrete-time systems that have a constant amplitude response and a varying phase response. Such systems can be constructed by using allpass transfer functions. A first-order allpass transfer function is of the form H(z) = z − 1/p0 p0 z − 1 = p0 z − p0 z − p0 where the zero is the reciprocal of the pole. Frame # 5 Slide # 11 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 First-Order Transfer Functions Cont’d Certain applications require discrete-time systems that have a constant amplitude response and a varying phase response. Such systems can be constructed by using allpass transfer functions. A first-order allpass transfer function is of the form H(z) = z − 1/p0 p0 z − 1 = p0 z − p0 z − p0 where the zero is the reciprocal of the pole. The frequency response of a system characterized by H(z) is given by H(ejωT ) = Frame # 5 Slide # 12 p0 ejωT − 1 p0 cos ωT + jp0 sin ωT − 1 = jωT e − p0 cos ωT + j sin ωT − p0 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 First-Order Transfer Functions Cont’d ··· H(ejωT ) = p0 ejωT − 1 p0 cos ωT + jp0 sin ωT − 1 = cos ωT + j sin ωT − p0 ejωT − p0 The amplitude and phase responses are given by p0 cos ωT − 1 + jp0 sin ωT M(ω) = cos ωT − p0 + j sin ωT 1 (p0 cos ωT − 1)2 + (p0 sin ωT )2 2 =1 = (cos ωT − p0 )2 + (sin ωT )2 and θ (ω) = tan−1 p0 sin ωT sin ωT − tan−1 p0 cos ωT − 1 cos ωT − p0 respectively. Frame # 6 Slide # 13 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Lowpass Biquad A lowpass second-order transfer function can be constructed by placing a complex-conjugate pair of poles anywhere inside the unit circle and a pair of zeros at the Nyquist point: 2 jIm z 1 0 −1 −2 −2 Frame # 7 Slide # 14 −1 A. Antoniou 0 Re z 1 2 Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Lowpass Biquad Cont’d The transfer function of the lowpass biquad assumes the form: HLP (z) = z 2 + 2z + 1 (z + 1)2 = (z − rejφ )(z − re−jφ ) z 2 − 2r (cos φ)z + r 2 where 0 < r < 1. Frame # 8 Slide # 15 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Lowpass Biquad Cont’d As the poles move closer to the unit circle, the amplitude response develops a peak at frequency ω = φ/T while the slope of the phase response tends to become steeper and steeper at that frequency. 50 0 40 − 0.5 r = 0.99 r = 0.99 30 Phase shift, rad −1.0 Gain, dB 20 10 r = 0.50 0 −2.0 −3.0 −20 Frame # 9 Slide # 16 −1.5 −2.5 −10 −30 r = 0.50 0 5 Frequency, rad/s 10 A. Antoniou −3.5 0 5 Frequency, rad/s 10 Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Highpass Biquad A highpass second-order transfer function can be constructed by placing a complex-conjugate pair of poles anywhere inside the unit circle and a pair of zeros at point (1, 0): 2 jIm z 1 0 −1 −2 −2 Frame # 10 Slide # 17 −1 A. Antoniou 0 Re z 1 2 Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Highpass Biquad Cont’d The transfer function of the highpass biquad assumes the form: HHP (z) = (z − 1)2 (z 2 − 2z + 1) = z 2 − 2r (cos φ)z + r 2 z 2 − 2r (cos φ)z + r 2 where 0 < r < 1. Frame # 11 Slide # 18 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Highpass Biquad Cont’d As the poles move closer to the unit circle, the amplitude response develops a peak at frequency ω = φ/T while the slope of the phase response tends to become steeper and steeper at that frequency. 50 3.5 40 3.0 30 Phase shift, rad 2.5 Gain, dB 20 10 r = 0.50 0 1.5 0.5 −20 Frame # 12 Slide # 19 r = 0.50 2.0 1.0 −10 −30 r = 0.99 r = 0.99 0 0 5 Frequency, rad/s 10 A. Antoniou 0 5 Frequency, rad/s 10 Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Bandpass Biquad A bandpass second-order transfer function can be constructed by placing a complex-conjugate pair of poles anywhere inside the unit circle, zeros at points (-1, 0) and (1, 0): 2 jIm z 1 0 −1 −2 −2 Frame # 13 Slide # 20 −1 A. Antoniou 0 Re z 1 2 Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Bandpass Biquad Cont’d The transfer function of the bandpass biquad assumes the form: HBP (z) = z2 (z + 1)(z − 1) − 2r (cos φ)z + r 2 where 0 < r < 1. Frame # 14 Slide # 21 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Bandpass Biquad Cont’d As the poles move closer to the unit circle, the amplitude response develops a peak at frequency ω = φ/T while the slope of the phase response tends to become steeper and steeper at that frequency. 40 2 r = 0.99 30 r = 0.99 1 Phase shift, rad Gain, dB 20 10 r = 0.50 0 −10 r = 0.50 0 −1 −20 −30 Frame # 15 Slide # 22 0 5 Frequency, rad/s 10 A. Antoniou −2 0 5 Frequency, rad/s 10 Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Notch Biquad A notch second-order transfer function can be constructed by placing a complex-conjugate pair of poles anywhere inside the unit circle, and a complex-conjugate pair of zeros on the unit circle. jIm z There are three possibilities: 1 1 1 0 0 0 −1 −1 −1 −1 0 1 −1 0 1 −1 0 Re z Frame # 16 Slide # 23 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 1 Second-Order Notch Biquad Cont’d The transfer function of the bandpass biquad assumes the form: HN (z) = z 2 − 2(cos ψ)z + 1 z 2 − 2r (cos φ)z + r 2 where 0 < r < 1. Frame # 17 Slide # 24 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Notch Biquad Cont’d If ψ = π/4, ψ = π/2, or ψ = 3π/4, the notch filter behaves as a highpass, bandstop, or lowpass filter. 30 4 ψ = π/4 ψ = π/2 ψ = 3π/4 3 20 2 Phase shift, rad Gain, dB 10 0 −10 1 0 −1 −2 −20 −30 Frame # 18 Slide # 25 −3 0 5 Frequency, rad/s 10 A. Antoniou −4 0 5 Frequency, rad/s 10 Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Allpas Biquad An allpass second-order transfer function can be constructed by placing a complex-conjugate pair of poles anywhere inside the unit circle and a complex-conjugate pair of zeros that are the reciprocals of the poles outside the unit circle. 2 jIm z 1 0 −1 −2 −2 Frame # 19 Slide # 26 −1 A. Antoniou 0 Re z 1 2 Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Allpass Biquad Cont’d The transfer function of the bandpass biquad assumes the form: HAP (z) = r 2 z 2 − 2r (cos φ)z + 1 z 2 − 2r (cos φ)z + r 2 where 0 < r < 1. Frame # 20 Slide # 27 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Allpass Biquad Cont’d The transfer function of the bandpass biquad assumes the form: HAP (z) = r 2 z 2 − 2r (cos φ)z + 1 z 2 − 2r (cos φ)z + r 2 where 0 < r < 1. We note that the numerator coefficients are the same as the denominator coefficients but in the reverse order. Frame # 20 Slide # 28 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Allpass Biquad Cont’d The transfer function of the bandpass biquad assumes the form: HAP (z) = r 2 z 2 − 2r (cos φ)z + 1 z 2 − 2r (cos φ)z + r 2 where 0 < r < 1. We note that the numerator coefficients are the same as the denominator coefficients but in the reverse order. The above is a general property, that is, an arbitrary transfer function with the above coefficient symmetry is an allpass transfer function independently of the order. Frame # 20 Slide # 29 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Second-Order Allpass Biquad Cont’d MAP (ω) = |HAP (e jωT )| = HAP (e jωT 1 ∗ jωT 2 ) · HAP (e ) 1 = HAP (ejωT ) · HAP (e−jωT ) 2 = HAP (z) · HAP (z −1 ) = = 1 2 z=ejωT r 2 z 2 + 2r (cos φ)z + 1 r 2 z −2 + 2r (cos φ)z −1 + 1 · −2 z 2 + 2r (cos φ)z + r 2 z + 2r (cos φ)z −1 + r 2 r 2 z 2 + 2r (cos φ)z + 1 r 2 + 2r (cos φ)z + z 2 · z 2 + 2r (cos φ)z + r 2 1 + 2r (cos φ)z + z 2 r 2 Frame # 21 Slide # 30 A. Antoniou 1 2 z=ejωT 1 2 =1 z=ejωT Digital Signal Processing – Secs. 5.6 and 5.7 High-Order Filters Cont’d Higher-order transfer functions can be obtained by forming products or sums of first- and/or second-order transfer functions. Frame # 22 Slide # 31 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 High-Order Filters Cont’d Higher-order transfer functions can be obtained by forming products or sums of first- and/or second-order transfer functions. Corresponding high-order filters can be constructed by connecting several biquads in cascade or in parallel. Frame # 22 Slide # 32 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 High-Order Filters Cont’d Higher-order transfer functions can be obtained by forming products or sums of first- and/or second-order transfer functions. Corresponding high-order filters can be constructed by connecting several biquads in cascade or in parallel. Methods for obtaining transfer functions that will yield specified frequency responses will be explored in later chapters. Frame # 22 Slide # 33 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion In practice, a discrete-time system can distort the information content of a signal to be processed. Frame # 23 Slide # 34 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion In practice, a discrete-time system can distort the information content of a signal to be processed. Two types of distortion can be introduced as follows: Frame # 23 Slide # 35 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion In practice, a discrete-time system can distort the information content of a signal to be processed. Two types of distortion can be introduced as follows: – Amplitude distortion Frame # 23 Slide # 36 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion In practice, a discrete-time system can distort the information content of a signal to be processed. Two types of distortion can be introduced as follows: – Amplitude distortion – Delay (or phase) distortion Frame # 23 Slide # 37 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d Consider an application where a digital filter characterized by a transfer function H(z) is to be used to select a specific signal xk (nT ) from a sum of signals x (nT ) = m xi (nT ) i=1 Frame # 24 Slide # 38 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d Consider an application where a digital filter characterized by a transfer function H(z) is to be used to select a specific signal xk (nT ) from a sum of signals x (nT ) = m xi (nT ) i=1 Let the amplitude and phase responses of the filter be M(ω) and θ (ω), respectively. Frame # 24 Slide # 39 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d Consider an application where a digital filter characterized by a transfer function H(z) is to be used to select a specific signal xk (nT ) from a sum of signals x (nT ) = m xi (nT ) i=1 Let the amplitude and phase responses of the filter be M(ω) and θ (ω), respectively. Two parameters associated with the phase response are the absolute delay τa (ω) and the group delay τg (ω) which are defined as τa (ω) = − Frame # 24 Slide # 40 θ (ω) ω A. Antoniou and τg (ω) = − dθ (ω) dω Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d Consider an application where a digital filter characterized by a transfer function H(z) is to be used to select a specific signal xk (nT ) from a sum of signals x (nT ) = m xi (nT ) i=1 Let the amplitude and phase responses of the filter be M(ω) and θ (ω), respectively. Two parameters associated with the phase response are the absolute delay τa (ω) and the group delay τg (ω) which are defined as τa (ω) = − θ (ω) ω and τg (ω) = − dθ (ω) dω As functions of frequency, τa (ω) and τg (ω) are known as the absolute-delay and group-delay characteristics. Frame # 24 Slide # 41 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d Now assume that the amplitude spectrum of signal xk (nT ) is concentrated in frequency band B given by B = {ω : ωL ≤ ω ≤ ωH } as shown. |Xk(ejωT)| |X(ejωT)| ωL Frame # 25 Slide # 42 A. Antoniou B ωH ω Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d Now assume that the amplitude spectrum of signal xk (nT ) is concentrated in frequency band B given by B = {ω : ωL ≤ ω ≤ ωH } as shown. Also assume that the filter has amplitude and phase responses G0 for ω ∈ B M(ω) = and θ (ω) = −τg ω + θ0 for ω ∈ B 0 otherwise respectively, where G0 and τg are constants. |Xk(ejωT)| |X(ejωT)| ωL Frame # 25 Slide # 43 A. Antoniou B ωH ω Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d The z transform of the output of the filter is given by Y (z) = H(z)X (z) = H(z) m i=1 Frame # 26 Slide # 44 A. Antoniou Xi (z) = m H(z)Xi (z) i=1 Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d The z transform of the output of the filter is given by Y (z) = H(z)X (z) = H(z) m i=1 Xi (z) = m H(z)Xi (z) i=1 Thus the frequency spectrum of the output signal is obtained as Y (ejωT ) = m H(ejωT )Xi (ejωT ) i=1 = m M(ω)ejθ(ω) Xi (ejωT ) i=1 Frame # 26 Slide # 45 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d ··· Y (ejωT ) = m M(ω)ejθ(ω) Xi (ejωT ) i=1 We have assumed that G0 for ω ∈ B M(ω) = 0 otherwise and θ(ω) = −τg ω+θ0 for ω ∈ B and hence we get Y (ejωT ) = G0 e−jωτg +jθ0 Xk (ejωT ) since all signal spectrums except Xk (ejωT ) will be multiplied by zero. Frame # 27 Slide # 46 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d ··· Y (ejωT ) = G0 e−jωτg +jθ0 Xk (ejωT ) If we now let τg = mT where m is a constant, we can write Y (z) = G0 ejθ0 z −m Xk (z) Frame # 28 Slide # 47 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d ··· Y (ejωT ) = G0 e−jωτg +jθ0 Xk (ejωT ) If we now let τg = mT where m is a constant, we can write Y (z) = G0 ejθ0 z −m Xk (z) Therefore, from the time-shifting theorem of the z transform, we deduce the output of the filter as y (nT ) = G0 ejθ0 xk (nT − mT ) Frame # 28 Slide # 48 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d ··· Y (ejωT ) = G0 e−jωτg +jθ0 Xk (ejωT ) If we now let τg = mT where m is a constant, we can write Y (z) = G0 ejθ0 z −m Xk (z) Therefore, from the time-shifting theorem of the z transform, we deduce the output of the filter as y (nT ) = G0 ejθ0 xk (nT − mT ) In effect, if the amplitude response of the filter is constant with respect to frequency band B and zero elsewhere and its phase response is a linear function of ω, that is, the group delay is constant in frequency band B, then the output signal is a delayed replica of signal xk (nT ) except that a constant multiplier G0 ejθ0 is introduced. Frame # 28 Slide # 49 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d If the amplitude response of the system is not constant in frequency band B, then so-called amplitude distortion will be introduced since different frequency components of the signal will be amplified by different amounts. Frame # 29 Slide # 50 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d If the amplitude response of the system is not constant in frequency band B, then so-called amplitude distortion will be introduced since different frequency components of the signal will be amplified by different amounts. If the group delay is not constant in band B, different frequency components will be delayed by different amounts, and delay (or phase) distortion will be introduced. Frame # 29 Slide # 51 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 Amplitude and Delay Distortion Cont’d Amplitude distortion can be quite objectionable in practice. Consequently, the amplitude response is required to be flat to within a prescribed tolerance in each frequency band that carries information. If the ultimate receiver of the signal is the human ear, e.g., when a speech or music signal is to be processed, delay distortion turns out to be quite tolerable. In other applications where images are involved, e.g., transmission of video signals, delay distortion can be as objectionable as amplitude distortion, and the delay characteristic is required to be fairly flat. Frame # 30 Slide # 52 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7 This slide concludes the presentation. Thank you for your attention. Frame # 31 Slide # 53 A. Antoniou Digital Signal Processing – Secs. 5.6 and 5.7