This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

This sketch demonstrates how to use a Chebyshev Filter. A Chebyshev Filter is used to separate one band of frequencies from another. It can either be a Low Pass filter or a High Pass filter. This type, along with three other attributes are used to determine the coefficients used for processing a signal. The other three attributes are the cutoff frequency, the passband ripple percentage, and the number of poles.

The cutoff frequency is the frequency that defines the breakpoint between the filter's passband and stopband. If the ChebFilter is set to be a low pass filter and the cutoff frequency is 500 Hz, Then all frequencies in a signal below 500 Hz will be allowed through the filter and the frequencies above 500 Hz will removed. So 0 to 500 Hz is the passband and 500 Hz to one-half of the sampling rate (22050 Hz if you are sampling at 44100 Hz, which is typical) is the stopband.

The passband ripple percentage is how much "ripple" there is in the passband. The thing to know is that a higher ripple percentage results in a faster transition between the passband and the stopband. However, large ripple can distort the signal somewhat.

The number of poles refer to the poles of an IIR, or recursive, digital filter. The thing to know is that a larger number of poles usually makes for a better filter. The ChebFilter has some limitations on the number of poles used. The number of poles must be even and between 2 and 20. The filter will report an error if either of those conditions are not met. However, it should also be mentioned that depending on the current cutoff frequency of the filter, the number of poles that will result in a stable filter, can be as few as 4. The filter will not report an error in the case of the number of requested poles resulting in an unstable filter. Generally, you probably won't need to use more than 6 poles. For reference, here is a table of the maximum number of poles possible according to cutoff frequency:

Cutoff Frequency
(expressed as a fraction of the sampling rate)
0.02 0.05 0.10 0.25 0.40 0.45 0.48
Maximum poles 4 6 10 20 10 6 4

Source code: ChebyshevFilter

Built with Processing