Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Currently, SpectrogramPlot::getLine() uses the sample parameter to determine the index of the first sample that is used to calculate the FFT for a particular spectrogram line. Since the FFT is in some sense an average of fftSize samples, this causes features (such as the start and end of packet bursts) to appear somewhat sooner in the spectrogram compared to their actual locations in the IQ file. This improves the time alignment of the spectrogram plot by making sample refer to the middle sample of the FFT (so the samples used to compute the FFT start at sample - fftSize / 2. For the beginning of the file we need to make an exception, because if we try to fetch samples before the beginning of the file, then inputSource->getSamples() returns nullptr. SpectrogramPlot::getLine() handles this gracefully, but an ugly red bar appears at the beginning of the file when the FFT size and zoom are large. To solve this, we cheat and force the FFT to start at the beginning of the file. To be more precise we could pad the beginning with zeros instead. Signed-off-by: Daniel Estévez <daniel@destevez.net>
- Loading branch information