![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
No photo version of "F746_SpectralAnalysis_Example".
Dependencies: BSP_DISCO_F746NG BUTTON_GROUP LCD_DISCO_F746NG TS_DISCO_F746NG UIT_FFT_Real mbed
SpactrumAnalysisClasses/LPC_Analysis.hpp@0:9d7f931c704a, 2015-11-24 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Tue Nov 24 12:34:55 2015 +0000
- Revision:
- 0:9d7f931c704a
1
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 0:9d7f931c704a | 1 | //--------------------------------------------------------------- |
MikamiUitOpen | 0:9d7f931c704a | 2 | // Class for spectrum analysis using linear prediction (Header) |
MikamiUitOpen | 0:9d7f931c704a | 3 | // Copyright (c) 2014 MIKAMI, Naoki, 2014/12/30 |
MikamiUitOpen | 0:9d7f931c704a | 4 | //--------------------------------------------------------------- |
MikamiUitOpen | 0:9d7f931c704a | 5 | |
MikamiUitOpen | 0:9d7f931c704a | 6 | #ifndef LPC_ANALYZER_HPP |
MikamiUitOpen | 0:9d7f931c704a | 7 | #define LPC_ANALYZER_HPP |
MikamiUitOpen | 0:9d7f931c704a | 8 | |
MikamiUitOpen | 0:9d7f931c704a | 9 | #include "fftReal.hpp" |
MikamiUitOpen | 0:9d7f931c704a | 10 | #include "Hamming.hpp" |
MikamiUitOpen | 0:9d7f931c704a | 11 | #include "LinearPrediction.hpp" |
MikamiUitOpen | 0:9d7f931c704a | 12 | |
MikamiUitOpen | 0:9d7f931c704a | 13 | namespace Mikami |
MikamiUitOpen | 0:9d7f931c704a | 14 | { |
MikamiUitOpen | 0:9d7f931c704a | 15 | class LpcAnalyzer |
MikamiUitOpen | 0:9d7f931c704a | 16 | { |
MikamiUitOpen | 0:9d7f931c704a | 17 | public: |
MikamiUitOpen | 0:9d7f931c704a | 18 | LpcAnalyzer(int nData, int order, int nFft); |
MikamiUitOpen | 0:9d7f931c704a | 19 | ~LpcAnalyzer(); |
MikamiUitOpen | 0:9d7f931c704a | 20 | void Execute(float xn[], float db[]); |
MikamiUitOpen | 0:9d7f931c704a | 21 | private: |
MikamiUitOpen | 0:9d7f931c704a | 22 | const int N_DATA_; |
MikamiUitOpen | 0:9d7f931c704a | 23 | const int ORDER_; |
MikamiUitOpen | 0:9d7f931c704a | 24 | const int N_FFT_; |
MikamiUitOpen | 0:9d7f931c704a | 25 | |
MikamiUitOpen | 0:9d7f931c704a | 26 | HammingWindow hm_; |
MikamiUitOpen | 0:9d7f931c704a | 27 | LinearPred lp_; |
MikamiUitOpen | 0:9d7f931c704a | 28 | FftReal fft_; |
MikamiUitOpen | 0:9d7f931c704a | 29 | |
MikamiUitOpen | 0:9d7f931c704a | 30 | float* xData_; // Data to be analyzed |
MikamiUitOpen | 0:9d7f931c704a | 31 | float* an_; |
MikamiUitOpen | 0:9d7f931c704a | 32 | float* xFft_; // Input for FFT |
MikamiUitOpen | 0:9d7f931c704a | 33 | Complex* yFft_; // Output of FFT |
MikamiUitOpen | 0:9d7f931c704a | 34 | float* normY_; // Powerspectrum |
MikamiUitOpen | 0:9d7f931c704a | 35 | |
MikamiUitOpen | 0:9d7f931c704a | 36 | float Sqr(float x) { return x*x; } |
MikamiUitOpen | 0:9d7f931c704a | 37 | }; |
MikamiUitOpen | 0:9d7f931c704a | 38 | } |
MikamiUitOpen | 0:9d7f931c704a | 39 | #endif // LPC_ANALYZER_HPP |
MikamiUitOpen | 0:9d7f931c704a | 40 |