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
Diff: MySpectrogram/AnalyzerBase.cpp
- Revision:
- 0:a539141b9dec
- Child:
- 6:c38ec7939609
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MySpectrogram/AnalyzerBase.cpp Fri Feb 17 04:55:10 2017 +0000 @@ -0,0 +1,27 @@ +//------------------------------------------------------- +// Base abstract class for spectrum analysis +// +// 2017/02/09, Copyright (c) 2017 MIKAMI, Naoki +//------------------------------------------------------- + +#include "AnalyzerBase.hpp" + +namespace Mikami +{ + AnalyzerBase::AnalyzerBase(int nData, int nFft, int nUse) + : N_DATA_(nData), N_FFT_(nFft), + fft_(nFft), wHm_(nData-1, nUse), b1_(1.0f), + xData_(nUse), wData_(nUse) {} + + void AnalyzerBase::Execute(const float xn[], float db[]) + { + // 高域強調 + for (int n=0; n<N_DATA_-1; n++) + xData_[n] = xn[n+1] - b1_*xn[n]; + + // 窓掛け + wHm_.Execute(xData_, wData_); + + Analyze(wData_, db); + } +}