No photo version of "F746_SpectralAnalysis_Example".

Dependencies:   BSP_DISCO_F746NG BUTTON_GROUP LCD_DISCO_F746NG TS_DISCO_F746NG UIT_FFT_Real mbed

Revision:
0:9d7f931c704a
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SpactrumAnalysisClasses/FFT_Analysis.hpp	Tue Nov 24 12:34:55 2015 +0000
@@ -0,0 +1,38 @@
+//-------------------------------------------------------
+// Class for spectrum analysis using FFT (Header)
+// Copyright (c) 2015 MIKAMI, Naoki,  2015/10/26
+//-------------------------------------------------------
+
+#ifndef FFT_ANALYZER_HPP
+#define FFT_ANALYZER_HPP
+
+#include "fftReal.hpp"
+#include "Hamming.hpp"
+
+namespace Mikami
+{
+    class FftAnalyzer
+    {
+    public:
+        FftAnalyzer(int nData, int nFft);
+        ~FftAnalyzer();
+        void Execute(float xn[], float db[]);
+
+    private:
+        const int N_DATA_;
+        const int N_FFT_;
+
+        HammingWindow hm_;
+        FftReal fft_;
+
+        float* xData;   // Data to be analyzed
+        float* xFft;    // Input for FFT
+        Complex* yFft;  // Output of FFT
+        float* normY;   // Powerspectrum
+
+        float Sqr(float x) { return x*x; }
+    };
+}
+
+#endif  // FFT_ANALYZER_HPP
+