public class BandPassFilter
extends java.lang.Object
Filter parameters include lower and upper frequencies that define the pass band, the width of the transition from pass band to stop bands, and the maximum error for amplitude in both pass and stop bands.
For efficiency the Fourier transform of the filter may be cached for repeated application to multiple input arrays. A cached transform can be reused while the lengths of input and output arrays do not change. Because caching consumes memory, it is disabled by default.
Modifier and Type | Class and Description |
---|---|
static class |
BandPassFilter.Extrapolation
The method used to extrapolate values beyond the ends of input arrays.
|
Constructor and Description |
---|
BandPassFilter(double klower,
double kupper,
double kwidth,
double aerror)
Constructs a band-pass filter with specified parameters.
|
Modifier and Type | Method and Description |
---|---|
void |
apply(float[][][] x,
float[][][] y)
Applies this filter.
|
void |
apply(float[][] x,
float[][] y)
Applies this filter.
|
void |
apply(float[] x,
float[] y)
Applies this filter.
|
float[] |
getCoefficients1()
Gets the 1D array of coefficients for this filter.
|
float[][] |
getCoefficients2()
Gets the 2D array of coefficients for this filter.
|
float[][][] |
getCoefficients3()
Gets the 3D array of coefficients for this filter.
|
void |
setExtrapolation(BandPassFilter.Extrapolation extrapolation)
Sets the method used to extrapolate values beyond the ends of input arrays.
|
void |
setFilterCaching(boolean filterCaching)
Enables or disables caching of the Fourier transform of the filter.
|
public BandPassFilter(double klower, double kupper, double kwidth, double aerror)
klower
- the lower pass band frequency, in cycles per sample.kupper
- the upper pass band frequency, in cycles per sample.kwidth
- width of the transition between pass and stop bands.aerror
- approximate bound on amplitude error, a positive fraction.public void setExtrapolation(BandPassFilter.Extrapolation extrapolation)
extrapolation
- the extrapolation method.public void setFilterCaching(boolean filterCaching)
filterCaching
- true, to enable caching; false, to disable.public float[] getCoefficients1()
public float[][] getCoefficients2()
public float[][][] getCoefficients3()
public void apply(float[] x, float[] y)
x
- input array.y
- output filtered array.public void apply(float[][] x, float[][] y)
x
- input array.y
- output filtered array.public void apply(float[][][] x, float[][][] y)
x
- input array.y
- output filtered array.