Interpolates a lower sampling rate to a higher one. More...
#include <AsyncAudioInterpolator.h>
Interpolates a lower sampling rate to a higher one.
This audio pipe class will interpolate an audio stream up to a higher sampling rate. Interpolation is a process where the sampling rate is increased by an integer factor. After the increase in sampling rate, a lowpass filter must be applied to avoid aliasing effects. 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 117 of file AsyncAudioInterpolator.h.
Async::AudioInterpolator::AudioInterpolator | ( | int | interpolation_factor, | |
const float * | filter_coeff, | |||
int | taps | |||
) |
Constuctor.
interpolation_factor | The factor to increase the sample rate with | |
filter_coeff | The filter coefficients | |
taps | The number of taps in the filter |
Async::AudioInterpolator::~AudioInterpolator | ( | void | ) |
Destructor.
virtual void Async::AudioInterpolator::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.