Parks-McClellan FIR Filter Design
(Java 1.1 Version)
- Note
- The Java 1.1 applet on this page should work on the
HotJava 1.1 browser, Internet Explorer 4.0 or Netscape Navigator 4.0
with the Java 1.1 upgrade patch
applied. The applet does not work on older browsers such as Navigator
2.0 or 3.0
Introduction
The applet implements the Parks-McClellan equiripple FIR filter design
algorithm (sometimes referred to as the Remez exchange algorithm). This
design method allows an FIR filter to be designed to a frequency response
specification consisting of an arbitrary number of passbands and
stopbands, in each of which a specified amount of ripple can be tolerated.
For the sake of simplicity, the applet restricts the filter type to one
of the following:
- Low pass (LP) filter
- High pass (HP) filter
- Band pass (BP) filter
- Band stop (BS) filter
Note that this applet differs from the filter design applets elsewhere
on this site in that all frequencies are normalised, ie expressed
as a fraction of the sampling frequency. The upper frequency limit,
corresponding to the folding or "Nyquist" frequency, is
therefore 0·5; entering any frequency value above 0·5 will
cause an error. The use of normalised frequencies has the advantage that
the applet is not tied to a particular sampling frequency.
Outline instructions
The various filter settings are reasonably self-explanatory.
- Filter type
- Select the appropriate radio button to specify a LP, HP, BP or BS
filter.
- Passband
- Enter the normalised passband frequencies in the text boxes. For
a LP filter, the lower passband frequency is automatically set to 0;
for a HP filter the upper passband frequency is set to 0·5.
- Transition bandwidth
- Enter the required width of the transition band as a normalised
frequency (in the range 0 - 0·5). In the case of a
BP or BS filter, the transition bandwidth applies equally to both
transition bands.
- Passband ripple
- Enter the tolerable passband ripple in dB. This specifies how
much variation is allowed in the filter gain in the passband above
and below the ideal value of 1.
A ripple value of r dB corresponds to a variation in
passband gain between 1 +
and 1 - ,
where =
1 - 10 - r / 20
- Stopband attenuation
- Enter the minimum tolerable attenuation (maximum tolerable gain)
in the stopband in dB.
An attenuation of A dB corresponds to a filter gain of 10
- A / 20 in the stopband.
- Order
- Type in the required filter order, and press <Enter>.
Alternatively, click the Estimate button to estimate the
order based on the design settings.
Note that the order estimation (using the Kaiser formula) may
underestimate the order needed to meet the design specification; an
increased value can be typed in the text box if necessary.
|
Once the filter settings have been chosen, click the Design
button to design the filter.
Click the Plot response button to display the gain frequency
response of the resulting filter. The frequency scale covers the range 0 -
0·5 of normalised frequencies. The gain is on a log (dB) scale,
with 0 dB at the top; the selected Minimum plot gain defines
the gain value (in dB) at the bottom of the plot. Changing this setting
allows you to view the frequency response at different levels of detail.
As mentioned above, the estimated order may be too low, and may need to
be increased to meet the design specifications. Note also that there can
be a significant difference in the response obtained with even and odd
orders. Adjust the filter order until you are satisfied with the design.
Click the Coefficients button to list the filter coefficients.
These can be copied and pasted to a text editor if desired.
- Acknowledgement
-
This Java applet is derived from a C program "Parks-McClellan
algorithm for FIR filter design" Copyright (C) 1995 Jake Janovetz
(janovetz@coewl.cen.uiuc.edu), modified under the terms of the GNU
General Public License published by the Free Software Foundation.
Download source
code (zip Archive)
DSP home page
| Feedback