Sound Byte Libs 0.5.1-340-gab5b79a
C++ firmware library for audio applications on 32-bit ARM Cortex-M processors
Loading...
Searching...
No Matches
sbl::dsp::SincUpsampler Class Reference

A frame-rate signal interpolated at FACTOR steps through each frame, LATENCY frames late. More...

Detailed Description

A frame-rate signal interpolated at FACTOR steps through each frame, LATENCY frames late.

Each frame takes one sample and gives FACTOR values: the signal at the ends of the FACTOR equal parts of the frame LATENCY frames back. A sinc under a Kaiser window of beta 8 over TAPS samples interpolates between samples; the last value is the sample LATENCY frames back itself. Each set of taps sums to 1, so a constant passes. On a sine at 48 kHz the error of the values is under -75 dB of the sine's amplitude up to 15 kHz, -42 dB at 17.6 kHz and -18 dB at 20 kHz. PmPulse follows its PM signal within a frame with it.

Below the signal transport: a sample in, values out, no units. The taps are generated by scripts/generate_sinc_upsampler.py into sinc_upsampler_coefficients.hpp. Output does not depend on block size: it runs a frame at a time.

Definition at line 31 of file sinc_upsampler.hpp.

#include <sinc_upsampler.hpp>

Public Member Functions

void process (float sample, float(&out)[FACTOR])
 One frame: push a sample and interpolate the frame LATENCY frames back.
 
void reset ()
 History to zero.
 

Static Public Attributes

static constexpr uint8_t FACTOR = sinc_upsampler::FACTOR
 
static constexpr uint8_t TAPS = sinc_upsampler::TAPS
 
static constexpr uint8_t LATENCY = TAPS / 2 - 1
 

Member Function Documentation

◆ process()

void sbl::dsp::SincUpsampler::process ( float  sample,
float(&)  out[FACTOR] 
)
inline

One frame: push a sample and interpolate the frame LATENCY frames back.

Parameters
sampleThis frame's sample
[out]outout[k] is the signal (k + 1) / FACTOR through the frame LATENCY frames back
Context
Audio thread; real-time safe.

Definition at line 44 of file sinc_upsampler.hpp.

References FACTOR, LATENCY, and TAPS.

Referenced by sbl::dsp::PmInput::process(), and sbl::dsp::PmInput::process().

◆ reset()

void sbl::dsp::SincUpsampler::reset ( )
inline

History to zero.

Definition at line 67 of file sinc_upsampler.hpp.

Referenced by sbl::dsp::PmInput::reset().

Member Data Documentation

◆ FACTOR

constexpr uint8_t sbl::dsp::SincUpsampler::FACTOR = sinc_upsampler::FACTOR
staticconstexpr

values given per frame

Definition at line 33 of file sinc_upsampler.hpp.

Referenced by process().

◆ TAPS

constexpr uint8_t sbl::dsp::SincUpsampler::TAPS = sinc_upsampler::TAPS
staticconstexpr

samples each value is interpolated from

Definition at line 34 of file sinc_upsampler.hpp.

Referenced by process().

◆ LATENCY

constexpr uint8_t sbl::dsp::SincUpsampler::LATENCY = TAPS / 2 - 1
staticconstexpr

frames between a sample and its value

Definition at line 35 of file sinc_upsampler.hpp.

Referenced by process().


The documentation for this class was generated from the following file: