I am coding a program which uses a FFT to process audio data. I need to aggregate the FFT output into three bins ("bass", "mid", and "treb") determined by two arbitrary frequency values. The end-goal is, more or less, a spectrum analyzer with 3 variable-size frequency bands.
As the magnitude of the complex numbers obtained from the FFT is bounded above by a known number B, it seems to me that the most intuitive method to aggregate the data would be to calculate average magnitude within a band and then convert the average to decibels referencing B.
This method leaves me with a serious concern, however... Since there are fewer measurements at lower frequencies, it serves to reason that there will exist a higher degree of spectral leakage in a low-frequency octaves than in high-frequency octaves. I fear that this will cause the average for the "bass" bin to trend higher than that of the "mid" and "treb" bins, thus causing a disconnect between the presented data and what is actually perceived. I am already applying a window function to incoming audio samples, but tests of my program suggest that this might still be an issue. As illustration (graph of several window functions, vertical gridlines at each octave, input is simple sinusoid):
Low freq spectral leakage
High freq spectral leakage
Is averaging as stated above the de facto standard for aggregating audio data in an application like the one I've described? Are there alternatives that may be better suited to my use-case?
Is the concern I mentioned well-founded? If so, are there any standard tactics to mitigate the problem?