firfilt_cccf

Finite impulse response (FIR) filter

Variants: firfilt_cccf, firfilt_crcf, firfilt_rrrf

Public Functions

firfilt_cccf firfilt_cccf_create(float complex * _h, unsigned int _n)
firfilt_cccf firfilt_cccf_create_kaiser(unsigned int _n, float _fc, float _as, float _mu)
firfilt_cccf firfilt_cccf_create_rnyquist(int _type, unsigned int _k, unsigned int _m, float _beta, float _mu)
firfilt_cccf firfilt_cccf_create_firdespm(unsigned int _h_len, float _fc, float _as)
firfilt_cccf firfilt_cccf_create_rect(unsigned int _n)
firfilt_cccf firfilt_cccf_create_dc_blocker(unsigned int _m, float _as)
firfilt_cccf firfilt_cccf_create_notch(unsigned int _m, float _as, float _f0)
firfilt_cccf firfilt_cccf_recreate(firfilt_cccf _q, float complex * _h, unsigned int _n)
firfilt_cccf firfilt_cccf_copy(firfilt_cccf _q)
int firfilt_cccf_destroy(firfilt_cccf _q)
int firfilt_cccf_reset(firfilt_cccf _q)
int firfilt_cccf_print(firfilt_cccf _q)
int firfilt_cccf_set_scale(firfilt_cccf _q, float complex _scale)
int firfilt_cccf_get_scale(firfilt_cccf _q, float complex * _scale)
int firfilt_cccf_push(firfilt_cccf _q, float complex _x)
int firfilt_cccf_write(firfilt_cccf _q, float complex * _x, unsigned int _n)
int firfilt_cccf_execute(firfilt_cccf _q, float complex * _y)
int firfilt_cccf_execute_one(firfilt_cccf _q, float complex _x, float complex * _y)
int firfilt_cccf_execute_block(firfilt_cccf _q, float complex * _x, unsigned int _n, float complex * _y)
unsigned int firfilt_cccf_get_length(firfilt_cccf _q)
const float complex * firfilt_cccf_get_coefficients(firfilt_cccf _q)
int firfilt_cccf_copy_coefficients(firfilt_cccf _q, float complex * _h)
int firfilt_cccf_freqresponse(firfilt_cccf _q, float _fc, float complex * _H)
float firfilt_cccf_groupdelay(firfilt_cccf _q, float _fc)

Interfaces

firfilt_cccf firfilt_cccf_create(float complex * _h, unsigned int _n)

Create a finite impulse response filter (firfilt) object by directly specifying the filter coefficients in an array

  • _h : filter coefficients, shape: (_n, 1)
  • _n : number of filter coefficients, 0 < _n

firfilt_cccf firfilt_cccf_create_kaiser(unsigned int _n, float _fc, float _as, float _mu)

Create object using Kaiser-Bessel windowed sinc method

  • _n : filter length, 0 < _n
  • _fc : filter normalized cut-off frequency, 0 < _fc < 0.5
  • _as : filter stop-band attenuation [dB], 0 < _as
  • _mu : fractional sample offset, -0.5 < _mu < 0.5

firfilt_cccf firfilt_cccf_create_rnyquist(int _type, unsigned int _k, unsigned int _m, float _beta, float _mu)

Create object from square-root Nyquist prototype. The filter length will be \(2 k m + 1 \) samples long with a delay of \( k m + 1 \) samples.

  • _type : filter type (e.g. LIQUID_FIRFILT_RRC)
  • _k : nominal samples per symbol, 1 < _k
  • _m : filter delay [symbols], 0 < _m
  • _beta : rolloff factor, 0 < beta <= 1
  • _mu : fractional sample offset [samples], -0.5 < _mu < 0.5

firfilt_cccf firfilt_cccf_create_firdespm(unsigned int _h_len, float _fc, float _as)

Create object from Parks-McClellan algorithm prototype

  • _h_len : filter length, 0 < _h_len
  • _fc : cutoff frequency, 0 < _fc < 0.5
  • _as : stop-band attenuation [dB], 0 < _as

