Files
radio/nco.h
T
jens 290fd5f5e0 Initial import
git-svn-id: http://moon:8086/svn/software/trunk/libsrc/radio@1 b431acfa-c32f-4a4a-93f1-934dc6c82436
2014-07-19 07:44:42 +00:00

58 lines
2.1 KiB
C
Executable File

// --------------------------------------------------------------
#ifndef NCO_H
#define NCO_H
#include <stdint.h>
#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