Decimates a higher sample rate into a lower one. More...
#include <AsyncAudioDecimator.h>
Decimates a higher sample rate into a lower one.
This audio pipe class will decimate an audio stream down to a lower sampling rate. Decimation is a process where the sampling rate is reduced by an integer factor. To reduce the rate a lowpass filter must first be applied. This filter is built into this component. However, the filter coefficients (FIR) must be calculated manually.
Use this web page to calculate the coefficients: http://www.dsptutor.freeuk.com/remez/RemezFIRFilterDesign.html
This implementation is based on the multirate FAQ at dspguru.com: http://dspguru.com/info/faqs/mrfaq.htm
Definition at line 116 of file AsyncAudioDecimator.h.
Async::AudioDecimator::AudioDecimator | ( | int | decimation_factor, | |
const float * | filter_coeff, | |||
int | taps | |||
) |
Constructor.
decimation_factor | The decimation factor | |
filter_coeff | An array holding the filter coefficients | |
taps | The numer of taps in the filter |
Async::AudioDecimator::~AudioDecimator | ( | void | ) |
Destructor.
virtual void Async::AudioDecimator::processSamples | ( | float * | dest, | |
const float * | src, | |||
int | count | |||
) | [protected, virtual] |
Process incoming samples and put them into the output buffer.
dest | Destination buffer | |
src | Source buffer | |
count | Number of samples in the source buffer |
This function should be reimplemented by the inheriting class to do the actual processing of the incoming samples. All samples must be processed, otherwise they are lost and the output buffer will contain garbage.
Implements Async::AudioProcessor.