From ba9179c7991eeaf1b8d59a0db3975f049b2735b7 Mon Sep 17 00:00:00 2001 From: Roland Stigge Date: Sun, 27 Jan 2019 13:32:40 +0100 Subject: Added half FFT and magnitudes --- fft.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 fft.h (limited to 'fft.h') diff --git a/fft.h b/fft.h new file mode 100644 index 0000000..f2b7038 --- /dev/null +++ b/fft.h @@ -0,0 +1,34 @@ +// FFT + +#pragma once + +#include +#include + +namespace RIT { + +class FFT { +private: + int mSize; + std::vector order; + std::vector> expLUT; + + bool mFlagHalfOnly; + +public: + FFT(int size, bool halfOnly = false); + std::vector> operator()(const std::vector> &v); + + FFT& SetHalfOnly(bool enable); + +private: + int bitreverse(int i); + + void reorder(const std::vector>& src, std::vector>& dst); + void fft_recursive(std::vector>::iterator X, int N); + void fft_half(std::vector>::iterator X, int N); +}; // class FFT + +std::vector magnitudes(std::vector>& v); + +} // namespace RIT -- cgit v1.2.3