public static class MultirateFilters.Decimator extends Filters.FIRFilter
Filters.FIRFilter
.
Only every n
th sample is actually filtered, all others are dropped.
Thus this class combines downsampling and filtering (to remove aliasing).NOOP
Constructor and Description |
---|
Decimator(double[] coefficients,
int factor)
Creates a decimator with the given FIR coefficients.
|
Decimator(Filters.FIRFilter filter,
int factor)
Creates a decimator with the given FIR (low pass) filter.
|
Decimator(int factor)
Creates a decimator using a simple fir1 16th order low pass filter.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
getFactor()
Factor by which the signal is downsampled.
|
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.
|
String |
toString() |
addToDelayLine, filter, getCoefficients
public Decimator(int factor) throws IllegalArgumentException
factor
- nth frame to keep (factor)IllegalArgumentException
- if the decimation factor is not supportedFilters.createFir1_16thOrderLowpass(int)
public Decimator(double[] coefficients, int factor)
coefficients
- FIR coefficientsfactor
- nth frame to keep (factor)public Decimator(Filters.FIRFilter filter, int factor)
filter
- FIR filterfactor
- nth frame to keep (factor)public void reset()
StatefulMapFunction
reset
in interface StatefulMapFunction<float[]>
reset
in class Filters.FIRFilter
public int getFactor()
public float[] map(float[] data)
MapFunction
RealAudioBuffer
or a List
) to another one of the same size.map
in interface MapFunction<float[]>
map
in class Filters.FIRFilter
data
- datapublic boolean equals(Object o)
equals
in class Filters.FIRFilter
public int hashCode()
hashCode
in class Filters.FIRFilter
public String toString()
toString
in class Filters.FIRFilter
Copyright © 2011–2020 tagtraum industries incorporated. All rights reserved.