nco_crcf

Numerically-controlled oscillator object

Public Functions

nco_crcf nco_crcf_create(liquid_ncotype _type)
nco_crcf nco_crcf_copy(nco_crcf _q)
int nco_crcf_destroy(nco_crcf _q)
int nco_crcf_print(nco_crcf _q)
int nco_crcf_reset(nco_crcf _q)
float nco_crcf_get_frequency(nco_crcf _q)
int nco_crcf_set_frequency(nco_crcf _q, float _dtheta)
int nco_crcf_adjust_frequency(nco_crcf _q, float _step)
float nco_crcf_get_phase(nco_crcf _q)
int nco_crcf_set_phase(nco_crcf _q, float _phi)
int nco_crcf_adjust_phase(nco_crcf _q, float _dphi)
void nco_crcf_get_vcodirect_frequency(nco_crcf _q, int* _n, unsigned int* _m)
void nco_crcf_set_vcodirect_frequency(nco_crcf _q, int _n, unsigned int _m)
int nco_crcf_step(nco_crcf _q)
float nco_crcf_sin(nco_crcf _q)
float nco_crcf_cos(nco_crcf _q)
int nco_crcf_sincos(nco_crcf _q, float * _s, float * _c)
int nco_crcf_cexpf(nco_crcf _q, float complex * _y)
int nco_crcf_pll_set_bandwidth(nco_crcf _q, float _bw)
int nco_crcf_pll_step(nco_crcf _q, float _dphi)
int nco_crcf_mix_up(nco_crcf _q, float complex _x, float complex * _y)
int nco_crcf_mix_down(nco_crcf _q, float complex _x, float complex * _y)
int nco_crcf_mix_block_up(nco_crcf _q, float complex * _x, float complex * _y, unsigned int _n)
int nco_crcf_mix_block_down(nco_crcf _q, float complex * _x, float complex * _y, unsigned int _n)

Interfaces

nco_crcf nco_crcf_create(liquid_ncotype _type)

Create nco object with either fixed-point or floating-point phase

  • _type : oscillator type

nco_crcf nco_crcf_copy(nco_crcf _q)

Copy object including all internal objects and state

int nco_crcf_destroy(nco_crcf _q)

Destroy nco object, freeing all internally allocated memory

int nco_crcf_print(nco_crcf _q)

Print nco object internals to stdout

int nco_crcf_reset(nco_crcf _q)

Set phase/frequency to zero and reset the phase-locked loop filter state

float nco_crcf_get_frequency(nco_crcf _q)

Get frequency of nco object in radians per sample

int nco_crcf_set_frequency(nco_crcf _q, float _dtheta)

Set frequency of nco object in radians per sample

  • _q : nco object
  • _dtheta : input frequency [radians/sample]

int nco_crcf_adjust_frequency(nco_crcf _q, float _step)

Adjust frequency of nco object by a step size in radians per sample

  • _q : nco object
  • _step : input frequency step [radians/sample]

float nco_crcf_get_phase(nco_crcf _q)

Get phase of nco object in radians

int nco_crcf_set_phase(nco_crcf _q, float _phi)

Set phase of nco object in radians

  • _q : nco object
  • _phi : input phase of nco object [radians]

int nco_crcf_adjust_phase(nco_crcf _q, float _dphi)

Adjust phase of nco object by a step of \(\Delta \phi\) radians

  • _q : nco object
  • _dphi : input nco object phase adjustment [radians]

void nco_crcf_get_vcodirect_frequency(nco_crcf _q, int* _n, unsigned int* _m)

Get frequency of nco object as fraction of sample rate (n/m)

  • _q : nco object
  • _n : pointer to output multiplier coefficient (normalized)
  • _m : pointer to output divider coefficient (normalized)

void nco_crcf_set_vcodirect_frequency(nco_crcf _q, int _n, unsigned int _m)

Set frequency of nco object as fraction of sample rate (n/m)

  • _q : nco object
  • _n : input multiplier coefficient
  • _m : input divider coefficient

int nco_crcf_step(nco_crcf _q)

Increment phase by internal phase step (frequency)

float nco_crcf_sin(nco_crcf _q)

Compute sine output given internal phase

float nco_crcf_cos(nco_crcf _q)

Compute cosine output given internal phase

int nco_crcf_sincos(nco_crcf _q, float * _s, float * _c)

Compute sine and cosine outputs given internal phase

  • _q : nco object
  • _s : output sine component of phase
  • _c : output cosine component of phase

int nco_crcf_cexpf(nco_crcf _q, float complex * _y)

Compute complex exponential output given internal phase

  • _q : nco object
  • _y : output complex exponential

int nco_crcf_pll_set_bandwidth(nco_crcf _q, float _bw)

Set bandwidth of internal phase-locked loop

  • _q : nco object
  • _bw : input phase-locked loop bandwidth, 0 <= _bw

int nco_crcf_pll_step(nco_crcf _q, float _dphi)

Step internal phase-locked loop given input phase error, adjusting internal phase and frequency proportional to coefficients defined by internal PLL bandwidth

  • _q : nco object
  • _dphi : input phase-locked loop phase error

int nco_crcf_mix_up(nco_crcf _q, float complex _x, float complex * _y)

Rotate input sample up by nco angle. Note that this does not adjust the internal phase or frequency.

  • _q : nco object
  • _x : input complex sample
  • _y : pointer to output sample location

int nco_crcf_mix_down(nco_crcf _q, float complex _x, float complex * _y)

Rotate input sample down by nco angle. Note that this does not adjust the internal phase or frequency.

  • _q : nco object
  • _x : input complex sample
  • _y : pointer to output sample location

int nco_crcf_mix_block_up(nco_crcf _q, float complex * _x, float complex * _y, unsigned int _n)

Rotate input vector up by NCO angle (stepping) Note that this *does* adjust the internal phase as the signal steps through each input sample.

  • _q : nco object
  • _x : array of input samples, shape: (_n, 1)
  • _y : array of output samples, shape: (_n, 1)
  • _n : number of input (and output) samples

int nco_crcf_mix_block_down(nco_crcf _q, float complex * _x, float complex * _y, unsigned int _n)

Rotate input vector down by NCO angle (stepping) Note that this *does* adjust the internal phase as the signal steps through each input sample.

  • _q : nco object
  • _x : array of input samples, shape: (_n, 1)
  • _y : array of output samples, shape: (_n, 1)
  • _n : number of input (and output) samples