msresamp_rrrf

Multi-stage half-band resampler, implemented as cascaded dyadic (half-band) polyphase filter banks followed by an arbitrary rate resampler for interpolation and decimation.

Variants: msresamp_cccf, msresamp_crcf, msresamp_rrrf

Public Functions

msresamp_rrrf msresamp_rrrf_create(float _r, float _as)
msresamp_rrrf msresamp_rrrf_copy(msresamp_rrrf _q)
int msresamp_rrrf_destroy(msresamp_rrrf _q)
int msresamp_rrrf_print(msresamp_rrrf _q)
int msresamp_rrrf_reset(msresamp_rrrf _q)
float msresamp_rrrf_get_delay(msresamp_rrrf _q)
float msresamp_rrrf_get_rate(msresamp_rrrf _q)
unsigned int msresamp_rrrf_get_num_output(msresamp_rrrf _q, unsigned int _num_input)
int msresamp_rrrf_execute(msresamp_rrrf _q, float * _x, unsigned int _nx, float * _y, unsigned int * _ny)

Interfaces

msresamp_rrrf msresamp_rrrf_create(float _r, float _as)

Create multi-stage arbitrary resampler

  • _r : resampling rate (output/input), 0 < _r
  • _as : stop-band attenuation [dB], 0 < _as

msresamp_rrrf msresamp_rrrf_copy(msresamp_rrrf _q)

Copy object including all internal objects and state

int msresamp_rrrf_destroy(msresamp_rrrf _q)

Destroy multi-stage arbitrary resampler

int msresamp_rrrf_print(msresamp_rrrf _q)

Print msresamp object internals to stdout

int msresamp_rrrf_reset(msresamp_rrrf _q)

Reset msresamp object internal state

float msresamp_rrrf_get_delay(msresamp_rrrf _q)

Get filter delay (output samples)

float msresamp_rrrf_get_rate(msresamp_rrrf _q)

get overall resampling rate

unsigned int msresamp_rrrf_get_num_output(msresamp_rrrf _q, unsigned int _num_input)

Get the number of output samples given current state and input buffer size.

  • _q : resampling object
  • _num_input : number of input samples

int msresamp_rrrf_execute(msresamp_rrrf _q, float * _x, unsigned int _nx, float * _y, unsigned int * _ny)

Execute multi-stage resampler on one or more input samples. The number of output samples is dependent upon the resampling rate and the number of input samples. In general it is good practice to allocate at least \( \lceil{ 1 + 2 r n_x \rceil} \) samples in the output array to avoid overflows.

  • _q : msresamp object
  • _x : input sample array, shape: (_nx, 1)
  • _nx : input sample array size
  • _y : pointer to output array for storing result
  • _ny : number of samples written to _y