PandA-2024.02
Macros | Functions
fft.c File Reference
#include "fft.h"
Include dependency graph for fft.c:

Go to the source code of this file.

Macros

#define THREADS   64
 
#define cmplx_M_x(a_x, a_y, b_x, b_y)   (a_x*b_x - a_y *b_y)
 
#define cmplx_M_y(a_x, a_y, b_x, b_y)   (a_x*b_y + a_y *b_x)
 
#define cmplx_MUL_x(a_x, a_y, b_x, b_y)   (a_x*b_x - a_y*b_y)
 
#define cmplx_MUL_y(a_x, a_y, b_x, b_y)   (a_x*b_y + a_y*b_x)
 
#define cmplx_mul_x(a_x, a_y, b_x, b_y)   (a_x*b_x - a_y*b_y)
 
#define cmplx_mul_y(a_x, a_y, b_x, b_y)   (a_x*b_y + a_y*b_x)
 
#define cmplx_add_x(a_x, b_x)   (a_x + b_x)
 
#define cmplx_add_y(a_y, b_y)   (a_y + b_y)
 
#define cmplx_sub_x(a_x, b_x)   (a_x - b_x)
 
#define cmplx_sub_y(a_y, b_y)   (a_y - b_y)
 
#define cm_fl_mul_x(a_x, b)   (b*a_x)
 
#define cm_fl_mul_y(a_y, b)   (b*a_y)
 
#define FF2(a0_x, a0_y, a1_x, a1_y)
 
#define FFT4(a0_x, a0_y, a1_x, a1_y, a2_x, a2_y, a3_x, a3_y)
 
#define FFT8(a_x, a_y)
 

Functions

void twiddles8 (TYPE a_x[8], TYPE a_y[8], int i, int n)
 
void loadx8 (TYPE a_x[], TYPE x[], int offset, int sx)
 
void loady8 (TYPE a_y[], TYPE x[], int offset, int sx)
 
void fft1D_512 (TYPE work_x[512], TYPE work_y[512])
 

Macro Definition Documentation

◆ cm_fl_mul_x

#define cm_fl_mul_x (   a_x,
 
)    (b*a_x)

Definition at line 20 of file fft.c.

◆ cm_fl_mul_y

#define cm_fl_mul_y (   a_y,
 
)    (b*a_y)

Definition at line 21 of file fft.c.

◆ cmplx_add_x

#define cmplx_add_x (   a_x,
  b_x 
)    (a_x + b_x)

Definition at line 16 of file fft.c.

◆ cmplx_add_y

#define cmplx_add_y (   a_y,
  b_y 
)    (a_y + b_y)

Definition at line 17 of file fft.c.

◆ cmplx_M_x

#define cmplx_M_x (   a_x,
  a_y,
  b_x,
  b_y 
)    (a_x*b_x - a_y *b_y)

Definition at line 10 of file fft.c.

Referenced by twiddles8().

◆ cmplx_M_y

#define cmplx_M_y (   a_x,
  a_y,
  b_x,
  b_y 
)    (a_x*b_y + a_y *b_x)

Definition at line 11 of file fft.c.

Referenced by twiddles8().

◆ cmplx_MUL_x

#define cmplx_MUL_x (   a_x,
  a_y,
  b_x,
  b_y 
)    (a_x*b_x - a_y*b_y)

Definition at line 12 of file fft.c.

◆ cmplx_mul_x

#define cmplx_mul_x (   a_x,
  a_y,
  b_x,
  b_y 
)    (a_x*b_x - a_y*b_y)

Definition at line 14 of file fft.c.

◆ cmplx_MUL_y

#define cmplx_MUL_y (   a_x,
  a_y,
  b_x,
  b_y 
)    (a_x*b_y + a_y*b_x)

Definition at line 13 of file fft.c.

◆ cmplx_mul_y

#define cmplx_mul_y (   a_x,
  a_y,
  b_x,
  b_y 
)    (a_x*b_y + a_y*b_x)

Definition at line 15 of file fft.c.

◆ cmplx_sub_x

#define cmplx_sub_x (   a_x,
  b_x 
)    (a_x - b_x)

Definition at line 18 of file fft.c.

◆ cmplx_sub_y

#define cmplx_sub_y (   a_y,
  b_y 
)    (a_y - b_y)

Definition at line 19 of file fft.c.

◆ FF2

#define FF2 (   a0_x,
  a0_y,
  a1_x,
  a1_y 
)
Value:
{ \
TYPE c0_x = *a0_x; \
TYPE c0_y = *a0_y; \
*a0_x = cmplx_add_x(c0_x, *a1_x); \
*a0_y = cmplx_add_y(c0_y, *a1_y); \
*a1_x = cmplx_sub_x(c0_x, *a1_x); \
*a1_y = cmplx_sub_y(c0_y, *a1_y); \
}
#define cmplx_add_x(a_x, b_x)
Definition: fft.c:16
#define cmplx_add_y(a_y, b_y)
Definition: fft.c:17
#define cmplx_sub_x(a_x, b_x)
Definition: fft.c:18
#define cmplx_sub_y(a_y, b_y)
Definition: fft.c:19

