Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Digital Signal Processing. The Scientist and Engineers Guide. Steven W. Smith

.pdf
Скачиваний:
166
Добавлен:
02.05.2014
Размер:
7 Мб
Скачать
☆

Chapter 19Recursive Filters

327

1.5

 

 

 

 

 

 

a. Band-pass frequency response

 

 

1.0

 

 

 

 

 

Amplitude

 

 

 

 

 

0.5

single stage

 

 

 

 

 

 

 

 

 

 

BW=0.0066

 

cascade of

 

 

 

 

 

three stages

 

 

0.0

 

 

 

 

 

0

0.1

0.2

0.3

0.4

0.5

 

 

Frequency

 

 

FIGURE 19-6

Characteristics of narrow-band filters. Figure (a) and (b) shows the frequency responses of various band-pass and band-reject filters. The step response of the band-reject filter is shown in (c). The band-reject (notch) filter is useful for removing 60 Hz and similar interference from time domain encoded waveforms.

Amplitude

Amplitude

1.5

 

 

 

 

 

 

b. Band-reject frequency response

 

 

 

BW=0.0066

 

 

 

 

1.0

 

 

 

 

 

 

 

 

BW=0.033

 

 

0.5

 

 

 

 

 

0.0

 

 

 

 

 

0

0.1

0.2

0.3

0.4

0.5

 

 

Frequency

 

 

1.5

 

 

 

 

 

c. Band-reject step response

1.0

BW=0.0066

0.5

0.0

0

50

100

150

200

Sample number

Two parameters must be selected before using these equations: f, the center frequency, and BW, the bandwidth (measured at an amplitude of 0.707). Both of these are expressed as a fraction of the sampling frequency, and therefore must be between 0 and 0.5. From these two specified values, calculate the intermediate variables: R and K, and then the recursion coefficients.

As shown in (a), the band-pass filter has relatively large tails extending from the main peak. This can be improved by cascading several stages. Since the design equations are quite long, it is simpler to implement this cascade by filtering the signal several times, rather than trying to find the coefficients needed for a single filter.

Figure (b) shows examples of the band-reject filter. The narrowest bandwidth that can be obtain with single precision is about 0.0003 of the sampling frequency. When pushed beyond this limit, the attenuation of the notch will degrade. Figure (c) shows the step response of the band-reject filter. There is noticeable overshoot and ringing, but its amplitude is quite small. This allows the filter to remove narrowband interference (60 Hz and the like) with only a minor distortion to the time domain waveform.

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).

330

The Scientist and Engineer's Guide to Digital Signal Processing

Analog electronic circuits have this same problem with the phase response. Imagine a circuit composed of resistors and capacitors sitting on your desk. If the input has always been zero, the output will also have always been zero. When an impulse is applied to the input, the capacitors quickly charge to some value and then begin to exponentially decay through the resistors. The impulse response (i.e., the output signal) is a combination of these various decaying exponentials. The impulse response cannot be symmetrical, because the output was zero before the impulse, and the exponential decay never quite reaches a value of zero again. Analog filter designers attack this problem with the Bessel filter, presented in Chapter 3. The Bessel filter is designed to have as linear phase as possible; however, it is far below the performance of digital filters. The ability to provide an exact linear phase is a clear advantage of digital filters.

Fortunately, there is a simple way to modify recursive filters to obtain a zero phase. Figure 19-8 shows an example of how this works. The input signal to be filtered is shown in (a). Figure (b) shows the signal after it has been filtered by a single pole low-pass filter. Since this is a nonlinear phase filter, the left and right edges do not look the same; they are inverted versions of each other. As previously described, this recursive filter is implemented by starting at sample 0 and working toward sample 150, calculating each sample along the way.

Now, suppose that instead of moving from sample 0 toward sample 150, we start at sample 150 and move toward sample 0. In other words, each sample in the output signal is calculated from input and output samples to the right of the sample being worked on. This means that the recursion equation, Eq. 19-1, is changed to:

y [n ] ' a0 x [n ] % a1 x [n % 1]

% a2 x [n % 2] % a3 x [n % 3] %

% b1 y [n % 1]

% b2 y [n % 2] % b3 y [n % 3] %

EQUATION 19-9

