FFT questions

I think I’ve read so many different posts I’ve confused myself.

I’m trying to make a spectrum analyzer and while I’ve made some great strides with this plugin, I am confused about what “magnitude” is. Let me just add some numbers questions:

(1) If I use “performFrequencyOnlyForwardTransform”, do I understand that if my fft size is 1024, and my data size going in is 2048, I’ll look at 1-1023 values, and that 0 contains the DC value.

(2) I see it listed that the magnitude value has a max value of the fft size, so before I go into the gainToDecibel function I’d either do VALUE/FFTSIZE? And that because of logarithms, this is why some people just do log(value) - log(fftsize) which is the same thing?

(3) If I apply a hann window, I see it listed that the values are reduced and that I need to multiply by 2, is that correct?

(4) This is where I am really confused. In the examples, I notice that a function is used to just pick out a value from a larger set of values to plot. So for instance, if I have 1024 fft bins, and I want to draw that into 16 bars on the screen, with the examples, it’s just going to logarithmically pick those 16 bins from the entire 1024 set. I’d like to not lose that frequency information and instead combine adjacent bins.

I’ve seen conflicting information on how to do this, I’ve see

a) add all the bin values together.
b) average the values in the bins that you are combining
c) apply weighting to the bins (triangular) as you combine them.

I just don’t know what to do.

What I definitely know is that when I play a bass note through my plotted frequency bars and I compare to live’s spectrum in bin mode, their peaks are WAY taller than mine, and I have converted to decibel.

So basically lost on a few areas. Thanks in advance for setting me straight on this!!

1: yes. the range is from 0 to (size/2) with 0 being frequency 0hz aka dc offset.

3: yeah when you apply windowing functions the whole signal drops in volume.