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:
6:c38ec7939609
Parent:
0:a539141b9dec
--- a/MySpectrogram/AnalyzerBase.cpp	Sun Oct 07 05:15:04 2018 +0000
+++ b/MySpectrogram/AnalyzerBase.cpp	Sun Nov 04 10:41:02 2018 +0000
@@ -1,7 +1,7 @@
 //-------------------------------------------------------
 //  Base abstract class for spectrum analysis
 //
-//  2017/02/09, Copyright (c) 2017 MIKAMI, Naoki
+//  2018/11/04, Copyright (c) 2018 MIKAMI, Naoki
 //-------------------------------------------------------
 
 #include "AnalyzerBase.hpp"
@@ -18,7 +18,13 @@
         // 高域強調
         for (int n=0; n<N_DATA_-1; n++)
             xData_[n] = xn[n+1] - b1_*xn[n];
-            
+
+        // 直流分を除去
+        float sum = 0;
+        for (int n=0; n<N_FFT_; n++) sum = sum + xData_[n];
+        float ave = sum/N_FFT_;
+        for (int n=0; n<N_FFT_; n++) xData_[n] = xData_[n] - ave;
+
         // 窓掛け
         wHm_.Execute(xData_, wData_);