public static class Filters.IIRFilter extends Object implements StatefulMapFunction<float[]>
To compute the coefficients you might want to use Matlab or the free package Octave (with additional Octave-Forge packages needed for signals). E.g. for a low pass filter you could execute:
This will compute the coefficients for a third order low pass filter where the first argument (3) is the order
and the second (.4) the normalized cutoff frequency, which is defined as fc*2/fs
(fc = cutoff frequency, fs = sample frequency).
Assuming your audio is sampled at 44.1kHz, and you wanted a cutoff frequency of 11.025kHz, the seconds parameters
would be 11025*2/44100 = 0.5
.
Filters.FIRFilter
,
Filters.FourthOrderIIRFilter
Modifier | Constructor and Description |
---|---|
protected |
IIRFilter() |
|
IIRFilter(double[] inputCoefficients,
double[] outputCoefficients) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
double |
filter(double currentInputValue)
Deprecated.
|
int |
hashCode() |
float[] |
map(float[] data)
Maps an object (usually an array, an
RealAudioBuffer
or a List ) to another one of the same size. |
void |
reset()
Resets the function's state.
|
void |
setInputCoefficients(double[] inputCoefficients) |
void |
setOutputCoefficients(double[] outputCoefficients)
First b coefficient must always be 1.
|
String |
toString() |
protected IIRFilter()
public IIRFilter(double[] inputCoefficients, double[] outputCoefficients)
public void reset()
StatefulMapFunction
reset
in interface StatefulMapFunction<float[]>
public void setInputCoefficients(double[] inputCoefficients)
inputCoefficients
- a (input) coefficientspublic void setOutputCoefficients(double[] outputCoefficients)
outputCoefficients
- b (output) coefficientspublic float[] map(float[] data)
MapFunction
RealAudioBuffer
or a List
) to another one of the same size.map
in interface MapFunction<float[]>
data
- data@Deprecated public double filter(double currentInputValue)
Copyright © 2011–2020 tagtraum industries incorporated. All rights reserved.