CW Decoder (Morse code decoder) 1st release version. Only run on Nucleo-F446RE mbed board.
Dependencies: Array_Matrix F446_AD_DA ST7565_SPI_LCD TextLCD UIT_FFT_Real
Fork of F446_MySoundMachine by
AnalysisBase.hpp
00001 //------------------------------------------------------- 00002 // Base abstract class for spectrum analysis (Header) 00003 // 00004 // 2016/07/23, Copyright (c) 2016 MIKAMI, Naoki 00005 //------------------------------------------------------- 00006 00007 #ifndef BASE_ANALYZER_HPP 00008 #define BASE_ANALYZER_HPP 00009 00010 #include "Array.hpp" 00011 #include "fftReal.hpp" 00012 #include "Hamming.hpp" 00013 00014 namespace Mikami 00015 { 00016 class AnalyzerBase 00017 { 00018 public: 00019 // nData: Number of data to be analyzed 00020 // nFft: Number of FFT points 00021 // nUse: FFT, cepstrum: window width + zero padding 00022 // Linear prediction: window width 00023 AnalyzerBase(int nData, int nFft, int nUse); 00024 virtual ~AnalyzerBase() {} 00025 void Execute(const float xn[], float db[]); 00026 00027 protected: 00028 const int N_DATA_; 00029 const int N_FFT_; 00030 00031 FftReal fft_; 00032 00033 float Norm(Complex x) 00034 { return x.real()*x.real() + x.imag()*x.imag(); } 00035 00036 private: 00037 HammingWindow wHm_; 00038 00039 Array<float> xData_; // data to be analyzed 00040 Array<float> wData_; // windowd data 00041 00042 virtual void Analyze(const float wData[], float db[]) = 0; 00043 00044 // disallow copy constructor and assignment operator 00045 AnalyzerBase(const AnalyzerBase& ); 00046 AnalyzerBase& operator=(const AnalyzerBase& ); 00047 }; 00048 } 00049 #endif // BASE_ANALYZER_HPP 00050
Generated on Wed Jul 13 2022 10:18:38 by 1.7.2