Skip to content

Improve low-frequency pitch tracking down to 20 Hz - #36

Merged
user1303836 merged 1 commit into
mainfrom
feature/low-frequency-tracking-research
Aug 6, 2026
Merged

user1303836 merged 1 commit into
mainfrom
feature/low-frequency-tracking-research

Conversation

@user1303836

Copy link
Copy Markdown
Collaborator

Summary

  • replace the fixed ~80 Hz YIN analysis limit with preallocated quick, guitar, and conditional low-frequency workspaces
  • track fundamentals down to 20 Hz while preserving the existing fast path and public detector API
  • add adaptive low-resolution analysis and candidate confirmation for direct steps, fast bends, weak fundamentals, and octave-boundary rejection
  • publish frequency/confidence coherently and harden the background worker against stale backlog, FIFO overflow, and teardown races
  • release stale smoothed pitches after invalid input and avoid repeated log2 work
  • document the inherent near-20 Hz acquisition time

Motivation

The previous maximum lag could not represent F#1 (46.25 Hz). Clean low notes could return no pitch, while harmonic-rich F#1 could be reported around 91-95 Hz. Simply extending the one existing window to 20 Hz fixed sustained tones but made transitions stale and increased analysis CPU substantially.

The hierarchical implementation keeps short analyses on the common path and runs longer evidence only for low or uncertain pitches. There are no UI or parameter changes.

Performance

Measured against origin/main with 60 synthetic harmonic-rich probes:

  • 440 Hz analysis user CPU: approximately 24% lower
  • F#1 analysis user CPU: approximately 22% higher, while becoming correct
  • 20 Hz acquisition remains approximately 110 ms because reliable YIN evidence requires about two periods

Testing

  • Release suite: 57/57 passed
  • ASan/UBSan: 57/57 passed
  • TSan: 57/57 passed
  • universal arm64 and Rosetta x86_64: 57/57 passed
  • pluginval v1.0.4 strictness 10: SUCCESS
  • zero warnings in changed files under -Wall -Wextra -Wpedantic -Wconversion -Wsign-conversion
  • independent final review: no medium-or-higher findings

Regression coverage includes 20-81 Hz boundaries, F#1 at 44.1/48/96 kHz, phase/level/DC variation, weak and missing fundamentals, unsupported 15 Hz input, acquisition latency, direct 46.25-to-20 Hz steps, 46.25-to-30 Hz bends, rapid note changes, silence, and stale-pitch release.

Residual limitation

The low-frequency tests use synthetic guitar-like signals because real eight-string and Kontakt recordings were not available.

@user1303836
user1303836 merged commit 071a9d0 into main Aug 6, 2026
2 checks passed
@user1303836
user1303836 deleted the feature/low-frequency-tracking-research branch August 6, 2026 17:12
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.

1 participant