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/LinearPrediction.hpp@5:98ec9dd54144, 2015-12-15 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Tue Dec 15 13:27:07 2015 +0000
- Revision:
- 5:98ec9dd54144
- Parent:
- 4:99d4d5ea06a2
6
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 0:5c237fdcba23 | 1 | //----------------------------------------------------- |
MikamiUitOpen | 0:5c237fdcba23 | 2 | // Class for linear prediction (Header) |
MikamiUitOpen | 0:5c237fdcba23 | 3 | // |
MikamiUitOpen | 4:99d4d5ea06a2 | 4 | // 2015/12/15, Copyright (c) 2015 MIKAMI, Naoki |
MikamiUitOpen | 0:5c237fdcba23 | 5 | //----------------------------------------------------- |
MikamiUitOpen | 0:5c237fdcba23 | 6 | |
MikamiUitOpen | 0:5c237fdcba23 | 7 | #ifndef LINEAR_PREDICTION_HPP |
MikamiUitOpen | 0:5c237fdcba23 | 8 | #define LINEAR_PREDICTION_HPP |
MikamiUitOpen | 0:5c237fdcba23 | 9 | |
MikamiUitOpen | 0:5c237fdcba23 | 10 | #include "mbed.h" |
MikamiUitOpen | 0:5c237fdcba23 | 11 | |
MikamiUitOpen | 0:5c237fdcba23 | 12 | namespace Mikami |
MikamiUitOpen | 0:5c237fdcba23 | 13 | { |
MikamiUitOpen | 0:5c237fdcba23 | 14 | class LinearPred |
MikamiUitOpen | 0:5c237fdcba23 | 15 | { |
MikamiUitOpen | 0:5c237fdcba23 | 16 | public: |
MikamiUitOpen | 0:5c237fdcba23 | 17 | LinearPred(int nData, int order); |
MikamiUitOpen | 0:5c237fdcba23 | 18 | ~LinearPred(); |
MikamiUitOpen | 0:5c237fdcba23 | 19 | bool Execute(const float x[], float a[], float &em); |
MikamiUitOpen | 4:99d4d5ea06a2 | 20 | private: |
MikamiUitOpen | 0:5c237fdcba23 | 21 | const uint16_t N_DATA_; |
MikamiUitOpen | 0:5c237fdcba23 | 22 | const uint16_t ORDER_; |
MikamiUitOpen | 0:5c237fdcba23 | 23 | |
MikamiUitOpen | 0:5c237fdcba23 | 24 | float* r_; // for auto-correlation |
MikamiUitOpen | 0:5c237fdcba23 | 25 | float* k_; // for PARCOR coefficients |
MikamiUitOpen | 0:5c237fdcba23 | 26 | float* am_; // working area |
MikamiUitOpen | 0:5c237fdcba23 | 27 | |
MikamiUitOpen | 0:5c237fdcba23 | 28 | void AutoCorr(const float x[]); |
MikamiUitOpen | 0:5c237fdcba23 | 29 | bool Durbin(float a[], float &em); |
MikamiUitOpen | 4:99d4d5ea06a2 | 30 | |
MikamiUitOpen | 4:99d4d5ea06a2 | 31 | // disallow copy constructor and assignment operator |
MikamiUitOpen | 4:99d4d5ea06a2 | 32 | LinearPred(const LinearPred& ); |
MikamiUitOpen | 4:99d4d5ea06a2 | 33 | LinearPred& operator=(const LinearPred& ); |
MikamiUitOpen | 0:5c237fdcba23 | 34 | }; |
MikamiUitOpen | 0:5c237fdcba23 | 35 | } |
MikamiUitOpen | 0:5c237fdcba23 | 36 | #endif // LINEAR_PREDICTION_HPP |