#include <oversampling.hpp>
|
| | OversamplerT () |
| void | set_factor (Factor f) |
| | RT contract: set_factor(), set_sample_rate(), set_kind(), and reset() are setup/control operations that mutate filter state and should run outside the audio callback.
|
| void | set_sample_rate (SampleType sr) |
| void | set_kind (Kind kind) |
| void | set_quality (Quality quality) |
| Kind | kind () const |
| Quality | quality () const |
| Factor | factor () const |
| int | factor_value () const |
| Latency | latency () const noexcept |
| | Linear-phase modes expose a constant delay suitable for host compensation.
|
| int | latency_samples () const noexcept |
| double | group_delay_samples (double frequency) const noexcept |
| | Group delay of the round trip (upsample, identity callback, downsample) in base-rate samples at frequency cycles per base sample.
|
| template<typename Callback> |
| SampleType | process (SampleType input, Callback &&callback) |
| SampleType | process (SampleType input, const std::function< SampleType(SampleType)> &callback) |
| template<typename Callback> |
| void | process_block (const SampleType *input, SampleType *output, std::size_t num_samples, Callback &&callback) |
| void | reset () |
◆ Factor
template<typename SampleType = float>
◆ Kind
template<typename SampleType = float>
Which anti-aliasing filter family the oversampler uses.
| Enumerator |
|---|
| fir_biquad | Butterworth biquad lowpass on both sides; ~7 dB rejection.
|
| polyphase_iir | Elliptic half-band polyphase IIR (allpass network). Default.
|
| linear_phase_fir | Linear-phase FIR with reported integer latency.
|
◆ Quality
template<typename SampleType = float>
| Enumerator |
|---|
| standard | FIR: 96 dB, flat to 0.40 Fs. IIR: 114.6 dB, flat to 0.485 Fs.
|
| pristine | FIR: 140 dB, flat to 0.45 Fs. IIR: 153.2 dB, flat to 0.485 Fs.
|
◆ OversamplerT()
template<typename SampleType = float>
◆ factor()
template<typename SampleType = float>
◆ factor_value()
template<typename SampleType = float>
◆ group_delay_samples()
template<typename SampleType = float>
Group delay of the round trip (upsample, identity callback, downsample) in base-rate samples at frequency cycles per base sample.
Constant and equal to latency().exact_input_samples for the linear-phase lane. The figure is the LTI delay of the filter cascade; the biquad lane rejects images so weakly that above ~0.2 Fs the decimator folds a tone's own image back onto it, and the measured phase there departs from it.
◆ kind()
template<typename SampleType = float>
◆ latency()
template<typename SampleType = float>
Linear-phase modes expose a constant delay suitable for host compensation.
Minimum-phase IIR modes have frequency-dependent group delay, so constant is false and no exact scalar is claimed; see group_delay_samples().
◆ latency_samples()
template<typename SampleType = float>
◆ polyphase_stage_design()
template<typename SampleType = float>
The elliptic half-band design stage stage (0 to 3) uses in the polyphase_iir lane at quality.
Stage 0 runs at twice the base rate, stage s at 2^(s+1) times it; frequencies in the design are relative to that stage's own rate. A stage outside 0..3 returns an invalid design.
◆ polyphase_stopband_db()
template<typename SampleType = float>
The polyphase lane's stopband floor at quality, in dB (negative): the worst equiripple level over every stage design.
Each stage guards the same absolute base band, so the lane rejects images and aliases into that band by at least this much at any factor. -114.62 dB standard, -153.23 dB pristine; documentation quotes them as 114.6 and 153.2 dB.
◆ process() [1/2]
template<typename SampleType = float>
template<typename Callback>
◆ process() [2/2]
template<typename SampleType = float>
| SampleType pulp::signal::OversamplerT< SampleType >::process |
( |
SampleType | input, |
|
|
const std::function< SampleType(SampleType)> & | callback ) |
|
inline |
◆ process_block()
template<typename SampleType = float>
template<typename Callback>
| void pulp::signal::OversamplerT< SampleType >::process_block |
( |
const SampleType * | input, |
|
|
SampleType * | output, |
|
|
std::size_t | num_samples, |
|
|
Callback && | callback ) |
|
inline |
◆ quality()
template<typename SampleType = float>
◆ reset()
template<typename SampleType = float>
◆ set_factor()
template<typename SampleType = float>
RT contract: set_factor(), set_sample_rate(), set_kind(), and reset() are setup/control operations that mutate filter state and should run outside the audio callback.
After configuration, process() and process_block() are allocation-free whenever the supplied callback is — including for a std::function callback, which is taken by reference and never copied per sample. A std::function still costs an indirect call, so hot paths should prefer the templated overload.
◆ set_kind()
template<typename SampleType = float>
◆ set_quality()
template<typename SampleType = float>
◆ set_sample_rate()
template<typename SampleType = float>
The documentation for this class was generated from the following file: