Problem
PitchSmoother::process() (source/dsp/PitchSmoother.h:37) applies exponential smoothing in linear frequency space: smoothed += alpha * (detectedFreq - smoothed).
Musical pitch perception is logarithmic. A jump from 100Hz to 200Hz (one octave) and 1000Hz to 2000Hz (also one octave) are treated as having 10x different magnitude by the linear smoother. This makes smoothing feel inconsistent -- sluggish at low frequencies, twitchy at high frequencies.
Corroborated by: 3/8 audit agents (dsp-algorithm, ring-mod-research, pitch-detection)
Suggested Fix
Smooth in log-frequency space:
float process(float detectedFreq, float confidence) {
if (confidence < sensitivityThreshold)
return hasValue ? std::exp2(smoothed) : 0.0f;
float logFreq = std::log2(detectedFreq);
if (!hasValue) {
smoothed = logFreq;
hasValue = true;
} else {
smoothed += alpha * (logFreq - smoothed);
}
return std::exp2(smoothed);
}
Impact
- Audio quality: Perceptually uniform smoothing across the guitar's frequency range
- Severity: Medium -- noticeable improvement at high smoothing values
Problem
PitchSmoother::process()(source/dsp/PitchSmoother.h:37) applies exponential smoothing in linear frequency space:smoothed += alpha * (detectedFreq - smoothed).Musical pitch perception is logarithmic. A jump from 100Hz to 200Hz (one octave) and 1000Hz to 2000Hz (also one octave) are treated as having 10x different magnitude by the linear smoother. This makes smoothing feel inconsistent -- sluggish at low frequencies, twitchy at high frequencies.
Corroborated by: 3/8 audit agents (dsp-algorithm, ring-mod-research, pitch-detection)
Suggested Fix
Smooth in log-frequency space:
Impact