2012-10-30 03:52:39 +00:00
|
|
|
#ifndef cmComplexTypes_h
|
|
|
|
#define cmComplexTypes_h
|
|
|
|
|
2015-11-16 19:59:27 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2012-10-30 03:52:39 +00:00
|
|
|
#include <complex.h>
|
|
|
|
#include <fftw3.h>
|
|
|
|
|
2015-11-16 19:59:27 +00:00
|
|
|
//( { file_desc: "Constants and functions used for working with complex values." kw:[base math] }
|
|
|
|
|
2012-10-30 03:52:39 +00:00
|
|
|
#if CM_FLOAT_SMP == 1
|
|
|
|
|
|
|
|
#define cmCabsS cabsf
|
|
|
|
#define cmCatanS catanf
|
|
|
|
#define cmCrealS crealf
|
|
|
|
#define cmCimagS cimagf
|
|
|
|
#define cmCargS cargf
|
2015-07-16 22:58:55 +00:00
|
|
|
#define cmCconjS conjf
|
2012-10-30 03:52:39 +00:00
|
|
|
|
|
|
|
#define cmFftPlanAllocS fftwf_plan_dft_r2c_1d
|
|
|
|
#define cmFft1dPlanAllocS fftwf_plan_dft_1d
|
|
|
|
#define cmIFftPlanAllocS fftwf_plan_dft_c2r_1d
|
|
|
|
#define cmFftPlanFreeS fftwf_destroy_plan
|
|
|
|
#define cmFftMallocS fftwf_malloc
|
|
|
|
#define cmFftFreeMemS fftwf_free
|
|
|
|
#define cmFftExecuteS fftwf_execute
|
|
|
|
|
|
|
|
typedef fftwf_plan cmFftPlanS_t;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define cmCabsS cabs
|
|
|
|
#define cmCatanS catan
|
|
|
|
#define cmCrealS creal
|
|
|
|
#define cmCimagS cimag
|
|
|
|
#define cmCargS carg
|
2015-07-16 22:58:55 +00:00
|
|
|
#define cmCconjS conj
|
2012-10-30 03:52:39 +00:00
|
|
|
|
|
|
|
#define cmFftPlanAllocS fftw_plan_dft_r2c_1d
|
|
|
|
#define cmFft1dPlanAllocS fftw_plan_dft_1d
|
|
|
|
#define cmIFftPlanAllocS fftw_plan_dft_c2r_1d
|
|
|
|
#define cmFftPlanFreeS fftw_destroy_plan
|
|
|
|
#define cmFftMallocS fftw_malloc
|
|
|
|
#define cmFftFreeMemS fftw_free
|
|
|
|
#define cmFftExecuteS fftw_execute
|
|
|
|
|
|
|
|
typedef fftw_plan cmFftPlanS_t;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------
|
|
|
|
//-----------------------------------------------------------------
|
|
|
|
|
|
|
|
#if CM_FLOAT_REAL == 1
|
|
|
|
|
|
|
|
#define cmCabsR cabsf
|
|
|
|
#define cmCatanR catanf
|
|
|
|
#define cmCrealR crealf
|
|
|
|
#define cmCimagR cimagf
|
|
|
|
#define cmCargR cargf
|
2015-07-16 22:58:55 +00:00
|
|
|
#define cmCconjR conjf
|
2012-10-30 03:52:39 +00:00
|
|
|
|
|
|
|
#define cmFftPlanAllocR fftwf_plan_dft_r2c_1d
|
|
|
|
#define cmFft1dPlanAllocR fftwf_plan_dft_1d
|
|
|
|
#define cmIFftPlanAllocR fftwf_plan_dft_c2r_1d
|
|
|
|
#define cmFftPlanFreeR fftwf_destroy_plan
|
|
|
|
#define cmFftMallocR fftwf_malloc
|
|
|
|
#define cmFftFreeMemR fftwf_free
|
|
|
|
#define cmFftExecuteR fftwf_execute
|
|
|
|
|
|
|
|
typedef fftwf_plan cmFftPlanR_t;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define cmCabsR cabs
|
|
|
|
#define cmCatanR catan
|
|
|
|
#define cmCrealR creal
|
|
|
|
#define cmCimagR cimag
|
|
|
|
#define cmCargR carg
|
2015-07-16 22:58:55 +00:00
|
|
|
#define cmCconjR conj
|
2012-10-30 03:52:39 +00:00
|
|
|
|
|
|
|
#define cmFftPlanAllocR fftw_plan_dft_r2c_1d
|
|
|
|
#define cmFft1dPlanAllocR fftw_plan_dft_1d
|
|
|
|
#define cmIFftPlanAllocR fftw_plan_dft_c2r_1d
|
|
|
|
#define cmFftPlanFreeR fftw_destroy_plan
|
|
|
|
#define cmFftMallocR fftw_malloc
|
|
|
|
#define cmFftFreeMemR fftw_free
|
|
|
|
#define cmFftExecuteR fftw_execute
|
|
|
|
|
|
|
|
typedef fftw_plan cmFftPlanR_t;
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
2015-07-16 22:58:55 +00:00
|
|
|
void cmVOCR_MultVVV( cmComplexR_t* y, const cmComplexS_t* x0, const cmComplexR_t* x1, unsigned n );
|
|
|
|
void cmVOCR_MultVFV( cmComplexR_t* y, const float* x, unsigned n );
|
|
|
|
void cmVOCR_DivVFV( cmComplexR_t* y, const float_t* x, unsigned n );
|
|
|
|
void cmVOCR_Abs( cmSample_t* y, const cmComplexR_t* x, unsigned n );
|
2015-07-03 22:22:08 +00:00
|
|
|
void cmVOCR_MultVS( cmComplexR_t* y, cmReal_t v, unsigned n );
|
|
|
|
void cmVOCR_DivVS( cmComplexR_t* y, cmReal_t v, unsigned n );
|
|
|
|
|
2015-11-16 19:59:27 +00:00
|
|
|
//)
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2015-07-03 22:22:08 +00:00
|
|
|
|
2012-10-30 03:52:39 +00:00
|
|
|
#endif
|