resamp_cccf

Variants: resamp_cccf, resamp_crcf, resamp_rrrf

Arbitrary rate resampler, implemented as a polyphase filterbank

Public Functions

resamp_cccf resamp_cccf_create(float _rate, unsigned int _m, float _fc, float _as, unsigned int _npfb)
resamp_cccf resamp_cccf_create_default(float _rate)
resamp_cccf resamp_cccf_copy(resamp_cccf _q)
int resamp_cccf_destroy(resamp_cccf _q)
int resamp_cccf_print(resamp_cccf _q)
int resamp_cccf_reset(resamp_cccf _q)
unsigned int resamp_cccf_get_delay(resamp_cccf _q)
int resamp_cccf_set_scale(resamp_cccf _q, float complex _scale)
int resamp_cccf_get_scale(resamp_cccf _q, float complex * _scale)
int resamp_cccf_set_rate(resamp_cccf _q, float _rate)
float resamp_cccf_get_rate(resamp_cccf _q)
int resamp_cccf_adjust_rate(resamp_cccf _q, float _gamma)
int resamp_cccf_set_timing_phase(resamp_cccf _q, float _tau)
int resamp_cccf_adjust_timing_phase(resamp_cccf _q, float _delta)
unsigned int resamp_cccf_get_num_output(resamp_cccf _q, unsigned int _num_input)
int resamp_cccf_execute(resamp_cccf _q, float complex _x, float complex * _y, unsigned int * _num_written)
int resamp_cccf_execute_block(resamp_cccf _q, float complex * _x, unsigned int _nx, float complex * _y, unsigned int * _ny)

Interfaces

resamp_cccf resamp_cccf_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_cccf resamp_cccf_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_cccf resamp_cccf_copy(resamp_cccf _q)

Copy object including all internal objects and state

int resamp_cccf_destroy(resamp_cccf _q)

Destroy arbitrary resampler object, freeing all internal memory

int resamp_cccf_print(resamp_cccf _q)

Print resamp object internals to stdout

int resamp_cccf_reset(resamp_cccf _q)

Reset resamp object internals

unsigned int resamp_cccf_get_delay(resamp_cccf _q)

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

int resamp_cccf_set_scale(resamp_cccf _q, float complex _scale)

Set output scaling for resampler

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

int resamp_cccf_get_scale(resamp_cccf _q, float complex * _scale)

Get output scaling for resampler

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

int resamp_cccf_set_rate(resamp_cccf _q, float _rate)

Set rate of arbitrary resampler

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

float resamp_cccf_get_rate(resamp_cccf _q)

Get rate of arbitrary resampler

int resamp_cccf_adjust_rate(resamp_cccf _q, float _gamma)

adjust rate of arbitrary resampler

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

int resamp_cccf_set_timing_phase(resamp_cccf _q, float _tau)

Set resampling timing phase

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

int resamp_cccf_adjust_timing_phase(resamp_cccf _q, float _delta)

Adjust resampling timing phase

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

unsigned int resamp_cccf_get_num_output(resamp_cccf _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_cccf_execute(resamp_cccf _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_cccf_execute_block(resamp_cccf _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