Download Understanding FIR Filters' Response to Sinusoidal and Exponential Inputs and more Slides Signal Processing and Analysis in PDF only on Docsity!
Lecture 16: Introduction to Linear time-invariant filters; response of FIR filters to sinusoidal and exponential inputs: frequency response and system function
Sections 4.2.2, 4.3, 4.4.1, 4.4.
Sections 2.2.3, 2.
- In developing the DFT, we considered discrete-time signals which are either vectors (i.e., consisted of finitely many samples) or periodic extensions thereof. We now turn our attention to general discrete- time signals, namely sequences such as - x = x[ · ]= {x[n],n ∈ Z}
- If x is a linear combination of (not necessarily periodic) sinusoids, then it also has a spectrum. Its spectrum consists of the coefficients of these sinusoids given (or plotted) as a function of frequency.
- Linear filters can be used to alter the spectra of sequences in an immediate, “real time”, fashion. A linear filter H acts as a (linear) transformation of an input sequence x to an output sequence y. (Since the input and output spaces are infinite-dimensional, this linear transformation is not represented by a finite-dimensional matrix.) - y = H (x)
- Analytically, the simplest discrete-time filter is the so-called finite impulse response (FIR) filter. At each sampling instant n, a new input sample is read in and stored in a buffer containing the M + 1 most recent input samples, i.e., x*n − M : n+. These samples are linearly combined using a fixed vector b of coefficients to produce an output sample y[n]. This procedure is described by a single formula:
- y[n]= b 0 x[n]+ b 1 x[n − 1] + ··· + bM x[n − M] ,n ∈ Z ,
- known as the filter input-output relationship.
- An FIR filter has two notable properties:
- Linearity:
- If three identical filters are used on input sequences x(1), x(2)^ and x(3)^ = c 1 x(1)^ + c 2 x(2), then the output sequence of the third filter is the same (in terms of coefficients) linear combination of the output sequences of the first two filters, i.e., y(3)^ =c 1 y(1)^ + c 2 y(2)
- Time invariance:
- If two identical filters are used on two input sequences which are time-delayed versions of each other, then the observed output sequences will also be time-delayed versions of each other (with the same delay).
- An FIR filter modifies the spectrum of an input sequence x, i.e, it changes the amounts (coefficients) of the sinusoidal components of x. To illustrate this point, we take a single complex sinusoid of frequency ω: x[n]= ejωn^ ,n ∈ Z and put it through a filter with coefficient vector b =[1 2 2 1]T^.
The output sequence y is given by yn+= xn++2xn − 1+ + 2xn − 2+ + x*n − 3+ = ejωn^ + 2ejω(n−1)^ + 2ejω(n−2)^ +ejω(n−3) = (1+2e−jω^ +2e-j2ω+e-j3ω) ejωn = (1+2e−jω^ +2e-j2ω^ +e−j3ω) · x[n]
- Thus the output is a complex sinusoid of the same frequency; the filter merely scales the input by a complex factor which depends on the frequency ω. This is true for any FIR filter.
- The scaling factor above is known as the frequency response of the filter and is denoted by H(ejω): - H(ejω) = 1+2e−jω^ +2e-j2ω+e-j3ω
- It is a polynomial in (negative) powers of ejω. The expression for H(ejω) can be simplified by noting the (non-circular) symmetry of the coefficient vector b = b0:3 = � [1 2 2 1]T about the “middle” index 3/2. Factoring out e−j3ω/2, we obtain H(ejω) = e−j3ω/2^ (ej3ω/2^ +2ejω/2^ +2e-jω/2+e-j3ω/2) = e−j3ω/2^ · (4 cos(ω/2) + 2cos(3ω/2))
- The modulus |H(ejω)| of the frequency response is known as the amplitude, or magnitude, response of the filter. In this case, noting that |ejθ| = 1, we have |H(ejω)| = |4 cos(ω/2) + 2cos(3ω/2)|
- This function of ω is symmetric about ω = π and has three zeros in the interval 0, 2π): at ω =2π/3, π and 4π/3. Thus for any of the three input sequences x(1)[ n ]=ej2πn/3^ , x(2)n+=(−1)n, x(3)[ n ]=ej4πn/3^ ,n ∈ Z,
- the filter output equals 0 for all n. By linearity, the same is true about any linear combination of these three input sequences; in particular, the sequence x[n] = cos(2πn/3+φ0).
- This means that those frequencies have been filtered from the original input
- The angle ∠H(ejω) of the frequency response is known as the phase response of the filter. In this case, recalling that ∠z 1 z 2 = ∠z 1 + ∠z 2 , we have ∠H(ejω)= −(3ω/2) + ∠ (4 cos(ω/2) + 2cos(3ω/2))
- The first term is linear in ω, while the second equals 0 or ±π, depending on whether the real number 4 cos(ω/2) + 2cos(3ω/2) is positive or negative. This means that ∠H(ejω) is piecewise linear with constant slope (= −3/2) and discontinuities of size π occurring wherever 4 cos(ω/2) + 2cos(3ω/2) changes sign, i.e., at ω =2π/3, ω = π and ω =4π/3.
- Note: The phase response ∠H(ejω) is piecewise linear for all FIR filters whose coefficients have even or odd symmetry about the middle index (M/2).
- The expression for the frequency response H(ejω) is always periodic with period (in ω) equal to 2π; as a result, H(ejω) is (automatically) periodically extended outside the interval *0, 2π).
- The amplitude response |H(ejω)| is symmetric (even) about ω = 0 and π, while the phase response ∠H(ejω) is antisymmetric (odd) about the same frequencies. This is true for all FIR filters with real-valued coefficients b 0 ,...,bM , since H(e jω)= b 0 + b 1 e-jω^ + ··· + bM e-jωM and H(e-jω)= H(ej(2π-ω))= b 0 + b 1 ejω^ + ··· + bM ejωM^ = H∗(ejω)
- (Recall that |z ∗| = |z| and ∠z* = −∠z.)
- Plotting |H(ejω)| and ∠H(ejω) requires computing H(ejω) at a sufficiently dense set of frequencies ω in *0, 2π), i.e., ω = 0, 2π/N, 4π/N ,... , 1 − 2π/N, where N >> M
- These are the Fourier frequencies for a vector of length N. Provided N ≥ M +1, the resulting vector of values of H(ejω) equals the DFT of
- [ b ; (^0) N−M−1]
Example
- The following MATLAB script computes the amplitude and phase responses of the FIR filter with input-output relationship yn+= xn++2xn − 1+ + 2xn − 2+ + x*n − 3+ at N = 512 uniformly spaced frequencies in *0, 2π).
b=1 2 2 1+.’ ; H = fft(b,512) ; A = abs(H) ; % amplitude response q = angle(H) ; % phase response w = (0: 1/512 : 1-1/512).’(2*pi) ; plot(w,A) ; plot(w,q) ;
- Similar conclusions can be drawn when the input signal is a complex exponential, i.e., x[ n ]= zn, n ∈ Z where z is an arbitrary complex number. Using the same filter as previously, we have, for all n, n−2 (^) + z n− y[n]= zn^ +2zn−1^ + 2zn−2^ + zn− = (1+2z−1^ +2z−2^ + z−3) zn = (1+2z−1^ +2z−2^ + z−3) x[n]
- The complex scaling factor H( z ) = 1+2z−1^ +2z−2^ + z− is known as the system function of the filter. The frequency response H(ejω) of an FIR filter is the restriction of its system function to the unit circle z = ejω.