Copyright (C) Kevin Larke 2009-2020

This file is part of libcm.

libcm is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

libcm is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

See the GNU General Public License distributed with the libcm package or look here: .


cmComplexTypes : Constants and functions used for working with complex values.

#if CM_FLOAT_SMP == 1

#define cmCabsS  cabsf
#define cmCatanS catanf
#define cmCrealS crealf
#define cmCimagS cimagf 
#define cmCargS  cargf
#define cmCconjS conjf

#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
#define cmCconjS conj

#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 #define cmCconjR conjf #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 #define cmCconjR conj #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 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 ); void cmVOCR_MultVS( cmComplexR_t* y, cmReal_t v, unsigned n ); void cmVOCR_DivVS( cmComplexR_t* y, cmReal_t v, unsigned n );