class
SushiDSP::Oversampler4x
Cascades the first two committed Parks-McClellan halfband stages (see HalfbandCoefficients.hpp) each way for 4x oversampling.
- Declared in
include/SushiDSP/math/Oversampler.hpp
Allocation-free after construction.
Public member functions
explicit Oversampler4x(std::uint32_t block_size)Parameters
block_sizeThe base-rate block size this instance will be called with.
const float * upsample(const float *input, std::uint32_t frames)Upsamples one base-rate block to 4x.
Returns an internally-owned buffer.
Parameters
inputblock_size base-rate input samples.
framesMust not exceed the block_size passed to the constructor.
Returns
Pointer to frames*4 oversampled output samples, valid until the next call.
void downsample(const float *oversampled, std::uint32_t frames_oversampled, float *output)Downsamples a 4x-rate buffer back to the base rate.
Parameters
oversampledframes_oversampled samples at 4x rate.
frames_oversampledMust not exceed 4 * the block_size passed to the constructor.
outputframes_oversampled/4 base-rate output samples.
void reset()Resets every stage's history.
std::uint32_t block_size() constThe base-rate block size this instance was constructed for.
std::uint32_t latency_samples() constRound-trip group delay of the two up and two down stages.
Returns
Delay in base-rate samples (rounded down).

