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

Search for peaks over a wider range #942

Merged
merged 1 commit into from
Nov 17, 2024

Conversation

argilo
Copy link
Contributor

@argilo argilo commented Nov 17, 2024

After the removal of scan plot data decimation in #939, some peaks are displayed with incorrect amplitude:

Screenshot from 2024-11-17 11-30-13

This is because the code that searches for the peak amplitude in the bins near the quantized frequency does not search far enough. It only looks from 5 bins down (-4000 Hz) to 4 bins up (+3200 Hz), even though the original peak frequency may be up to 10000/2 = 5000 Hz away.

Here I've solved the problem by calculating the required search radius based on the quantization and search_step values. I also fixed the off-by-one in the upper limit. (Python ranges do not include the end value.)

@darksidelemm darksidelemm merged commit dc9b5fb into projecthorus:testing Nov 17, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants