The oversampled signal is stored inside this object, with channels accessed via oversampler[c]. For example, you might do:
// Upsample from multi-channel input (inputBuffers[c][i] is a sample)
oversampler.up(inputBuffers, bufferLength)
// Modify the contents at the higher rate
for (int c = 0; c < 2; ++c) {
float *channel = oversampler[c];
for (int i = 0; i < bufferLength*2; ++i) {
channel[i] = std::abs(channel[i]);
}
}
// Downsample into the multi-channel output
oversampler.down(outputBuffers, bufferLength);
The performance depends not just on the length, but also on where you end the passband, allowing a wider/narrower transition band. Frequencies above this limit (relative to the lower sample-rate) may alias when upsampling and downsampling.
Resample error rates for different passband thresholds
Since both upsample and downsample are stateful, channels are meaningful. If your input channel-count doesn't match your output, you can size it to the larger of the two, and use .upChannel() and .downChannel() to only process the channels which exist.
Methods
Oversampler2xFIR (int channels, int maxBlock, int halfLatency=16, double passFreq=0.43)
void
resize (int nChannels, int maxBlockLength)
void
resize (int nChannels, int maxBlockLength, int halfLatency, double passFreq=0.43)