RISC-V/V203F6P6/disco/fft.h
2025-02-11 14:22:40 +01:00

29 lines
834 B
C++

// fft.h - declaration of class
// of fast Fourier transform - FFT
//
#ifndef _FFT_H_
#define _FFT_H_
// Include Complex numbers header
#include "config.h"
#include "complex.h"
class IFFT {
static constexpr unsigned int M = FFTORDER, N = 1u << FFTORDER;
public:
explicit IFFT () noexcept;
bool Forward (complex * const Data) const;
bool Inverse (complex * const Data) const;
void Precompute ();
protected:
void Rearrange (complex * const Data) const;
void Perform (complex * const Data, const bool Inverse = false) const;
void PrecomputeOrder ();
void PrecomputeOnes ();
private:
const unsigned short * const reverse;
const complex * const ones;
};
extern void CopyToComplex (complex * dst, const unsigned short * src, const unsigned len);
#endif