![](/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
Diff: SpactrumAnalysisClasses/LPC_Analysis.hpp
- Revision:
- 0:c5b026c2d07e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/SpactrumAnalysisClasses/LPC_Analysis.hpp Sun Jul 26 02:48:23 2015 +0000 @@ -0,0 +1,42 @@ +//--------------------------------------------------------------- +// Class for spectrum analysis using linear prediction (Header) +// Copyright (c) 2014 MIKAMI, Naoki, 2014/12/30 +//--------------------------------------------------------------- + +#ifndef LPC_ANALYZER_HPP +#define LPC_ANALYZER_HPP + +#include "fftReal.hpp" +#include "Hamming.hpp" +#include "PeakHolder.hpp" +#include "LinearPrediction.hpp" + +namespace Mikami +{ + class LpcAnalyzer + { + public: + LpcAnalyzer(int nData, int order, int nFft); + ~LpcAnalyzer(); + void Execute(float xn[], float db[]); + private: + const int N_DATA_; + const int ORDER_; + const int N_FFT_; + + HammingWindow hm_; + LinearPred lp_; + FftReal fft_; + PeakHolder* pkHolder_; + + float* xData_; // Data to be analyzed + float* an_; + float* xFft_; // Input for FFT + Complex* yFft_; // Output of FFT + float* normY_; // Powerspectrum + + float Sqr(float x) { return x*x; } + }; +} +#endif // LPC_ANALYZER_HPP +