public class FFTBandPassFilter extends AudioProcessor
If you want to process the samples in the chain, override the
processSamples(SampleChunk)
method. This method will be called
even if the FFT fails and it will be called with the input samples.
The class makes the assumption that all channels have the same length of data.
Note that this class will produce inconsistencies at the frame boundaries, so cannot sensibly be used for filtering audio that is to be replayed.
Also check out the EQFilter
which contains high and low pass filter
implementations which can also provide band-pass filter functionality.
EQFilter
Constructor and Description |
---|
FFTBandPassFilter(AudioStream as,
int highPassHz,
int lowPassHz)
Chainable constructor
|
FFTBandPassFilter(int highPassHz,
int lowPassHz)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
SampleChunk |
process(SampleChunk sample)
Function that takes a sample chunk and processes the chunk.
|
SampleChunk |
processSamples(SampleChunk sc)
Process the band-filtered samples.
|
getLength, getUnderlyingStream, nextSampleChunk, process, processingComplete, reset, setUnderlyingStream
iterator, seek
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public FFTBandPassFilter(AudioStream as, int highPassHz, int lowPassHz)
as
- The audio stream to processhighPassHz
- The frequency of the high pass filter.lowPassHz
- The frequency of the low pass filter.public FFTBandPassFilter(int highPassHz, int lowPassHz)
highPassHz
- The frequency of the high pass filterlowPassHz
- The frequency of the low pass filter.public final SampleChunk process(SampleChunk sample) throws Exception
process
in class AudioProcessor
sample
- The sample chunk to process.Exception
- If the processing could not take placeAudioProcessor.process(org.openimaj.audio.SampleChunk)
public SampleChunk processSamples(SampleChunk sc)
sc
- The band-filtered samples