It has been a while since I used an FFT and instead of porting some old C# sharp code I’m trying out juce’s.
Here’s what I understand:
The frequency of bin[x] = Fs / nth Record.
In the past I have multiplied the real and imageinary parts but using fft::performFrequencyOnlyForwardTransform only modifies the array going in. Is the data in that array a linear amplitude?
My other question is if say the FFT is (10th Order) 512 bins do I need to supply 512 or 1024 samples? (my guess is that if its OnlyForward like the method implies - I only need 512)…
I do feel that the FFT sample should have maybe 2 different views. While the WaterFall style is nice use case using a max bin value to make visual more prominent disguises real value of data, Maybe a more traditional FFT view would be useful.
If you want to make a “falling down” path, at least make sure that the rate is calculated against the sample rate!
In my initial setup I used
// Curve lowers with a frame rate of 25 to zero in around a second
FloatVectorOperations::multiply (levels, 0.9f, numBins);
for (auto i = 0; i < numBins; ++i)
// "Add" new peak levels to the fallback curve
if (binPeaks[i] > levels[i])
levels[i] = binPeaks[i];
This works nicely at 48 kHz - haven’t yet checked at 96 or 192, maybe the results are the same Too hot here (30 degrees) to think about it in more depth
When I wrote my spectro stuff, I also ran into the buffer size issue, with nasty crashes. But okay, it IS commented in the Juce source and docs. I was confused by my IPP code, which did not use a buffer twice the size.
It’s a traditional FFT window that I’m creating not a WaterFall one like the example. My code is frame rate independant … (it waits for proper handoff before updating view and handoff is governed by data)
Were getting the first shower in 6 weeks on the Wirral so I’m feeling a little more productive
Congrats! Are you painting with a path or with lines? Paths are quite expensive, I pre-allocate them, hoping this helps. I also use a roundedPath for up to 1 kHz, which looks a lot nicer in the low end (with few bins)
The dB range of my grid is probably off in this image (should be 24 I believe), but it is of course a bit arbitrary what level range you use for the spectrum in an Eq display.
I hope you understand my meaning of “scaling”: if you apply a Hann window to the FFT input, to avoid leaking false frequencies, you have to adjust with 6 dB for what the Hann window drops at both sides of the “window”