The reverse recursion equation. This is the same as Eq. 19-1, except the signal is filtered from left-to-right, instead of right-to-left.

þ

þ

Figure (c) shows the result of this reverse filtering. This is analogous to passing an analog signal through an electronic RC circuit while running time backwards. !esrevinu eht pu-wercs nac lasrever emit -noituaC

Filtering in the reverse direction does not produce any benefit in itself; the filtered signal still has left and right edges that do not look alike. The magic happens when forward and reverse filtering are combined. Figure (d) results from filtering the signal in the forward direction and then filtering again in the reverse direction. Voila! This produces a zero phase recursive filter. In fact, any recursive filter can be converted to zero phase with this bidirectional filtering technique. The only penalty for this improved performance is a factor of two in execution time and program complexity.

Chapter 19Recursive Filters

331

Amplitude

1.5

 

 

 

1.5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

a. Original signal

 

 

 

b. Filtered

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1.0

1.0

0.5

 

 

 

 

 

 

Amplitude

0.5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0.0

 

 

 

 

 

 

 

0.0

 

 

 

 

 

 

-0.5

 

 

 

 

 

 

 

-0.5

 

 

 

 

 

 

0

25

50

75

100

125

150

 

0

25

50

75

100

125

150

 

 

Sample number

 

 

 

 

 

Sample number

 

 

FIGURE 19-8

Bidirectional recursive filtering. A rectangular pulse input signal is shown in (a). Figure (b) shows the signal after being filtered with a single pole recursive low-pass filter, passing from left-to-right. In (c), the signal has been processed in the same manner, except with the filter moving right-to-left. Figure (d) shows the signal after being filtered both left-to-right and then right-to-left. Any recursive filter can be made zero phase by using this technique.

 

1.5

 

 

 

 

 

 

 

c.

Filtered

 

 

 

 

 

 

1.0

 

 

 

 

 

 

Amplitude

0.5

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0.0

 

 

 

 

 

 

 

-0.5

 

 

 

 

 

 

 

0

25

50

75

100

125

150

Sample number

1.5

d. Filtered

 

1.0

Amplitude

0.5

 

0.0

 

 

 

 

 

 

-0.5

 

 

 

 

 

 

0

25

50

75

100

125

150

Sample number

How do you find the impulse and frequency responses of the overall filter? The magnitude of the frequency response is the same for each direction, while the phases are opposite in sign. When the two directions are combined, the magnitude becomes squared, while the phase cancels to zero. In the time domain, this corresponds to convolving the original impulse response with a left-for-right flipped version of itself. For instance, the impulse response of a

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.

CHAPTER

Chebyshev Filters

20

Chebyshev filters are used to separate one band of frequencies from another. Although they cannot match the performance of the windowed-sinc filter, they are more than adequate for many applications. The primary attribute of Chebyshev filters is their speed, typically more than an order of magnitude faster than the windowed-sinc. This is because they are carried out by recursion rather than convolution. The design of these filters is based on a mathematical technique called the z-transform, discussed in Chapter 33. This chapter presents the information needed to use Chebyshev filters without wading through a mire of advanced mathematics.

The Chebyshev and Butterworth Responses

The Chebyshev response is a mathematical strategy for achieving a faster rolloff by allowing ripple in the frequency response. Analog and digital filters that use this approach are called Chebyshev filters. For instance, analog Chebyshev filters were used in Chapter 3 for analog-to-digital and digital-to- analog conversion. These filters are named from their use of the Chebyshev polynomials, developed by the Russian mathematician Pafnuti Chebyshev (1821-1894). This name has been translated from Russian and appears in the literature with different spellings, such as: Chebychev, Tschebyscheff, Tchebysheff and Tchebichef.

Figure 20-1 shows the frequency response of low-pass Chebyshev filters with passband ripples of: 0%, 0.5% and 20%. As the ripple increases (bad), the roll-off becomes sharper (good). The Chebyshev response is an optimal tradeoff between these two parameters. When the ripple is set to 0%, the filter is called a maximally flat or Butterworth filter (after S. Butterworth, a British engineer who described this response in 1930). A ripple of 0.5% is a often good choice for digital filters. This matches the typical precision and accuracy of the analog electronics that the signal has passed through.

