cancel
Showing results for 
Search instead for 
Did you mean: 

FFT function and buffer size

luke514
Senior

Watching some videos online about FFT and trying to use (in STM32CubeIDE) the arm_rfft_fast_f32 function of the arm_math.h DSP library, it is not clear to me why the buffer output produced by that function is N/2 long and not N

luke514_0-1706189998758.png

Is it something related to Shannon's theorem? To the symmetry of the spectrum? (i.e. is it symmetrical around the origin).

You are welcome to share external links if there are detailed explanations that I did not see during my internet search.

1 ACCEPTED SOLUTION

Accepted Solutions
Sarra.S
ST Employee

Hello @luke514

The output buffer length is N/2 due to the properties of the FFT itself 

>>To the symmetry of the spectrum?

yes, the spectrum is symmetric around the Nyquist frequency, which is half the sampling rate. so, the second half of the FFT output is a mirror image of the first half.

Typically, The buffer's size must correspond to a power of 2

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
Sarra.S
ST Employee

Hello @luke514

The output buffer length is N/2 due to the properties of the FFT itself 

>>To the symmetry of the spectrum?

yes, the spectrum is symmetric around the Nyquist frequency, which is half the sampling rate. so, the second half of the FFT output is a mirror image of the first half.

Typically, The buffer's size must correspond to a power of 2

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.