Realtime spectrum analyzer. Using FFT, linear prediction, or cepstrum smoothing. Version using MEMS microphone and CODEC, named "F746_RealtimeSpectrumAnalyzer_MEMS_Mic" is registered. リアルタイム スペクトル解析器.解析の手法:FFT,線形予測法,ケプストラムによる平滑化の3種類.このプログラムの説明は,CQ出版社のインターフェース誌,2016年4月号に掲載.外付けのマイクまたは他の信号源等を A0 に接続する.線形予測法,ケプストラムは,スペクトル解析の対象を音声信号に想定してパラメータを設定している.MEMS マイクと CODEC を使ったバージョンを "F746_RealtimeSpectrumAnalyzer_MEMS_Mic" として登録.

Dependencies:   BSP_DISCO_F746NG BUTTON_GROUP LCD_DISCO_F746NG TS_DISCO_F746NG UIT_FFT_Real mbed

MyClasses/CepstrumAnalysis.hpp

Committer:
MikamiUitOpen
Date:
2016-02-22
Revision:
18:6630d61aeb3c
Parent:
5:98ec9dd54144

File content as of revision 18:6630d61aeb3c:

//-------------------------------------------------------
//  Class for spectrum analysis using cepstrum (Header)
//
//  2015/12/15, Copyright (c) 2015 MIKAMI, Naoki
//-------------------------------------------------------

#ifndef CEPSTRUM_ANALYZER_HPP
#define CEPSTRUM_ANALYZER_HPP

#include "AnalysisBase.hpp"


namespace Mikami
{
    class CepstrumAnalyzer : public AnalyzerBase
    {
    public:
        CepstrumAnalyzer(int nData, int nFft, int nLifter);
        virtual ~CepstrumAnalyzer();

    private:
        const int N_LIFTER_;

        Complex* yFft_;     // output of FFT
        float* lifter_;     // lifter
        Complex* db_;       // real part: log spectrun
        float* cep_;        // cepstrum
        float* cepLft_;     // liftered cepstrum
        Complex* cepFt_;    // smoothed spectrum

        virtual void Analyze(const float xn[], float yn[]);

        // disallow copy constructor and assignment operator
        CepstrumAnalyzer(const CepstrumAnalyzer& );
        CepstrumAnalyzer& operator=(const CepstrumAnalyzer& );
    };
}
#endif  // CEPSTRUM_ANALYZER_HPP