6#ifndef SBL_DSP_RESAMPLING_SINC_UPSAMPLER_HPP_
7#define SBL_DSP_RESAMPLING_SINC_UPSAMPLER_HPP_
33 static constexpr uint8_t
FACTOR = sinc_upsampler::FACTOR;
34 static constexpr uint8_t
TAPS = sinc_upsampler::TAPS;
45 history_[next_] = sample;
46 history_[next_ +
TAPS] = sample;
47 next_ =
static_cast<uint8_t
>((next_ + 1) %
TAPS);
48 const float* h = &history_[next_];
50 static_assert(
FACTOR == 4,
"SBL ERROR: SincUpsampler::process sums three rows of taps");
54 for (uint8_t j = 0; j <
TAPS; ++j) {
56 v0 += x * sinc_upsampler::TAP[0][j];
57 v1 += x * sinc_upsampler::TAP[1][j];
58 v2 += x * sinc_upsampler::TAP[2][j];
68 for (
float& h : history_) {
75 float history_[2 *
TAPS] = {};
A frame-rate signal interpolated at FACTOR steps through each frame, LATENCY frames late.
void process(float sample, float(&out)[FACTOR])
One frame: push a sample and interpolate the frame LATENCY frames back.
static constexpr uint8_t TAPS
void reset()
History to zero.
static constexpr uint8_t FACTOR
static constexpr uint8_t LATENCY
Generated by scripts/generate_sinc_upsampler.py; do not edit.