Realtime sound spectrogram using FFT or linear prediction. Spectrogram is displayed on the display of PC. リアルタイム・スペクトログラム.解析の手法:FFT,線形予測法.スペクトログラムは PC のディスプレー装置に表示される.PC 側のプログラム:F446_Spectrogram.

Dependencies:   Array_Matrix mbed SerialTxRxIntr F446_AD_DA UIT_FFT_Real

Revision:
0:a539141b9dec
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MySpectrogram/LinearPrediction.hpp	Fri Feb 17 04:55:10 2017 +0000
@@ -0,0 +1,37 @@
+//-----------------------------------------------------
+//  Class for linear prediction (Header)
+//
+//  2017/02/11, Copyright (c) 2017 MIKAMI, Naoki
+//-----------------------------------------------------
+
+#ifndef LINEAR_PREDICTION_HPP
+#define LINEAR_PREDICTION_HPP
+
+#include "Array.hpp"
+
+namespace Mikami
+{
+    class LinearPred
+    {
+    public:
+        LinearPred(int nData, int order);
+        ~LinearPred() {}
+        bool Execute(const float x[], float a[], float &em);
+    private:
+        const uint16_t N_DATA_;
+
+        uint16_t order_;
+
+        Array<float> r_;    // for auto-correlation
+        Array<float> k_;    // for PARCOR coefficients
+        Array<float> am_;   // working area
+
+        void AutoCorr(const float x[]);
+        bool Durbin(float a[], float &em);
+
+        // disallow copy constructor and assignment operator
+        LinearPred(const LinearPred& );
+        LinearPred& operator=(const LinearPred& );
+    };
+}
+#endif  // LINEAR_PREDICTION_HPP