Skip to content

Commit

Permalink
use power of 2 element FFT
Browse files Browse the repository at this point in the history
  • Loading branch information
howard0su committed Apr 27, 2022
1 parent 6153396 commit 214ea4c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion decode_ft8.c
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,13 @@ void monitor_init(monitor_t* me, const monitor_config_t* cfg)
// Compute DSP parameters that depend on the sample rate
me->block_size = (int)(cfg->sample_rate * symbol_period); // samples corresponding to one FSK symbol
me->subblock_size = me->block_size / cfg->time_osr;
me->nfft = me->block_size * cfg->freq_osr;
if (me->block_size * cfg->freq_osr < 2048)
me->nfft = 2048;
else if (me->block_size * cfg->freq_osr < 4096)
me->nfft = 4096;
else if (me->block_size * cfg->freq_osr < 8192)
me->nfft = 8192;

me->fft_norm = 2.0f / me->nfft;
// const int len_window = 1.8f * me->block_size; // hand-picked and optimized

Expand Down

0 comments on commit 214ea4c

Please sign in to comment.