Repository navigation
Conversation
The tuner's longest lag was 180 samples at 11025 Hz, so its lowest note was 61 Hz: a bass's E (41 Hz) and A (55 Hz) strings showed nothing or a wrong note (issue #20). The lag now reaches 400 samples (27.6 Hz), enough for a five-string bass's low B (31 Hz) tuned up from flat. The lag search now judges each lag as it is computed and stops at the bottom of the first dip, so the array of normalised differences is gone. The tuner's buffers grow by 80 bytes in all (the window copy grows by 880, the array of 1604 would have pushed the Bluetooth test image's NAM layer split out of the cache RAM). The difference window now starts 20 ms earlier in the buffer; guitar readings move by at most 0.1 cent. The tuner moves to firmware/px_tuner.h so that tests/test_tuner.c runs it on a PC: bass and guitar notes, sine and plucked, in tune and off it, read every 100 ms. Before: 157 of 229 cases right (every bass note under 61 Hz wrong). After: 229 of 229, within 2 cents up to the high E string.
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.
The tuner could not read the lowest bass strings. Its lowest readable pitch was about 61 Hz, so a bass's low E (41 Hz) and A (55 Hz) were missed or misread, as reported in #20. This lowers the floor to about 27.6 Hz, which also covers a five-string bass's low B (31 Hz). The upper limit of 1100 Hz is unchanged, and memory use does not grow because the pitch search now judges each lag as soon as the next one is known. The tuner code moves into its own header so it can run on a PC, and a new host test checks bass and guitar notes. On the host, all 229 test cases pass, up from 157 before the fix, and the low E was read correctly 18 of 18 times, up from 0. It has not been tried on a real pedal with a bass. Fixes #20.