Definition at line 39 of file fft.c.

◆ FFT4

#define FFT4 (   a0_x,
  a0_y,
  a1_x,
  a1_y,
  a2_x,
  a2_y,
  a3_x,
  a3_y 
)
Value:
{ \
TYPE exp_1_44_x; \
TYPE exp_1_44_y; \
TYPE tmp; \
exp_1_44_x = 0.0; \
exp_1_44_y = -1.0; \
FF2( a0_x, a0_y, a2_x, a2_y); \
FF2( a1_x, a1_y, a3_x, a3_y); \
tmp = *a3_x; \
*a3_x = *a3_x*exp_1_44_x-*a3_y*exp_1_44_y; \
*a3_y = tmp*exp_1_44_y - *a3_y*exp_1_44_x; \
FF2( a0_x, a0_y, a1_x, a1_y ); \
FF2( a2_x, a2_y, a3_x, a3_y ); \
}

Definition at line 48 of file fft.c.

◆ FFT8

#define FFT8 (   a_x,
  a_y 
)
Value:
{ \
TYPE exp_1_8_x, exp_1_4_x, exp_3_8_x; \
TYPE exp_1_8_y, exp_1_4_y, exp_3_8_y; \
TYPE tmp_1; \
exp_1_8_x = 1; \
exp_1_8_y = -1; \
exp_1_4_x = 0; \
exp_1_4_y = -1; \
exp_3_8_x = -1; \
exp_3_8_y = -1; \
FF2( &a_x[0], &a_y[0], &a_x[4], &a_y[4]); \
FF2( &a_x[1], &a_y[1], &a_x[5], &a_y[5]); \
FF2( &a_x[2], &a_y[2], &a_x[6], &a_y[6]); \
FF2( &a_x[3], &a_y[3], &a_x[7], &a_y[7]); \
tmp_1 = a_x[5]; \
a_x[5] = cm_fl_mul_x( cmplx_mul_x(a_x[5], a_y[5], exp_1_8_x, exp_1_8_y), M_SQRT1_2 ); \
a_y[5] = cm_fl_mul_y( cmplx_mul_y(tmp_1, a_y[5], exp_1_8_x, exp_1_8_y) , M_SQRT1_2 ); \
tmp_1 = a_x[6]; \
a_x[6] = cmplx_mul_x( a_x[6], a_y[6], exp_1_4_x , exp_1_4_y); \
a_y[6] = cmplx_mul_y( tmp_1, a_y[6], exp_1_4_x , exp_1_4_y); \
tmp_1 = a_x[7]; \
a_x[7] = cm_fl_mul_x( cmplx_mul_x(a_x[7], a_y[7], exp_3_8_x, exp_3_8_y), M_SQRT1_2 ); \
a_y[7] = cm_fl_mul_y( cmplx_mul_y(tmp_1, a_y[7], exp_3_8_x, exp_3_8_y) , M_SQRT1_2 ); \
FFT4( &a_x[0], &a_y[0], &a_x[1], &a_y[1], &a_x[2], &a_y[2], &a_x[3], &a_y[3] ); \
FFT4( &a_x[4], &a_y[4], &a_x[5], &a_y[5], &a_x[6], &a_y[6], &a_x[7], &a_y[7] ); \
}
#define cm_fl_mul_x(a_x, b)
Definition: fft.c:20
#define cm_fl_mul_y(a_y, b)
Definition: fft.c:21
#define M_SQRT1_2
Definition: fft.h:20
#define cmplx_mul_x(a_x, a_y, b_x, b_y)
Definition: fft.c:14
#define cmplx_mul_y(a_x, a_y, b_x, b_y)
Definition: fft.c:15

Definition at line 63 of file fft.c.

Referenced by fft1D_512().

◆ THREADS

#define THREADS   64

Definition at line 9 of file fft.c.

Referenced by fft1D_512().

Function Documentation

◆ fft1D_512()

void fft1D_512 ( TYPE  work_x[512],
TYPE  work_y[512] 
)

Definition at line 113 of file fft.c.

References FFT8, loady8(), offset, THREADS, twiddles8(), and TYPE.

Referenced by main(), and run_benchmark().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ loadx8()

void loadx8 ( TYPE  a_x[],
TYPE  x[],
int  offset,
int  sx 
)

Definition at line 91 of file fft.c.

References offset.

◆ loady8()

void loady8 ( TYPE  a_y[],
TYPE  x[],
int  offset,
int  sx 
)

Definition at line 102 of file fft.c.

References offset.

Referenced by fft1D_512().

Here is the caller graph for this function:

◆ twiddles8()

void twiddles8 ( TYPE  a_x[8],
TYPE  a_y[8],
int  i,
int  n 
)

Definition at line 23 of file fft.c.

References cmplx_M_x, cmplx_M_y, phi, PI, and TYPE.

Referenced by fft1D_512().

Here is the caller graph for this function:

Generated on Mon Feb 12 2024 13:03:10 for PandA-2024.02 by doxygen 1.8.13