Spectrum analyzer using DISCO-F746NG. Spectrum is calculated by FFT or linear prediction. The vowel data is in "vowel_data.hpp"
Dependencies: BSP_DISCO_F746NG LCD_DISCO_F746NG TS_DISCO_F746NG UIT_FFT_Real mbed BUTTON_GROUP
Diff: main.cpp
- Revision:
- 1:2ef356b500f2
- Parent:
- 0:c35b8a23a863
- Child:
- 2:4e34945b5c00
--- a/main.cpp Mon Oct 26 08:06:57 2015 +0000 +++ b/main.cpp Mon Oct 26 13:25:03 2015 +0000 @@ -56,6 +56,7 @@ SpectrumDisplay disp(lcd_, N_FFT_, X0_, Y0_, DB1_, BIN_, MAX_DB_, FS_); bool dataOk = false; + int vowel = -1; while (true) { for (int k=0; k<N_VOWEL_; k++) @@ -64,6 +65,11 @@ { for (int n=0; n<N_DATA_; n++) sn[n] = sn_[k][n]; WaveformDisplay(lcd_, 50, 40, sn, N_DATA_, backColor); + + buttons[k]->DrawButton(0xFF0000B0); + if ((vowel != -1) && (k != vowel)) + buttons[vowel]->DrawButton(LCD_COLOR_BLUE); + vowel = k; for (int n=0; n<N_DATA_; n++) sn_f[n] = sn[n]; fft_.Execute(sn_f, db1); @@ -86,4 +92,3 @@ } } -