Tutorial: Bandpass Filter
Design
This example uses ScopeFIR's Parks-McClellan method to design a bandpass filter.
ScopeFIR's Advanced Filter Specification Editor allows you to enter the desired filter specifications by describing each passband and stopband. Compared to ScopeFIR's Simple Specification Editor, the Advanced Specification editor is primarily useful when:
The Advanced Filter Specification Editor is shown below:
Each band you Add in the "Band Editor"
section is either a passband or a stopband, that is, the filter
either passes or stops signals within the frequency range. For
each band you must specify the following:
Now that you understand each field, using the Band Editor is straight-forward. Simply fill in the fields for each band and hit the "Add" button. Select bands using the mouse. You can delete a selected band with--you guessed it--the "Delete" button. If you make a mistake, click on the band, correct the error, and hit "Add" again. Note that whenever you enter a band that overlaps an existing band, ScopeFIR replaces the existing band. This can be a little confusing at first, but it makes for a quick and easy way to correct band entries: since a corrected band will generally overlap the incorrect entry, the new version you "Add" will simply replace the old.
We just said that ScopeFIR prevents you from actually entering bands that overlap (which they can't logically do), and that brings us to the next important point. Likewise, for your own good, ScopeFIR doesn't allow bands to touch. When you enter bands that touch, ScopeFIR produces an error message and ignores the new band. This behavior can be confusing to new users who think of bands as being "next to each other". But in fact, bands cannot touch, because there must be a transition band, that is, a frequency gap between any two bands. This follows directly from FIR filter theory: the number of taps required to implement a filter increases as the transition bands narrow (as a fraction of the sampling frequency). So without transition bands, your filter requires an infinite number of taps! (Let's face it: none of us has the time.) So the moral of the story is: you must provide a transition band, that is, a frequency gap between any two adjacent bands. Sorry, son, it's not just a good idea, it's the law.
Designing the Bandpass Filter
Now, back to our mission. We wanted to make a CD player sound like a telephone. We do this by designing a filter with the following bands:
These specifications have been entered at the top. To try this yourself, you can either manually type them in or just open the Project "bandpass.sfa" which is included in the ScopeFIR distribution file. Next, hit the "Design FIR" button. The "Actual Attn/Rip" column will be filled in. It shows that we have more than the minimum attenuation in both stopbands and less than the maximum ripple in the passband, so our filter design is a success. The Frequency Response of the filter is:

This one requires more taps than the previous lowpass and highpass combined. That isn't surprising, for two reasons. First, it is doing the job of both filters. Second, compared to the other two, this one tightens the passband ripple specification from 3 dB to 1 dB.
But why didn't we just use the Simple Specification Editor to design this one? Well, mostly because you wouldn't have learned as much. But also, notice that the SSE designs Bandpass filters with symmetricaltransition bands (the same on both sides) but our transition bands here aren't symmetrical. On the low side, the transition is from 30 to 300 Hz, so it occurs over 270 Hz. But on the high side, the transition is from 3000 to 3300 Hz, so it occurs over 300 Hz.
Our next example designs a similar bandpass filter using the Windowed Sinc method, rather than Parks-McClellan method:
Next: Windowed Sinc Bandpass Filter
Other FIR filter design examples:
© 1998-2001 Iowegian International
Corporation. All rights reserved.
"ScopeDSP" and "ScopeFIR" are trademarks of Iowegian
International Corporation