Realtime spectrogram for DISCO-F746NG. On-board MEMS microphone is used for input sound signal. リアルタイムスペクトログラム.入力:MEMSマイク
Dependencies: F746_GUI F746_SAI_IO UIT_FFT_Real
MyClasses_Functions/AnalysisBase.cpp
- Committer:
- MikamiUitOpen
- Date:
- 2016-05-22
- Revision:
- 0:9470a174c910
- Child:
- 2:1f092ac020e1
File content as of revision 0:9470a174c910:
//------------------------------------------------------- // Base class for spectrum analysis // // 2016/05/14, Copyright (c) 2015 MIKAMI, Naoki //------------------------------------------------------- #include "AnalysisBase.hpp" namespace Mikami { AnalyzerBase::AnalyzerBase(int nData, int nFft, int nUse) : N_DATA_(nData), N_FFT_(nFft), fft_(nFft), wHm_(nData-1, nUse), xData_(new float[nUse]), wData_(new float[nUse]) {} AnalyzerBase::~AnalyzerBase() { delete[] xData_; } void AnalyzerBase::Execute(const float xn[], float db[]) { // Differencing for (int n=0; n<N_DATA_-1; n++) xData_[n] = xn[n+1] - 0.8f*xn[n]; // Windowing (FFT, cepstrum: + zero-padding) wHm_.Execute(xData_, wData_); // Pure virtual function for analyzing Analyze(wData_, db); } }