resamp2_rrrf

Variants: resamp2_cccf, resamp2_crcf, resamp2_rrrf

Half-band resampler, implemented as a dyadic (half-band) polyphase filter bank for interpolation, decimation, synthesis, and analysis.

Public Functions

resamp2_rrrf resamp2_rrrf_create(unsigned int _m, float _f0, float _as)
resamp2_rrrf resamp2_rrrf_recreate(resamp2_rrrf _q, unsigned int _m, float _f0, float _as)
resamp2_rrrf resamp2_rrrf_copy(resamp2_rrrf _q)
int resamp2_rrrf_destroy(resamp2_rrrf _q)
int resamp2_rrrf_print(resamp2_rrrf _q)
int resamp2_rrrf_reset(resamp2_rrrf _q)
unsigned int resamp2_rrrf_get_delay(resamp2_rrrf _q)
int resamp2_rrrf_set_scale(resamp2_rrrf _q, float _scale)
int resamp2_rrrf_get_scale(resamp2_rrrf _q, float * _scale)
int resamp2_rrrf_filter_execute(resamp2_rrrf _q, float _x, float * _y0, float * _y1)
int resamp2_rrrf_analyzer_execute(resamp2_rrrf _q, float * _x, float * _y)
int resamp2_rrrf_synthesizer_execute(resamp2_rrrf _q, float * _x, float * _y)
int resamp2_rrrf_decim_execute(resamp2_rrrf _q, float * _x, float * _y)
int resamp2_rrrf_interp_execute(resamp2_rrrf _q, float _x, float * _y)

Interfaces

resamp2_rrrf resamp2_rrrf_create(unsigned int _m, float _f0, float _as)

Create half-band resampler from design prototype.

  • _m : filter semi-length (h_len = 4*m+1), 2 <= _m
  • _f0 : filter center frequency, -0.5 <= _f0 <= 0.5
  • _as : stop-band attenuation [dB], 0 < _as

resamp2_rrrf resamp2_rrrf_recreate(resamp2_rrrf _q, unsigned int _m, float _f0, float _as)

Re-create half-band resampler with new properties

  • _q : original half-band resampler object
  • _m : filter semi-length (h_len = 4*m+1), 2 <= _m
  • _f0 : filter center frequency, -0.5 <= _f0 <= 0.5
  • _as : stop-band attenuation [dB], 0 < _as

resamp2_rrrf resamp2_rrrf_copy(resamp2_rrrf _q)

Copy object including all internal objects and state

int resamp2_rrrf_destroy(resamp2_rrrf _q)

Destroy resampler, freeing all internally-allocated memory

int resamp2_rrrf_print(resamp2_rrrf _q)

print resampler object's internals to stdout

int resamp2_rrrf_reset(resamp2_rrrf _q)

Reset internal buffer

unsigned int resamp2_rrrf_get_delay(resamp2_rrrf _q)

Get resampler filter delay (semi-length m)

int resamp2_rrrf_set_scale(resamp2_rrrf _q, float _scale)

Get output scaling for resampler

  • _q : resampler object
  • _scale : scaling factor to apply to each output sample

int resamp2_rrrf_get_scale(resamp2_rrrf _q, float * _scale)

Get output scaling for resampler

  • _q : resampler object
  • _scale : scaling factor applied to each output sample

int resamp2_rrrf_filter_execute(resamp2_rrrf _q, float _x, float * _y0, float * _y1)

Execute resampler as half-band filter for a single input sample \(x\) where \(y_0\) is the output of the effective low-pass filter, and \(y_1\) is the output of the effective high-pass filter.

  • _q : resampler object
  • _x : input sample
  • _y0 : output sample pointer (low frequency)
  • _y1 : output sample pointer (high frequency)

int resamp2_rrrf_analyzer_execute(resamp2_rrrf _q, float * _x, float * _y)

Execute resampler as half-band analysis filterbank on a pair of sequential time-domain input samples. The decimated outputs of the low- and high-pass equivalent filters are stored in \(y_0\) and \(y_1\), respectively.

  • _q : resampler object
  • _x : input array, shape: (2, 1)
  • _y : output array, shape: (2, 1)

int resamp2_rrrf_synthesizer_execute(resamp2_rrrf _q, float * _x, float * _y)

Execute resampler as half-band synthesis filterbank on a pair of input samples. The low- and high-pass input samples are provided by \(x_0\) and \(x_1\), respectively. The sequential time-domain output samples are stored in \(y_0\) and \(y_1\).

  • _q : resampler object
  • _x : input array, shape: (2, 1)
  • _y : output array, shape: (2, 1)

int resamp2_rrrf_decim_execute(resamp2_rrrf _q, float * _x, float * _y)

Execute resampler as half-band decimator on a pair of sequential time-domain input samples.

  • _q : resampler object
  • _x : input array, shape: (2, 1)
  • _y : output sample pointer

int resamp2_rrrf_interp_execute(resamp2_rrrf _q, float _x, float * _y)

Execute resampler as half-band interpolator on a single input sample

  • _q : resampler object
  • _x : input sample
  • _y : output array, shape: (2, 1)