nanovna-v2 / NanoVNA2-firmware

Firmware for NanoVNA V2
https://nanorfe.com/nanovna-v2.html
215 stars 85 forks source link

FFT_SIZE too small for TD lowpass mode #74

Open gfuer opened 3 years ago

gfuer commented 3 years ago

In lowpass mode, the FFT size needs to be >= 2x the number of sweep points in order that DC, Nyquist, positive frequencies and negative frequencies fit into the FFT buffer. But the definition in common.hpp does not provide that many points. The models with SWEEP_POINTS_MAX=201 would actually require 512 points, not 256.

if SWEEP_POINTS_MAX < 256

define FFT_SIZE 256

elif SWEEP_POINTS_MAX < 512

define FFT_SIZE 512

else

error "Need update FFT table for more points size"

endif