public class ChebFilter extends IIRFilter
setPoles(int)
for more information
about poles. Another characteristic of Chebyshev filters is how much "ripple"
they allow in the pass band. The pass band is the range of frequencies that
the filter lets through. The "ripple" in the pass band can be seen as wavy
line in the frequency response of the filter. Lots of ripple is bad, but more
ripple gives a faster rolloff from the pass band to the stop band (the range
of frequencies blocked by the filter). Faster rolloff is good because it
means the cutoff is sharper. Ripple is expressed as a percentage, such as
0.5% ripple.UGen.InputType, UGen.UGenInput
Modifier and Type | Field and Description |
---|---|
static int |
HP
A constant used to indicate a high pass filter.
|
static int |
LP
A constant used to indicate a low pass filter.
|
Constructor and Description |
---|
ChebFilter(float frequency,
int type,
float ripple,
int poles,
float sampleRate)
Constructs a Chebyshev filter with a cutoff of the given frequency, of the given
type, with the give amount of ripple in the pass band, and with the given
number of poles, that will be used to filter audio of that was recorded at
the given sample rate.
|
Modifier and Type | Method and Description |
---|---|
protected void |
calcCoeff()
Calculates the coefficients of the filter using the current cutoff
frequency.
|
int |
getPoles()
Returns the number of poles in the filter.
|
float |
getRipple()
Returns the ripple percentage of the filter.
|
int |
getType()
Returns the type of the filter.
|
void |
setPoles(int p)
Sets the number of poles used in the filter.
|
void |
setRipple(float r)
Sets the ripple percentage of the filter.
|
void |
setType(int t)
Sets the type of the filter.
|
frequency, printCoeff, process, process, setFreq, uGenerate, validFreq
addInput, getLastValues, patch, patch, patch, printInputs, removeInput, sampleRate, sampleRateChanged, setAudioChannelCount, setSampleRate, tick, unpatch, unpatch
public static final int LP
public static final int HP
public ChebFilter(float frequency, int type, float ripple, int poles, float sampleRate)
frequency
- the cutoff frequency of the filtertype
- the type of filter, either ChebFilter.LP or ChebFilter.HPripple
- the percentage of ripple, such as 0.005poles
- the number of poles, must be even and in the range [2, 20]sampleRate
- the sample rate of audio that will be filteredpublic void setType(int t)
t
- the type of the filterpublic int getType()
public void setRipple(float r)
r
- the ripple percentagepublic float getRipple()
public void setPoles(int p)
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 |
p
- -
the number of polespublic int getPoles()
protected void calcCoeff()
IIRFilter
b[0]
corresponds to the coefficient b1
.