RSeries astromech firmware
CTFFT.h File Reference
#include <math.h>
+ Include dependency graph for CTFFT.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  CTFFT::CosTable< T, nbits >
 
struct  CTFFT::CosTable< T, nbits >::Data< NUMBITS >
 
struct  CTFFT::Complex< T >
 
class  CTFFT::FourierTransform< T, SIZE, CT >
 
class  CTFFT::RealDiscrete< T, SIZE >
 

Namespaces

 CTFFT
 

Macros

#define CTFFT_MINIMAL   0
 
#define READ_COS(x)   x
 
#define CTFFT_MAXBITS   19
 
#define CTFFT_COSTABLE_CONSTRUCTOR   Data
 
#define CTFFT_COSTABLE_CONSTEXPR
 
#define DECLARE_COSTABLE(nb)
 
#define BF(x, y, a, b)
 
#define CMUL(dre, dim, are, aim, bre, bim)
 
#define BUTTERFLIES(a0, a1, a2, a3)
 
#define BUTTERFLIES_BIG(a0, a1, a2, a3)
 
#define TRANSFORM(a0, a1, a2, a3, wre, wim)
 
#define TRANSFORM_ZERO(a0, a1, a2, a3)
 
#define RDFT_UNMANGLE(sign0, sign1)
 

Functions

constexpr unsigned CTFFT::log2 (unsigned x)
 

Variables

constexpr long double CTFFT::pi = 3.1415926535897932384626433832795028841972L
 
constexpr long double CTFFT::sqrt1_2 = 1.4142135623730950488016887242096980785697L/2
 

Macro Definition Documentation

◆ BF

#define BF (   x,
  y,
  a,
 
)
Value:
do { \
x = a - b; \
y = a + b; \
} while (0)

◆ BUTTERFLIES

#define BUTTERFLIES (   a0,
  a1,
  a2,
  a3 
)
Value:
{\
BF(t3, t5, t5, t1);\
BF(a2.real, a0.real, a0.real, t5);\
BF(a3.img, a1.img, a1.img, t3);\
BF(t4, t6, t2, t6);\
BF(a3.real, a1.real, a1.real, t4);\
BF(a2.img, a0.img, a0.img, t6);\
}

◆ BUTTERFLIES_BIG

#define BUTTERFLIES_BIG (   a0,
  a1,
  a2,
  a3 
)
Value:
{\
T r0=a0.real, i0=a0.img, r1=a1.real, i1=a1.img;\
BF(t3, t5, t5, t1);\
BF(a2.real, a0.real, r0, t5);\
BF(a3.img, a1.img, i1, t3);\
BF(t4, t6, t2, t6);\
BF(a3.real, a1.real, r1, t4);\
BF(a2.img, a0.img, i0, t6);\
}

◆ CMUL

#define CMUL (   dre,
  dim,
  are,
  aim,
  bre,
  bim 
)
Value:
do { \
(dre) = (are) * (bre) - (aim) * (bim); \
(dim) = (are) * (bim) + (aim) * (bre); \
} while (0)

◆ CTFFT_COSTABLE_CONSTEXPR

#define CTFFT_COSTABLE_CONSTEXPR

◆ CTFFT_COSTABLE_CONSTRUCTOR

#define CTFFT_COSTABLE_CONSTRUCTOR   Data

◆ CTFFT_MAXBITS

#define CTFFT_MAXBITS   19

◆ CTFFT_MINIMAL

#define CTFFT_MINIMAL   0

◆ DECLARE_COSTABLE

#define DECLARE_COSTABLE (   nb)
Value:
if (nbits >= nb && !tables[nb-4]) \
{ \
static const CTFFT_COSTABLE_CONSTEXPR Data<nb> table_ = Data<nb>(); \
tables[nb-4] = table_.sample; \
}

◆ RDFT_UNMANGLE

#define RDFT_UNMANGLE (   sign0,
  sign1 
)
Value:
for (i = 1; i < (n>>2); i++) \
{ \
int i1 = 2*i; \
int i2 = n-i1; \
/* Separate even and odd FFTs */ \
ev.real = k1*(data[i1 ]+data[i2 ]); \
od.img = k2*(data[i2 ]-data[i1 ]); \
ev.img = k1*(data[i1+1]-data[i2+1]); \
od.real = k2*(data[i1+1]+data[i2+1]); \
/* Apply twiddle factors to the odd FFT and add to the even FFT */ \
odsum.real = od.real* READ_COS(tcos[i]) sign0 od.img * READ_COS(tsin[i]);\
odsum.img = od.img * READ_COS(tcos[i]) sign1 od.real* READ_COS(tsin[i]);\
data[i1 ] = ev.real + odsum.real; \
data[i1+1] = ev.img + odsum.img; \
data[i2 ] = ev.real - odsum.real; \
data[i2+1] = odsum.img - ev.img; \
}

◆ READ_COS

#define READ_COS (   x)    x

◆ TRANSFORM

#define TRANSFORM (   a0,
  a1,
  a2,
  a3,
  wre,
  wim 
)
Value:
{\
CMUL(t1, t2, a2.real, a2.img, wre, -wim);\
CMUL(t5, t6, a3.real, a3.img, wre, wim);\
BUTTERFLIES(a0,a1,a2,a3)\
}

◆ TRANSFORM_ZERO

#define TRANSFORM_ZERO (   a0,
  a1,
  a2,
  a3 
)
Value:
{\
t1 = a2.real;\
t2 = a2.img;\
t5 = a3.real;\
t6 = a3.img;\
BUTTERFLIES(a0,a1,a2,a3)\
}
READ_COS
#define READ_COS(x)
Definition: CTFFT.h:37
CTFFT_COSTABLE_CONSTEXPR
#define CTFFT_COSTABLE_CONSTEXPR
Definition: CTFFT.h:90