public class FeedForwardCombFilter extends FixedSizeSampleAudioProcessor
FixedSizeSampleAudioProcessor
to ensure that the sample chunks are
the same length as the required delay; this means that the buffer need only
be copied in between each iteration.Constructor and Description |
---|
FeedForwardCombFilter(double frequency,
double sampleRate,
double gain)
Constructor that takes the frequency at which the comb filter
will operate and the gain to apply to the delayed signal.
|
FeedForwardCombFilter(int nSamplesDelay,
double gain)
Constructor that takes the number of samples delay
to apply to the signal.
|
Modifier and Type | Method and Description |
---|---|
double |
getFrequency()
This returns the frequency that this comb filter is set to detect.
|
double |
getHarmonicity()
Returns the harmonicity power.
|
double |
getInputPower()
Returns the input power for the last processed frame.
|
double |
getOutputPower()
Returns the output power for the last processed frame.
|
SampleChunk |
process(SampleChunk sample)
Function that takes a sample chunk and processes the chunk.
|
getWindowSize, getWindowStep, isOverlapping, nextSampleChunk, setWindowSize, setWindowStep
getLength, getUnderlyingStream, process, processingComplete, reset, setUnderlyingStream
iterator, seek
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public FeedForwardCombFilter(int nSamplesDelay, double gain)
nSamplesDelay
- The number of delay samplesgain
- The gain of the delayed signalpublic FeedForwardCombFilter(double frequency, double sampleRate, double gain)
frequency
- The frequencysampleRate
- The sample rate of the signal in Hzgain
- the gain of the delayed signalpublic double getFrequency()
public SampleChunk process(SampleChunk sample) throws Exception
FixedSizeSampleAudioProcessor
is
simply to change the shape of the sample chunk. You may override this
method to process the samples directly.process
in class FixedSizeSampleAudioProcessor
sample
- The sample chunk to process.Exception
- If the processing could not take placeAudioProcessor.process(org.openimaj.audio.SampleChunk)
public double getOutputPower()
public double getInputPower()
public double getHarmonicity()