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