Digital Signal Processing. The Scientist and Engineers Guide. Steven W. Smith
.pdf
328 |
The Scientist and Engineer's Guide to Digital Signal Processing |
Phase Response
There are three types of phase response that a filter can have: zero phase, linear phase, and nonlinear phase. An example of each of these is shown in Figure 19-7. As shown in (a), the zero phase filter is characterized by an impulse response that is symmetrical around sample zero. The actual shape doesn't matter, only that the negative numbered samples are a mirror image of the positive numbered samples. When the Fourier transform is taken of this symmetrical waveform, the phase will be entirely zero, as shown in (b).
The disadvantage of the zero phase filter is that it requires the use of negative indexes, which can be inconvenient to work with. The linear phase filter is a way around this. The impulse response in (d) is identical to that shown in (a), except it has been shifted to use only positive numbered samples. The impulse response is still symmetrical between the left and right; however, the location of symmetry has been shifted from zero. This shift results in the phase, (e), being a straight line, accounting for the name: linear phase. The slope of this straight line is directly proportional to the amount of the shift. Since the shift in the impulse response does nothing but produce an identical shift in the output signal, the linear phase filter is equivalent to the zero phase filter for most purposes.
Figure (g) shows an impulse response that is not symmetrical between the left and right. Correspondingly, the phase, (h), is not a straight line. In other words, it has a nonlinear phase. Don't confuse the terms: nonlinear and linear phase with the concept of system linearity discussed in Chapter 5. Although both use the word linear, they are not related.
Why does anyone care if the phase is linear or not? Figures (c), (f), and (i) show the answer. These are the pulse responses of each of the three filters. The pulse response is nothing more than a positive going step response followed by a negative going step response. The pulse response is used here because it displays what happens to both the rising and falling edges in a signal. Here is the important part: zero and linear phase filters have left and right edges that look the same, while nonlinear phase filters have left and right edges that look different. Many applications cannot tolerate the left and right edges looking different. One example is the display of an oscilloscope, where this difference could be misinterpreted as a feature of the signal being measured. Another example is in video processing. Can you imagine turning on your TV to find the left ear of your favorite actor looking different from his right ear?
It is easy to make an FIR (finite impulse response) filter have a linear phase. This is because the impulse response (filter kernel) is directly specified in the design process. Making the filter kernel have left-right symmetry is all that is required. This is not the case with IIR (recursive) filters, since the recursion coefficients are what is specified, not the impulse response. The impulse response of a recursive filter is not symmetrical between the left and right, and therefore has a nonlinear phase.
Chapter 19Recursive Filters |
329 |
|
Zero Phase Filter |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
0.25 |
|
|
|
|
12 |
|
|
|
|
|
|
2.0 |
|
|
|
|
|
|
0.20 |
a. Impulse response |
|
|
8 |
b. Phase |
|
|
|
|
1.5 |
c. Pulse response |
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Amplitude |
0.15 |
|
|
|
(radians)Phase |
4 |
|
|
|
|
|
Amplitude |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.0 |
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
0.10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0.05 |
|
|
|
|
|
|
|
|
|
|
|
0.5 |
|
|
|
|
|
|
|
|
|
|
|
-4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
0.00 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-0.05 |
|
|
|
|
-8 |
|
|
|
|
|
|
0.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-0.10 |
|
|
|
|
-12 |
|
|
|
|
|
|
-0.5 |
|
|
|
|
|
|
-25 |
0 |
25 |
50 |
|
0 |
0.1 |
0.2 |
0.3 |
0.4 |
0.5 |
|
-25 |
0 |
25 |
50 |
75 |
100 |
|
|
Sample number |
|
|
|
|
Frequency |
|
|
|
|
|
Sample number |
|
|
|||
|
Linear Phase Filter |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
0.25 |
|
|
|
|
96 |
|
|
|
|
|
|
2.0 |
|
|
|
|
|
|
0.20 |
d. Impulse response |
|
|
64 |
e. Phase |
|
|
|
|
1.5 |
f. Pulse response |
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Amplitude |
0.15 |
|
|
|
(radians)Phase |
-32 |
|
|
|
|
|
Amplitude |
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
|
|
|
|
|
1.0 |
|
|
|
|
|
|
0.10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0.05 |
|
|
|
|
|
|
|
|
|
|
|
0.5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0.00 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-0.05 |
|
|
|
|
-64 |
|
|
|
|
|
|
0.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-0.10 |
|
|
|
|
-96 |
|
|
|
|
|
|
-0.5 |
|
|
|
|
|
|
-25 |
0 |
25 |
50 |
|
0 |
0.1 |
0.2 |
0.3 |
0.4 |
0.5 |
|
-25 |
0 |
25 |
50 |
75 |
100 |
|
|
Sample number |
|
|
|
|
Frequency |
|
|
|
|
|
Sample number |
|
|
|||
Nonlinear Phase Filter
|
0.25 |
|
|
|
|
12 |
|
|
|
|
|
|
2.0 |
|
|
|
|
|
|
0.20 |
g. Impulse response |
|
|
8 |
h. Phase |
|
|
|
|
1.5 |
i. Pulse response |
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
0.15 |
|
|
|
Phase (radians) |
4 |
|
|
|
|
|
|
|
|
|
|
|
|
Amplitude |
|
|
|
|
|
|
|
|
|
Amplitude |
1.0 |
|
|
|
|
|
||
0.10 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
0 |
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
0.05 |
|
|
|
|
|
|
|
|
|
0.5 |
|
|
|
|
|
|||
|
|
|
|
-4 |
|
|
|
|
|
|
|
|
|
|
||||
0.00 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-0.05 |
|
|
|
|
-8 |
|
|
|
|
|
|
0.0 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-0.10 |
|
|
|
|
-12 |
|
|
|
|
|
|
-0.5 |
|
|
|
|
|
|
-25 |
0 |
25 |
50 |
|
0 |
0.1 |
0.2 |
0.3 |
0.4 |
0.5 |
|
-25 |
0 |
25 |
50 |
75 |
100 |
|
|
Sample number |
|
|
|
|
Frequency |
|
|
|
|
|
Sample number |
|
|
|||
FIGURE 19-7
Zero, linear, and nonlinear phase filters. A zero phase filter has an impulse response that has left-right symmetry around sample number zero, as in (a). This results in a frequency response that has a phase composed entirely of zeros, as in (b). Zero phase impulse responses are desirable because their step responses are symmetrical between the top and bottom, making the left and right edges of pulses look the same, as is shown in (c). Linear phase filters have left-right symmetry, but not around sample zero, as illustrated in (d). This results in a phase that is linear, that is, a straight line, as shown in (e). The linear phase pulse response, shown in (f), has all the advantages of the zero phase pulse response. In comparison, the impulse responses of nonlinear phase filters are not symmetrical between the left and right, as in (g), and the phases are not a straight line, as in (h). The worst part is that the left and right edges of the pulse response are not the same, as shown in (i).
332 |
The Scientist and Engineer's Guide to Digital Signal Processing |
single pole low-pass filter is a one-sided exponential. The impulse response of the corresponding bidirectional filter is a one-sided exponential that decays to the right, convolved with a one-sided exponential that decays to the left. Going through the mathematics, this turns out to be a double-sided exponential that decays both to the left and right, with the same decay constant as the original filter.
Some applications only have a portion of the signal in the computer at a particular time, such as systems that alternately input and output data on a continuing basis. Bidirectional filtering can be used in these cases by combining it with the overlap-add method described in the last chapter. When you come to the question of how long the impulse response is, don't say "infinite." If you do, you will need to pad each signal segment with an infinite number of zeros. Remember, the impulse response can be truncated when it has decayed below the round-off noise level, i.e., about 15 to 20 time constants. Each segment will need to be padded with zeros on both the left and right to allow for the expansion during the bidirectional filtering.
Using Integers
Single precision floating point is ideal to implement these simple recursive filters. The use of integers is possible, but it is much more difficult. There are two main problems. First, the round-off error from the limited number of bits can degrade the response of the filter, or even make it unstable. Second, the fractional values of the recursion coefficients must be handled with integer math. One way to attack this problem is to express each coefficient as a fraction. For example, 0.15 becomes 19/128. Instead of multiplying by 0.15, you first multiply by 19 and then divide by 128. Another way is to replace the multiplications with look-up tables. For example, a 12 bit ADC produces samples with a value between 0 and 4095. Instead of multiplying each sample by 0.15, you pass the samples through a look-up table that is 4096 entries long. The value obtained from the look-up table is equal to 0.15 times the value entering the look-up table. This method is very fast, but it does require extra memory; a separate look-up table is needed for each coefficient. Before you try either of these integer methods, make sure the recursive algorithm for the moving average filter will not suit your needs. It loves integers.




Amplitude
































































































































































































0 0.1 0.2 0.3 0.4 0.5
















