Repository navigation
fix(pitch): keep yinfft's weighting lookup inside its table - #448
Open
shauneccles wants to merge 1 commit into
Open
shauneccles wants to merge 1 commit into
shauneccles wants to merge 1 commit into
Conversation
new_aubio_pitchyinfft interpolates a psychoacoustic weight for every spectrum bin from a table ending at 25.1kHz. Above 50.2kHz (88.2k, 96k, 192k) bins run past it: the first search stopped on the -1 terminator and read weight[34], one past the end, then the second search walked past the terminator itself, since every frequency is greater than -1. Reproduced under ASan with new_aubio_pitchyinfft(96000, 256). The search now stops at the last table entry, and bins above it hold the last weight (-17.8dB, which the last three entries already share). Weights are unchanged for every samplerate up to 48kHz (checked for 8k-48k at buffer sizes 256-4096). Tests: the C test builds yinfft at 48k-192k, which aborts under ASan without the fix (sanitizers.yml); a Python test tracks a 440Hz sine at 96kHz. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
new_aubio_pitchyinfft interpolates a psychoacoustic weight for every
spectrum bin from a table ending at 25.1kHz. Above 50.2kHz (88.2k, 96k,
192k) bins run past it: the first search stopped on the -1 terminator and
read weight[34], one past the end, then the second search walked past the
terminator itself, since every frequency is greater than -1. Reproduced
under ASan with new_aubio_pitchyinfft(96000, 256).
The search now stops at the last table entry, and bins above it hold the
last weight (-17.8dB, which the last three entries already share). Weights
are unchanged for every samplerate up to 48kHz (checked for 8k-48k at
buffer sizes 256-4096).
Tests: the C test builds yinfft at 48k-192k, which aborts under ASan
without the fix (sanitizers.yml); a Python test tracks a 440Hz sine at
96kHz.
Closes #435.
Split out of #432. Checked together with the other small fixes on top of master plus #447:
meson test52/52 ok, andpytest python/testson the setup.py build 600 passed, 51 skipped.🤖 Generated with Claude Code