Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't run FFTs until enough samples have arrived #1288

Merged
merged 2 commits into from
Sep 30, 2023
Merged

Conversation

argilo
Copy link
Member

@argilo argilo commented Sep 30, 2023

Partially addresses #1282.

The new "Min hold" feature sometimes fails if it's enabled when DSP is started for the first time. This happens because the rx_fft block is initially filled with zeroes, and will return them through get_fft_data if the plot is updated before any samples have arrived from the hardware.

To fix this, I've added sample counting to the rx_fft block. If not enough samples have arrived yet, the get_fft_data method returns -1, and the plot is not updated.

After the change, the "Min hold" feature works properly on startup, even with RTL-SDR.

@argilo argilo added the bug label Sep 30, 2023
Copy link
Contributor

@willcode willcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried a few different SDRs and they all worked as expected, including a bit of a delay for low sample rates and high FFT. Using a 4M FFT on a sub-1MS/s SDR causes quite an overlap anyway, so some non-real-time behavior should be expected and this shouldn't shock anyone.

@argilo argilo merged commit 0f1a703 into master Sep 30, 2023
22 checks passed
@argilo argilo deleted the rx-fft-fix-zeros branch September 30, 2023 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants