I am working on a personal project that maps bass notes to colors in real-time. However, I'm encountering some issues with oscillations in my frequency bins.
I visualized my frequency bins to illustrate the issue:
Here is an outline of my signal processing chain:
- Capture 2205 samples from my input device at a sample rate of 44.1 kHz (allowing me to identify frequencies down to 20 Hz)
- Apply the Hann function to the samples
- Calculate frequency bins from 20 Hz to 150 Hz in 1 Hert increments using the Goertzel algorithm
It seems like the oscillations occur at all frequencies, but become more noticeable the lower I go. I assume this is because given some period, the lower the frequency the fewer the cycles captured in that period. I had expected that to result in more leakage, but not necessarily oscillating values. Increasing the sampling period helps, but necessarily increases perceived latency (because I'm using samples further back in time).
Does my assumption about the sampling period seem correct? Are there ways to mitigate this oscillation without increasing my sampling period significantly?


