resamp_rrrf
Variants: resamp_cccf, resamp_crcf, resamp_rrrf
Arbitrary rate resampler, implemented as a polyphase filterbank
Public Functions
resamp_rrrf | resamp_rrrf_create( |
resamp_rrrf | resamp_rrrf_create_default( |
resamp_rrrf | resamp_rrrf_copy( |
int | resamp_rrrf_destroy( |
int | resamp_rrrf_print( |
int | resamp_rrrf_reset( |
unsigned int | resamp_rrrf_get_delay( |
int | resamp_rrrf_set_scale( |
int | resamp_rrrf_get_scale( |
int | resamp_rrrf_set_rate( |
float | resamp_rrrf_get_rate( |
int | resamp_rrrf_adjust_rate( |
int | resamp_rrrf_set_timing_phase( |
int | resamp_rrrf_adjust_timing_phase( |
unsigned int | resamp_rrrf_get_num_output( |
int | resamp_rrrf_execute( |
int | resamp_rrrf_execute_block( |
Interfaces
resamp_rrrf resamp_rrrf_create(
Create arbitrary resampler object from filter prototype
- _rate : arbitrary resampling rate, 0 < _rate
- _m : filter semi-length (delay), 0 < _m
- _fc : filter cutoff frequency, 0 < _fc < 0.5
- _as : filter stop-band attenuation [dB], 0 < _as
- _npfb : number of filters in the bank, 0 < _npfb
resamp_rrrf resamp_rrrf_create_default(
Create arbitrary resampler object with a specified input resampling rate and default parameters. This is a simplified method to provide a basic resampler with a baseline set of parameters, abstracting away some of the complexities with the filterbank design. The default parameters are m = 7 (filter semi-length), fc = min(0.49,_rate/2) (filter cutoff frequency), as = 60 dB (filter stop-band attenuation), and npfb = 64 (number of filters in the bank).
- _rate : arbitrary resampling rate, 0 < _rate
resamp_rrrf resamp_rrrf_copy(
Copy object including all internal objects and state
int resamp_rrrf_destroy(
Destroy arbitrary resampler object, freeing all internal memory
int resamp_rrrf_print(
Print resamp object internals to stdout
int resamp_rrrf_reset(
Reset resamp object internals
unsigned int resamp_rrrf_get_delay(
Get resampler delay (filter semi-length \(m\))
int resamp_rrrf_set_scale(
Set output scaling for resampler
- _q : resampler object
- _scale : scaling factor to apply to each output sample
int resamp_rrrf_get_scale(
Get output scaling for resampler
- _q : resampler object
- _scale : scaling factor to apply to each output sample
int resamp_rrrf_set_rate(
Set rate of arbitrary resampler
- _q : resampling object
- _rate : new sampling rate, 0 < _rate
float resamp_rrrf_get_rate(
Get rate of arbitrary resampler
int resamp_rrrf_adjust_rate(
adjust rate of arbitrary resampler
- _q : resampling object
- _gamma : rate adjustment factor: rate <- rate * gamma, 0 < _gamma
int resamp_rrrf_set_timing_phase(
Set resampling timing phase
- _q : resampling object
- _tau : sample timing phase, -1 <= _tau <= 1
int resamp_rrrf_adjust_timing_phase(
Adjust resampling timing phase
- _q : resampling object
- _delta : sample timing adjustment, -1 <= _delta <= 1
unsigned int resamp_rrrf_get_num_output(
Get the number of output samples given current state and input buffer size.
- _q : resampling object
- _num_input : number of input samples
int resamp_rrrf_execute(
Execute arbitrary resampler on a single input sample and store the resulting samples in the output array. The number of output samples depends upon the resampling rate but will be at most \( \lceil{ r \rceil} \) samples.
- _q : resamp object
- _x : single input sample
- _y : output sample array (pointer)
- _num_written : number of samples written to _y
int resamp_rrrf_execute_block(
Execute arbitrary resampler on a block of input samples and store the resulting samples in the output array. The number of output samples depends upon the resampling rate and the number of input samples but will be at most \( \lceil{ r n_x \rceil} \) samples.
- _q : resamp object
- _x : input buffer, shape: (_nx, 1)
- _nx : input buffer
- _y : output sample array (pointer)
- _ny : number of samples written to _y