firfilt_cccf firfilt_cccf_create_rect(unsigned int _n)

Create rectangular filter prototype; that is \( \vec{h} = \{ 1, 1, 1, \ldots 1 \} \)

  • _n : length of filter [samples], 0 < _n <= 1024

firfilt_cccf firfilt_cccf_create_dc_blocker(unsigned int _m, float _as)

Create DC blocking filter from prototype

  • _m : prototype filter semi-length such that filter length is 2*m+1
  • _as : prototype filter stop-band attenuation [dB], 0 < _as

firfilt_cccf firfilt_cccf_create_notch(unsigned int _m, float _as, float _f0)

Create notch filter from prototype

  • _m : prototype filter semi-length such that filter length is 2*m+1
  • _as : prototype filter stop-band attenuation [dB], 0 < _as
  • _f0 : center frequency for notch, _fc in [-0.5, 0.5]

firfilt_cccf firfilt_cccf_recreate(firfilt_cccf _q, float complex * _h, unsigned int _n)

Re-create filter object of potentially a different length with different coefficients. If the length of the filter does not change, not memory reallocation is invoked.

  • _q : original filter object
  • _h : pointer to filter coefficients, shape: (_n, 1)
  • _n : filter length, 0 < _n

firfilt_cccf firfilt_cccf_copy(firfilt_cccf _q)

Copy object including all internal objects and state

int firfilt_cccf_destroy(firfilt_cccf _q)

Destroy filter object and free all internal memory

int firfilt_cccf_reset(firfilt_cccf _q)

Reset filter object's internal buffer

int firfilt_cccf_print(firfilt_cccf _q)

Print filter object information to stdout

int firfilt_cccf_set_scale(firfilt_cccf _q, float complex _scale)

Set output scaling for filter

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

int firfilt_cccf_get_scale(firfilt_cccf _q, float complex * _scale)

Get output scaling for filter

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

int firfilt_cccf_push(firfilt_cccf _q, float complex _x)

Push sample into filter object's internal buffer

  • _q : filter object
  • _x : single input sample

int firfilt_cccf_write(firfilt_cccf _q, float complex * _x, unsigned int _n)

Write block of samples into filter object's internal buffer

  • _q : filter object
  • _x : buffer of input samples, shape: (_n, 1)
  • _n : number of input samples

int firfilt_cccf_execute(firfilt_cccf _q, float complex * _y)

Execute vector dot product on the filter's internal buffer and coefficients

  • _q : filter object
  • _y : pointer to single output sample

int firfilt_cccf_execute_one(firfilt_cccf _q, float complex _x, float complex * _y)

Execute filter on one sample, equivalent to push() and execute()

  • _q : filter object
  • _x : single input sample
  • _y : pointer to single output sample

int firfilt_cccf_execute_block(firfilt_cccf _q, float complex * _x, unsigned int _n, float complex * _y)

Execute the filter on a block of input samples; in-place operation is permitted (_x and _y may point to the same place in memory)

  • _q : filter object
  • _x : pointer to input array, shape: (_n, 1)
  • _n : number of input, output samples
  • _y : pointer to output array, shape: (_n, 1)

unsigned int firfilt_cccf_get_length(firfilt_cccf _q)

Get length of filter object (number of internal coefficients)

const float complex * firfilt_cccf_get_coefficients(firfilt_cccf _q)

Get pointer to coefficients array

int firfilt_cccf_copy_coefficients(firfilt_cccf _q, float complex * _h)

Copy internal coefficients to external buffer

  • _q : filter object
  • _h : pointer to output coefficients array, shape: (_n, 1)

int firfilt_cccf_freqresponse(firfilt_cccf _q, float _fc, float complex * _H)

Compute complex frequency response of filter object

  • _q : filter object
  • _fc : normalized frequency for evaluation
  • _H : pointer to output complex frequency response

float firfilt_cccf_groupdelay(firfilt_cccf _q, float _fc)

Compute and return group delay of filter object

  • _q : filter object
  • _fc : frequency to evaluate