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/AnalysisBase.cpp@6:5e21ac9f0550, 2017-02-05 (annotated)
- Committer:
- kenjiArai
- Date:
- Sun Feb 05 08:02:54 2017 +0000
- Revision:
- 6:5e21ac9f0550
CW Decoder (Morse code decoder) 1st release version. Only run on Nucleo-F446RE mbed board.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kenjiArai | 6:5e21ac9f0550 | 1 | //------------------------------------------------------- |
kenjiArai | 6:5e21ac9f0550 | 2 | // Base abstract class for spectrum analysis |
kenjiArai | 6:5e21ac9f0550 | 3 | // |
kenjiArai | 6:5e21ac9f0550 | 4 | // 2016/07/23, Copyright (c) 2016 MIKAMI, Naoki |
kenjiArai | 6:5e21ac9f0550 | 5 | //------------------------------------------------------- |
kenjiArai | 6:5e21ac9f0550 | 6 | |
kenjiArai | 6:5e21ac9f0550 | 7 | #include "AnalysisBase.hpp" |
kenjiArai | 6:5e21ac9f0550 | 8 | |
kenjiArai | 6:5e21ac9f0550 | 9 | namespace Mikami |
kenjiArai | 6:5e21ac9f0550 | 10 | { |
kenjiArai | 6:5e21ac9f0550 | 11 | AnalyzerBase::AnalyzerBase(int nData, int nFft, int nUse) |
kenjiArai | 6:5e21ac9f0550 | 12 | : N_DATA_(nData), N_FFT_(nFft), |
kenjiArai | 6:5e21ac9f0550 | 13 | fft_(nFft), wHm_(nData-1, nUse), |
kenjiArai | 6:5e21ac9f0550 | 14 | xData_(nUse), wData_(nUse) {} |
kenjiArai | 6:5e21ac9f0550 | 15 | |
kenjiArai | 6:5e21ac9f0550 | 16 | void AnalyzerBase::Execute(const float xn[], float db[]) |
kenjiArai | 6:5e21ac9f0550 | 17 | { |
kenjiArai | 6:5e21ac9f0550 | 18 | // Differencing |
kenjiArai | 6:5e21ac9f0550 | 19 | for (int n=0; n<N_DATA_-1; n++) |
kenjiArai | 6:5e21ac9f0550 | 20 | xData_[n] = xn[n+1] - 0.8f*xn[n]; |
kenjiArai | 6:5e21ac9f0550 | 21 | |
kenjiArai | 6:5e21ac9f0550 | 22 | // Windowing |
kenjiArai | 6:5e21ac9f0550 | 23 | wHm_.Execute(xData_, wData_); |
kenjiArai | 6:5e21ac9f0550 | 24 | |
kenjiArai | 6:5e21ac9f0550 | 25 | Analyze(wData_, db); |
kenjiArai | 6:5e21ac9f0550 | 26 | } |
kenjiArai | 6:5e21ac9f0550 | 27 | } |