audio-reactive-led-strip
audio-reactive-led-strip copied to clipboard
Unit on x-axis in Filterbank Output
I would like to know what is the unit on the x-axis in the Filterbank Output. Asking because when I generate a 500Hz tone with
speaker-test -t sin -f 500
the peak is around 2000.
Try increasing the number of fft bins to increase the "resolution" of the x axis. You can do this by looking in config.py, line 85, N_FFT_BINS The units will be in Hz, but due to the way the frequencies are split into bins, you get peaks for a certain range of values. Increasing the number of bins reduces this range, giving more resolution.
Still no change, tried with 256 which should be enough for a resolution of 50Hz on a scale of 10kHz. Also have not understood that value completely since it does not seem to be passed to numpy.fft.rfft().
If I remember correctly, the x-axis has units of Mels. The Mel frequency scale is used because it is perceptually linear to the human ear, which has important implications for audio visualization.
The steps performed by the program are:
- Take the FFT of a windowed segment of the audio signal
- Map the powers of the FFT spectrum onto the Mel frequency scale, using a triangular overlapping filterbank
- Normalize the amplitudes of the resulting Mel scale FFT bins