// -------------------------------------------------------------- #ifndef NCO_H #define NCO_H #include #include "radio_types.h" #include "real.h" #include "cpx.h" // -------------------------------------------------------------- // Types // -------------------------------------------------------------- typedef struct _nco_t { radio_float_t phi, omega; cpx_t state; } nco_t; // -------------------------------------------------------------- #ifdef __cplusplus extern "C" { #endif // -------------------------------------------------------------- // NCO // -------------------------------------------------------------- // Scalar version void NCO_Init(nco_t *pObj, radio_float_t omega, radio_float_t phi); void NCO_Free(nco_t *pObj); void NCO_Reinit(nco_t *pObj, radio_float_t omega, radio_float_t phi); void NCO_SetOmega(nco_t *pObj, radio_float_t omega); void NCO_SetPhi(nco_t *pObj, radio_float_t phi); radio_float_t NCO_GetOmega(nco_t *pObj); radio_float_t NCO_GetPhi(nco_t *pObj); void NCO_Process(nco_t *pObj, radio_float_t dOmega, radio_float_t dPhi); // -------------------------------------------------------------- // Mixer // Scalar version // -------------------------------------------------------------- cpx_t NCO_MixRealComplexS(nco_t *pObj, radio_float_t src, radio_float_t gain); cpx_t NCO_MixComplexS(nco_t *pObj, cpx_t src, cpx_t gain); radio_float_t NCO_MixComplexRealS(nco_t *pObj, cpx_t src, cpx_t gain); // -------------------------------------------------------------- // Mixer // Vector version // -------------------------------------------------------------- void NCO_MixRealComplexV(nco_t *pObj, cpx_t *pDst, radio_float_t *pSrc, radio_float_t gain, uint32_t len); void NCO_MixComplexV(nco_t *pObj, cpx_t *pSrcDst, cpx_t gain, uint32_t len); void NCO_MixComplexRealV(nco_t *pObj, radio_float_t *pDst, cpx_t *pSrc, cpx_t gain, uint32_t len); // -------------------------------------------------------------- #ifdef __cplusplus } #endif // __cplusplus // -------------------------------------------------------------- #endif // NCO_H