The Chebyshev filters discussed in this chapter are called type 1 filters, meaning that the ripple is only allowed in the passband. In comparison,

333

334

The Scientist and Engineer's Guide to Digital Signal Processing

FIGURE 20-1

The Chebyshev response. Chebyshev filters achieve a faster roll-off by allowing ripple in the passband. When the ripple is set to 0%, it is called a maximally flat or Butterworth filter. Consider using a ripple of 0.5% in your designs; this passband unflatness is so small that it cannot be seen in this graph, but the roll-off is much faster than the Butterworth.

Amplitude

1.5

20%

Ripple

1.0

0%

0.5%

0.5

0.0

0

0.1

0.2

0.3

0.4

0.5

Frequency

type 2 Chebyshev filters have ripple only in the stopband. Type 2 filters are seldom used, and we won't discuss them. There is, however, an important design called the elliptic filter, which has ripple in both the passband and the stopband. Elliptic filters provide the fastest roll-off for a given number of poles, but are much harder to design. We won't discuss the elliptic filter here, but be aware that it is frequently the first choice of professional filter designers, both in analog electronics and DSP. If you need this level of performance, buy a software package for designing digital filters.

Designing the Filter

You must select four parameters to design a Chebyshev filter: (1) a high-pass or low-pass response, (2) the cutoff frequency, (3) the percent ripple in the passband, and (4) the number of poles. Just what is a pole? Here are two answers. If you don't like one, maybe the other will help:

Answer 1- The Laplace transform and z-transform are mathematical ways of breaking an impulse response into sinusoids and decaying exponentials. This is done by expressing the system's characteristics as one complex polynomial divided by another complex polynomial. The roots of the numerator are called zeros, while the roots of the denominator are called poles. Since poles and zeros can be complex numbers, it is common to say they have a "location" in the complex plane. Elaborate systems have more poles and zeros than simple ones. Recursive filters are designed by first selecting the location of the poles and zeros, and then finding the appropriate recursion coefficients (or analog components). For example, Butterworth filters have poles that lie on a circle in the complex plane, while in a Chebyshev filter they lie on an ellipse. This is the topic of Chapters 32 and 33.

Answer 2- Poles are containers filled with magic powder. The more poles in a filter, the better the filter works.

Chapter 20Chebyshev Filters

335

Amplitude

1.25

 

 

 

1.25

 

 

 

 

 

 

 

 

 

 

 

a. Low-pass frequency response

 

 

 

c. High-pass frequency response

 

 

 

 

 

 

 

 

 

1.00

 

 

 

 

 

 

 

Amplitude

1.00

 

 

 

 

 

 

0.50

 

 

 

 

 

 

 

0.50

 

 

 

 

 

 

0.75

 

 

 

 

 

 

 

 

0.75

 

 

 

 

 

 

0.25

2

 

 

4 pole

 

 

2

 

0.25

 

 

 

 

2

 

 

 

 

 

 

 

2

 

4

 

 

 

6

4

 

12

8

 

6

4

 

6

8

12

4

 

 

 

 

 

4

 

6 pole

0.00

 

 

 

 

 

 

 

 

0.00

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0

0.1

0.2

 

0.3

0.4

 

0.5

 

0

0.1

 

0.2

0.3

0.4

0.5

 

 

Frequency

 

 

 

 

 

 

 

Frequency

 

 

Amplitude (dB)

20

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

b. Low-pass frequency response (dB)

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4 pole

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-20

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6

 

-40

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

12

-60

-80

-100 0 0.1 0.2 0.3 0.4 0.5

Frequency

Amplitude (dB)

20

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

d. High-pass frequency response (dB)

 

 

 

 

0

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4

 

 

 

 

 

 

2

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2

 

 

 

 

 

8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-20

 

 

 

 

 

 

 

 

 

 

4

 

 

 

 

 

 

 

 

 

 

 

4

6

 

 

 

 

12

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6 pole

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-40

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-60

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-80

-100

0

0.1

0.2

0.3

0.4

0.5

Frequency

FIGURE 20-2

Chebyshev frequency responses. Figures (a) and (b) show the frequency responses of low-pass Chebyshev filters with 0.5% ripple, while (c) and (d) show the corresponding high-pass filter responses.

