#include <smpandaresampler.hh>
|
enum | Mode { UP
, DOWN
} |
|
enum | Precision {
PREC_LINEAR = 1
, PREC_48DB = 8
, PREC_72DB = 12
, PREC_96DB = 16
,
PREC_120DB = 20
, PREC_144DB = 24
} |
|
enum | Filter { FILTER_IIR
, FILTER_FIR
} |
|
|
| Resampler2 (Mode mode, uint ratio, Precision precision, bool use_sse_if_available=true, Filter filter=FILTER_FIR) |
|
void | process_block (const float *input, uint n_input_samples, float *output) |
|
uint | order () const |
|
double | delay () const |
|
void | reset () |
|
bool | sse_enabled () const |
|
|
template<bool USE_SSE> |
Impl * | create_impl (uint stage_ratio) |
|
template<bool USE_SSE> |
Impl * | create_impl_iir (uint stage_ratio) |
|
template<class CArray > |
Impl * | create_impl_iir_with_coeffs (const CArray &carray, double group_delay) |
|
void | init_stage (std::unique_ptr< Impl > &impl, uint stage_ratio) |
|
|
template<class Filter > |
static Impl * | create_impl_with_coeffs (const double *d, uint order, double scaling) |
|
|
Mode | mode_ |
|
Precision | precision_ |
|
bool | use_sse_if_available_ |
|
Filter | filter_ |
|
Interface for factor 2 resampling classes
◆ Resampler2()
PANDA_RESAMPLER_FN PandaResampler::Resampler2::Resampler2 |
( |
Mode |
mode, |
|
|
uint |
ratio, |
|
|
Precision |
precision, |
|
|
bool |
use_sse_if_available = true , |
|
|
Filter |
filter = FILTER_FIR |
|
) |
| |
creates a resampler instance fulfilling a given specification
◆ delay()
double PandaResampler::Resampler2::delay |
( |
| ) |
const |
|
inline |
Return the delay introduced by the resampler. This delay is guaranteed to be >= 0.0, and for factor 2 resampling always a multiple of 0.5 (1.0 for upsampling).
The return value can also be thought of as index into the output signal, where the first input sample can be found.
Beware of fractional delays, for instance for downsampling, a delay() of 10.5 means that the first input sample would be found by interpolating output[10] and output[11], and the second input sample equates output[11].
◆ find_precision_for_bits()
PANDA_RESAMPLER_FN Resampler2::Precision PandaResampler::Resampler2::find_precision_for_bits |
( |
uint |
bits | ) |
|
|
static |
finds a precision which is appropriate for at least the specified number of bits
◆ order()
uint PandaResampler::Resampler2::order |
( |
| ) |
const |
|
inline |
◆ precision_name()
PANDA_RESAMPLER_FN const char * PandaResampler::Resampler2::precision_name |
( |
Precision |
precision | ) |
|
|
static |
returns a human-readable name for a given precision
◆ process_block()
void PandaResampler::Resampler2::process_block |
( |
const float * |
input, |
|
|
uint |
n_input_samples, |
|
|
float * |
output |
|
) |
| |
|
inline |
◆ reset()
void PandaResampler::Resampler2::reset |
( |
| ) |
|
|
inline |
clear internal history, reset resampler state to zero values
◆ sse_available()
PANDA_RESAMPLER_FN bool PandaResampler::Resampler2::sse_available |
( |
| ) |
|
|
static |
returns true if an optimized SSE version of the Resampler is available
◆ sse_enabled()
bool PandaResampler::Resampler2::sse_enabled |
( |
| ) |
const |
|
inline |
return whether the resampler is using sse optimized code
◆ test_filter_impl()
PANDA_RESAMPLER_FN bool PandaResampler::Resampler2::test_filter_impl |
( |
bool |
verbose | ) |
|
|
static |
test internal filter implementation
The documentation for this class was generated from the following files: