Contents

class

SushiDSP::Oversampler8x

Cascades three committed Parks-McClellan halfband stages (see HalfbandCoefficients.hpp) each way for 8x oversampling.

Declared in
include/SushiDSP/math/Oversampler.hpp

Allocation-free after construction.

Public member functions

explicit Oversampler8x(std::uint32_t block_size)

Parameters

block_size

The 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 8x.

Returns an internally-owned buffer.

Parameters

input

block_size base-rate input samples.

frames

Must not exceed the block_size passed to the constructor.

Returns

Pointer to frames*8 oversampled output samples, valid until the next call.

void downsample(const float *oversampled, std::uint32_t frames_oversampled, float *output)

Downsamples an 8x-rate buffer back to the base rate.

Parameters

oversampled

frames_oversampled samples at 8x rate.

frames_oversampled

Must not exceed 8 * the block_size passed to the constructor.

output

frames_oversampled/8 base-rate output samples.

void reset()

Resets every stage's history.

std::uint32_t block_size() const

The base-rate block size this instance was constructed for.

std::uint32_t latency_samples() const

Round-trip group delay of the three up and three down stages.

Returns

Delay in base-rate samples (rounded down).