Kidding aside, the point is that you can use these filters very effectively without knowing the nasty mathematics behind them. Filter design is a specialty. In actual practice, more engineers, scientists and programmers think in terms of answer 2, than answer 1.

Figure 20-2 shows the frequency response of several Chebyshev filters with 0.5% ripple. For the method used here, the number of poles must be even. The cutoff frequency of each filter is measured where the amplitude crosses 0.707 (-3dB). Filters with a cutoff frequency near 0 or 0.5 have a sharper roll-off than filters in the center of the frequency range. For example, a two pole filter at fC ' 0.05 has about the same roll-off as a four pole filter at fC ' 0.25 . This is fortunate; fewer poles can be used near 0 and 0.5 because of round-off noise. More about this later.

There are two ways of finding the recursion coefficients without using the z- transform. First, the cowards way: use a table. Tables 20-1 and 20-2 provide the recursion coefficients for low-pass and high-pass filters with 0.5% passband ripple. If you only need a quick and dirty design, copy the appropriate coefficients into your program, and you're done.

336

fC

0.01

0.025

0.05

0.075

0.1

0.15

0.2

0.25

0.3

0.35

0.40

0.45

The Scientist and Engineer's Guide to Digital Signal Processing

 

2 Pole

 

4 Pole

6 Pole

 

 

a0=

8.663387E-04

 

a0=

4.149425E-07 (!! Unstable !!)

a0= 1.391351E-10 (!! Unstable !!)

a1= 1.732678E-03 b1= 1.919129E+00

a1=

1.659770E-06 b1= 3.893453E+00

a1= 8.348109E-10 b1= 5.883343E+00

a2=

8.663387E-04

b2= -9.225943E-01

a2=

2.489655E-06 b2= -5.688233E+00

a2= 2.087027E-09 b2= -1.442798E+01

 

 

 

a3= 1.659770E-06 b3= 3.695783E+00

a3= 2.782703E-09 b3= 1.887786E+01

 

 

 

a4=

4.149425E-07

b4= -9.010106E-01

a4= 2.087027E-09 b4= -1.389914E+01

 

 

 

 

 

 

a5= 8.348109E-10 b5= 5.459909E+00

 

 

 

 

 

 

a6= 1.391351E-10 b6= -8.939932E-01

a0=

5.112374E-03

 

a0=

1.504626E-05

 

a0= 3.136210E-08 (!! Unstable !!)

a1= 1.022475E-02 b1= 1.797154E+00

a1=

6.018503E-05 b1= 3.725385E+00

a1= 1.881726E-07 b1= 5.691653E+00

a2=

5.112374E-03

b2= -8.176033E-01

a2=

9.027754E-05 b2= -5.226004E+00

a2= 4.704314E-07 b2= -1.353172E+01

 

 

 

a3= 6.018503E-05 b3= 3.270902E+00

a3= 6.272419E-07 b3= 1.719986E+01

 

 

 

a4=

1.504626E-05

b4= -7.705239E-01

a4= 4.704314E-07 b4= -1.232689E+01

 

 

 

 

 

 

a5= 1.881726E-07 b5= 4.722721E+00

 

 

 

 

 

 

a6= 3.136210E-08 b6= -7.556340E-01

a0=

1.868823E-02

 

a0=

2.141509E-04

 

a0= 1.771089E-06

a1= 3.737647E-02 b1= 1.593937E+00

a1=

8.566037E-04 b1= 3.425455E+00

a1= 1.062654E-05 b1= 5.330512E+00

a2=

1.868823E-02

b2= -6.686903E-01

a2=

1.284906E-03 b2= -4.479272E+00

a2= 2.656634E-05 b2= -1.196611E+01

 

 

 

a3= 8.566037E-04 b3= 2.643718E+00

a3= 3.542179E-05 b3= 1.447067E+01

 

 

 

a4=

2.141509E-04

b4= -5.933269E-01

a4= 2.656634E-05 b4= -9.937710E+00

 

 

 

 

 

 

a5= 1.062654E-05 b5= 3.673283E+00

 

 

 

 

 

 

a6= 1.771089E-06 b6= -5.707561E-01

