fft.h

来自「基2FFT」· C头文件 代码 · 共 49 行

H
49
字号
#ifndef __FFT_H__
#define __FFT_H__

/**
 *  Pi for fft, float type.
 */
#define PI 3.14159265358979323846

/*  Complex type.
 */
typedef struct {
    float rex, imx;
} Complex;

/**
 *  Decimation-in-Time Complex FFT Algorithm with Radix-2.
 *  Note:
 *    L   : exponent value of 2, N = 2^L.
 *    cin : input complex array.
 *    cout: output complex array.
 */
void cfftr2( const int L, 
             const Complex *cin, Complex *cout);
/**
 *  in reverse FFT.
 */
void cifftr2(const int L,
             const Complex *cin, Complex *cout);
/**
 *  DFT Algorithm, with arbitrary N point.
 *  Note: slow but sample, useful in verify other FFT algorithm.
 */
void dft(const int N, 
         const Complex cin[], Complex cout[]);

/**
 *  Bit reverse sort, use reverse addition.
 */
void revsort(const int N, 
             const Complex cin[], Complex cout[]);

/**
 *  Calculate the module and Normalize by LEVER.
 */
void module(const Complex cin[], 
            float pout[], const int N, const int LEVER);

#endif //__FFT_H__

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?