About FFT function:performFrequencyOnlyForwardTransform (fftData)?

Hi everyone,
Suppose that a FFT object has been defined and the fifo array stores 1024 time domain signal points. The first 1024 elements of fftData array are the same as the fifo array and the last 1024 elements of fftData array are all zeros:
dsp::FFT forwardFFT(10);
float fifo [1024];
float fftData [2048];
After the call of function performFrequencyOnlyForwardTransform (fftData): FFT.performFrequencyOnlyForwardTransform (fftData), what contents of each fftData array element? is each element’s value represents a frequency component’s magnitude? If so,what is that magnitude’s corresponding frequency value?

Best regards!

1 Like

How should we choose the “order” parameter when we create a FFT object? Is that important?

FFT (int order);

Here all the time domain signal points are all real number, not complex number.

Yes, it determines the size of your FFT:

The number of points the FFT will operate on will be 2 ^ order.

1 Like

Regarding the frequency question:
f = sampleRate * bin / fftSize
with bin ∈ [0; fftSize-1]

3 Likes

Any updates ? Is it possible that the fftData array after the FFT applying FFT.performFrequencyOnlyForwardTransform has in the first 1024 samples the amplitude and in the last 1024 samples the phase of the frequency samples?

That is a different use. The method is called performFrequencyOnlyForwardTransform(), so it does frequency only.

If you want to have the complex numbers with frequency and phase, you use FFT.perform() instead (that’s how I understand it).

Hey daniel, sorry but i dont’t get it.

According to the documentation the performFrequencyOnlyForwardTransform() method takes as input an array of double the size of the FFT input:

The size of the array passed in must be 2 * [getSize()](https://docs.juce.com/master/classdsp_1_1FFT.html#a17ea52510feb588420d2bf5a049c4ee4).

I cannot understand why bother providing an array defined as fftData [2*fftSize] with double the size of fftSize , if this method provides as output only the magnitude of the frequencies?
A single size array should be enough.

This is because some of the underlying FFT implementations need to compute the complex output vector as an intermediate computation step before reducing this output down to the absolute values

1 Like

Thanks!