a0=

3.869430E-02

 

a0=

9.726342E-04

 

a0= 1.797538E-05

a1= 7.738860E-02 b1= 1.392667E+00

a1=

3.890537E-03 b1= 3.103944E+00

a1= 1.078523E-04 b1= 4.921746E+00

a2=

3.869430E-02

b2= -5.474446E-01

a2=

5.835806E-03 b2= -3.774453E+00

a2= 2.696307E-04 b2= -1.035734E+01

 

 

 

a3= 3.890537E-03 b3= 2.111238E+00

a3= 3.595076E-04 b3= 1.189764E+01

 

 

 

a4=

9.726342E-04

b4= -4.562908E-01

a4= 2.696307E-04 b4= -7.854533E+00

 

 

 

 

 

 

a5= 1.078523E-04 b5= 2.822109E+00

 

 

 

 

 

 

a6= 1.797538E-05 b6= -4.307710E-01

a0=

6.372802E-02

 

a0=

2.780755E-03

 

a0= 9.086148E-05

a1= 1.274560E-01 b1= 1.194365E+00

a1=

1.112302E-02 b1= 2.764031E+00

a1= 5.451688E-04 b1= 4.470118E+00

a2=

6.372802E-02

b2= -4.492774E-01

a2=

1.668453E-02 b2= -3.122854E+00

a2= 1.362922E-03 b2= -8.755594E+00

 

 

 

a3= 1.112302E-02 b3= 1.664554E+00

a3= 1.817229E-03 b3= 9.543712E+00

 

 

 

a4=

2.780755E-03

b4= -3.502232E-01

a4= 1.362922E-03 b4= -6.079376E+00

 

 

 

 

 

 

a5= 5.451688E-04 b5= 2.140062E+00

 

 

 

 

 

 

a6= 9.086148E-05 b6= -3.247363E-01

a0=

1.254285E-01

 

a0=

1.180009E-02

 

a0= 8.618665E-04

a1= 2.508570E-01 b1= 8.070778E-01

a1=

4.720034E-02 b1= 2.039039E+00

a1= 5.171199E-03 b1= 3.455239E+00

a2=

1.254285E-01

b2= -3.087918E-01

a2=

7.080051E-02 b2= -2.012961E+00

a2= 1.292800E-02 b2= -5.754735E+00

 

 

 

a3= 4.720034E-02 b3= 9.897915E-01

a3= 1.723733E-02 b3= 5.645387E+00

 

 

 

a4=

1.180009E-02

b4= -2.046700E-01

a4= 1.292800E-02 b4= -3.394902E+00

 

 

 

 

 

 

a5= 5.171199E-03 b5= 1.177469E+00

 

 

 

 

 

 

a6= 8.618665E-04 b6= -1.836195E-01

a0=

1.997396E-01

 

a0=

3.224554E-02

 

a0= 4.187408E-03

a1= 3.994792E-01 b1= 4.291048E-01

a1=

1.289821E-01 b1= 1.265912E+00

a1= 2.512445E-02 b1= 2.315806E+00

a2=

1.997396E-01

b2= -2.280633E-01

a2=

1.934732E-01 b2= -1.203878E+00

a2= 6.281112E-02 b2= -3.293726E+00

 

 

 

a3= 1.289821E-01 b3= 5.405908E-01

a3= 8.374816E-02 b3= 2.904826E+00

 

 

 

a4=

3.224554E-02

b4= -1.185538E-01

a4= 6.281112E-02 b4= -1.694128E+00

 

 

 

 

 

 

a5= 2.512445E-02 b5= 6.021426E-01

 

 

 

 

 

 

a6= 4.187408E-03 b6= -1.029147E-01

a0=

2.858110E-01

 

a0=

7.015301E-02

 

a0= 1.434449E-02

a1= 5.716221E-01 b1= 5.423258E-02

a1=

2.806120E-01 b1= 4.541481E-01

a1= 8.606697E-02 b1= 1.076052E+00

a2=

2.858110E-01

b2= -1.974768E-01

a2=

4.209180E-01 b2= -7.417536E-01

a2= 2.151674E-01 b2= -1.662847E+00

 

 

 

