CW Decoder (Morse code decoder) 1st release version. mbed = 131 revision (Not latest) is used. Only run on DISCO-F746NG mbed board.

Dependencies:   BSP_DISCO_F746NG F746_GUI F746_SAI_IO LCD_DISCO_F746NG TS_DISCO_F746NG UIT_FFT_Real mbed

Base on F746_Spectrogram program created by 不韋 呂-san.
/users/MikamiUitOpen/code/F746_Spectrogram/
Thanks 不韋 呂-san to use fundamental parts such as FFT, SAI, GUI and other useful subroutines.
You do NOT need any modification for mbed hardware and NO additional circuits.
The mbed board read CW tone from your receiver speaker via MEMES microphone (on board) and show it on the screen.

MySpectrogram/AnalysisBase.hpp

Committer:
kenjiArai
Date:
2017-02-05
Revision:
0:e608fc311e4e

File content as of revision 0:e608fc311e4e:

//-------------------------------------------------------
//  Base abstract class for spectrum analysis (Header)
//
//  2016/07/23, Copyright (c) 2016 MIKAMI, Naoki
//-------------------------------------------------------

#ifndef BASE_ANALYZER_HPP
#define BASE_ANALYZER_HPP

#include "Array.hpp"
#include "fftReal.hpp"
#include "Hamming.hpp"

namespace Mikami
{
    class AnalyzerBase
    {
    public:
        // nData: Number of data to be analyzed
        // nFft:  Number of FFT points
        // nUse:  FFT, cepstrum: window width + zero padding
        //        Linear prediction: window width
        AnalyzerBase(int nData, int nFft, int nUse);
        virtual ~AnalyzerBase() {}
        void Execute(const float xn[], float db[]);

    protected:
        const int N_DATA_;
        const int N_FFT_;

        FftReal fft_;
                
        float Norm(Complex x)
        { return x.real()*x.real() + x.imag()*x.imag(); }

    private:
        HammingWindow wHm_;

        Array<float> xData_;    // data to be analyzed
        Array<float> wData_;    // windowd data

        virtual void Analyze(const float wData[], float db[]) = 0;

        // disallow copy constructor and assignment operator
        AnalyzerBase(const AnalyzerBase& );
        AnalyzerBase& operator=(const AnalyzerBase& );
    };
}
#endif  // BASE_ANALYZER_HPP