ttrftech / NanoVNA

Very Tiny Palmtop Vector Network Analyzer
1.06k stars 296 forks source link

Compensate IFFT window / zero-padding loss in TD #144

Closed czietz closed 3 years ago

czietz commented 3 years ago

Depending on the chosen window and mode, the magnitude of the impulse response in time-domain previously was to low. This can be explained by looking at the signal processing. For example, in bandpass mode with normal window, it applies a 101 point Kaiser window (shape factor 6) and zero-pads to do a 256 point IFFT. Therefore, the loss is 20*log10(256/sum(kaiser(101,6))) ≈ 14.2 dB.

This change compensates the signal processing losses in bandpass and lowpass impulse mode depending on the window type, which makes the time-domain results similar to other VNAs.

See this thread for examples and discussion: https://groups.io/g/nanovna-users/topic/should_the_builtin_tdr_mode/77043091

edy555 commented 3 years ago

@czietz Thanks for your contribution! (and I'm sorry I was late to notice)