a3= 2.806120E-01 b3= 2.361222E-01

a3= 2.868899E-01 b3= 1.191063E+00

 

 

 

a4=

7.015301E-02

b4= -7.096476E-02

a4= 2.151674E-01 b4= -7.403087E-01

 

 

 

 

 

 

a5= 8.606697E-02 b5= 2.752158E-01

 

 

 

 

 

 

a6= 1.434449E-02 b6= -5.722251E-02

a0=

3.849163E-01

 

a0=

1.335566E-01

 

a0= 3.997487E-02

a1= 7.698326E-01 b1= -3.249116E-01

a1=

5.342263E-01 b1= -3.904486E-01

a1= 2.398492E-01 b1= -2.441152E-01

a2=

3.849163E-01

b2= -2.147536E-01

a2=

8.013394E-01 b2= -6.784138E-01

a2= 5.996231E-01 b2= -1.130306E+00

 

 

 

a3= 5.342263E-01 b3= -1.412021E-02

a3= 7.994975E-01 b3= 1.063167E-01

 

 

 

a4=

1.335566E-01

b4= -5.392238E-02

a4= 5.996231E-01 b4= -3.463299E-01

 

 

 

 

 

 

a5= 2.398492E-01 b5= 8.882992E-02

 

 

 

 

 

 

a6= 3.997487E-02 b6= -3.278741E-02

a0=

5.001024E-01

 

a0=

2.340973E-01

 

a0= 9.792321E-02

a1= 1.000205E+00 b1= -7.158993E-01

a1=

9.363892E-01 b1= -1.263672E+00

a1= 5.875393E-01 b1= -1.627573E+00

a2=

5.001024E-01

b2= -2.845103E-01

a2=

1.404584E+00

b2= -1.080487E+00

a2= 1.468848E+00 b2= -1.955020E+00

 

 

 

a3= 9.363892E-01 b3= -3.276296E-01

a3= 1.958464E+00 b3= -1.075051E+00

 

 

 

a4=

2.340973E-01

b4= -7.376791E-02

a4= 1.468848E+00 b4= -5.106501E-01

 

 

 

 

 

 

a5= 5.875393E-01 b5= -7.239843E-02

 

 

 

 

 

 

a6= 9.792321E-02 b6= -2.639193E-02

a0=

6.362308E-01

 

a0=

3.896966E-01

 

a0= 2.211834E-01

a1= 1.272462E+00 b1= -1.125379E+00

a1=

1.558787E+00

b1= -2.161179E+00

a1= 1.327100E+00 b1= -3.058672E+00

a2=

6.362308E-01

b2= -4.195441E-01

a2=

2.338180E+00

b2= -2.033992E+00

a2= 3.317751E+00 b2= -4.390465E+00

 

 

 

a3= 1.558787E+00 b3= -8.789098E-01

a3= 4.423668E+00 b3= -3.523254E+00

 

 

 

a4=

3.896966E-01

b4= -1.610655E-01

a4= 3.317751E+00 b4= -1.684185E+00

 

 

 

 

 

 

a5= 1.327100E+00 b5= -4.414881E-01

 

 

 

 

 

 

a6= 2.211834E-01 b6= -5.767513E-02

a0=

8.001101E-01

 

a0=

6.291693E-01

 

a0= 4.760635E-01

a1= 1.600220E+00 b1= -1.556269E+00

a1=

2.516677E+00

b1= -3.077062E+00

a1= 2.856381E+00 b1= -4.522403E+00

a2=

8.001101E-01

b2= -6.441713E-01

a2=

3.775016E+00

b2= -3.641323E+00

a2= 7.140952E+00 b2= -8.676844E+00

 

 

 

a3= 2.516677E+00 b3= -1.949229E+00

a3= 9.521270E+00 b3= -9.007512E+00

 

 

 

a4=

6.291693E-01

b4= -3.990945E-01

a4= 7.140952E+00 b4= -5.328429E+00

TABLE 20-1

 

 

 

 

a5= 2.856381E+00 b5= -1.702543E+00

 

 

 

 

a6= 4.760635E-01 b6= -2.303303E-01

Low-pass Chebyshev filters (0.5% ripple)

Соседние файлы в предмете Электроника