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