resamp_crcf

Variants: resamp_cccf, resamp_crcf, resamp_rrrf

Arbitrary rate resampler, implemented as a polyphase filterbank

Public Functions

resamp_crcf resamp_crcf_create(float _rate, unsigned int _m, float _fc, float _as, unsigned int _npfb)
resamp_crcf resamp_crcf_create_default(float _rate)
resamp_crcf resamp_crcf_copy(resamp_crcf _q)
int resamp_crcf_destroy(resamp_crcf _q)
int resamp_crcf_print(resamp_crcf _q)
int resamp_crcf_reset(resamp_crcf _q)
unsigned int resamp_crcf_get_delay(resamp_crcf _q)
int resamp_crcf_set_scale(resamp_crcf _q, float _scale)
int resamp_crcf_get_scale(resamp_crcf _q, float * _scale)
int resamp_crcf_set_rate(resamp_crcf _q, float _rate)
float resamp_crcf_get_rate(resamp_crcf _q)
int resamp_crcf_adjust_rate(resamp_crcf _q, float _gamma)
int resamp_crcf_set_timing_phase(resamp_crcf _q, float _tau)
int resamp_crcf_adjust_timing_phase(resamp_crcf _q, float _delta)
unsigned int resamp_crcf_get_num_output(resamp_crcf _q, unsigned int _num_input)
int resamp_crcf_execute(resamp_crcf _q, float complex _x, float complex * _y, unsigned int * _num_written)
int resamp_crcf_execute_block(resamp_crcf _q, float complex * _x, unsigned int _nx, float complex * _y, unsigned int * _ny)

Interfaces

resamp_crcf resamp_crcf_create(float _rate, unsigned int _m, float _fc, float _as, unsigned int _npfb)

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_crcf resamp_crcf_create_default(float _rate)

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_crcf resamp_crcf_copy(resamp_crcf _q)

Copy object including all internal objects and state

int resamp_crcf_destroy(resamp_crcf _q)

Destroy arbitrary resampler object, freeing all internal memory

int resamp_crcf_print(resamp_crcf _q)

Print resamp object internals to stdout

int resamp_crcf_reset(resamp_crcf _q)

Reset resamp object internals

unsigned int resamp_crcf_get_delay(resamp_crcf _q)

Get resampler delay (filter semi-length \(m\))

int resamp_crcf_set_scale(resamp_crcf _q, float _scale)

Set output scaling for resampler

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

int resamp_crcf_get_scale(resamp_crcf _q, float * _scale)

Get output scaling for resampler

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

int resamp_crcf_set_rate(resamp_crcf _q, float _rate)

Set rate of arbitrary resampler

  • _q : resampling object
  • _rate : new sampling rate, 0 < _rate

float resamp_crcf_get_rate(resamp_crcf _q)

Get rate of arbitrary resampler

int resamp_crcf_adjust_rate(resamp_crcf _q, float _gamma)

adjust rate of arbitrary resampler

  • _q : resampling object
  • _gamma : rate adjustment factor: rate <- rate * gamma, 0 < _gamma

int resamp_crcf_set_timing_phase(resamp_crcf _q, float _tau)

Set resampling timing phase

  • _q : resampling object
  • _tau : sample timing phase, -1 <= _tau <= 1

int resamp_crcf_adjust_timing_phase(resamp_crcf _q, float _delta)

Adjust resampling timing phase

  • _q : resampling object
  • _delta : sample timing adjustment, -1 <= _delta <= 1

unsigned int resamp_crcf_get_num_output(resamp_crcf _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 resamp_crcf_execute(resamp_crcf _q, float complex _x, float complex * _y, unsigned int * _num_written)

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_crcf_execute_block(resamp_crcf _q, float complex * _x, unsigned int _nx, float complex * _y, unsigned int * _ny)

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