Contents

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_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 4x.

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*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

oversampled

frames_oversampled samples at 4x rate.

frames_oversampled

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

output

frames_oversampled/4 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 two up and two down stages.

Returns

Delay in base-rate samples (rounded down).