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
Base on F446_MySoundMachine program created by 不韋 呂-san.
Thanks to 不韋 呂-san making fundamental part such as FFT and ADC high speed interrupt driven program.
I just combined LCD and show CW code.
MySpectrogram/Hamming.hpp
- Committer:
- kenjiArai
- Date:
- 2017-02-05
- Revision:
- 6:5e21ac9f0550
File content as of revision 6:5e21ac9f0550:
//------------------------------------------------------------------- // Hamming windowing with zero-padding // // 2016/07/23, Copyright (c) 2016 MIKAMI, Naoki //------------------------------------------------------------------- #ifndef HAMMING_WINDOW_HPP #define HAMMING_WINDOW_HPP #include "mbed.h" #include "Array.hpp" namespace Mikami { class HammingWindow { public: // Constructor HammingWindow(uint16_t nData, uint16_t nFft) : N_(nData), NFFT_(nFft), w_(nData) { float pi2L = 6.283185f/(float)nData; for (int k=0; k<nData; k++) w_[k] = 0.54f - 0.46f*cosf(k*pi2L); } // Destructor virtual ~HammingWindow() {} // Windowing void Execute(const float x[], float y[]) { for (int n=0; n<N_; n++) y[n] = x[n]*w_[n]; for (int n=N_; n<NFFT_; n++) y[n] = 0; } private: const int N_; const int NFFT_; Array<float> w_; // disallow copy constructor and assignment operator HammingWindow(const HammingWindow& ); HammingWindow& operator=(const HammingWindow& ); }; } #endif // HAMMING_WINDOW_HPP