STM32F407 – CMSIS DSP – IFFT not working with audio input/output

When working with the STM32F407G-DISC1 and reading audio input through PMOD I2S2, it is common to want to perform operations such as FFT (Fast Fourier Transform) and IFFT (Inverse Fast Fourier Transform) on the incoming audio buffer. One common application of this is to implement a pitch shifting algorithm.

In the code snippet provided, the incoming audio data is being read into the rxBuf buffer and then manipulated before being written to the txBuf buffer. This manipulation involves copying values from the rxBuf to the txBuf and setting certain values to zero.

To perform the FFT and IFFT operations on the incoming audio buffer, the code snippet shows how to format the data for processing using the ARM CMSIS-DSP library functions arm_rfft_fast_f32 and arm_rfft_fast_f32. The fft_in_buf and fft_out_buf buffers are used to store the input and output data for the FFT operation.

After performing the FFT and IFFT operations, the processed audio data is written back to the txBuf buffer. However, it seems that there may be a scaling issue with the processed data, as the output volume is very low.

One potential solution to this issue could be to ensure that the scaling of the fft_in_buf data is correctly handled before writing it back to the txBuf buffer. This may involve adjusting the scaling factor used when reading and writing the data.

Overall, it is important to carefully consider the data manipulation and scaling factors when working with audio processing algorithms such as FFT and IFFT to ensure that the output audio is at the desired volume level. With some adjustments and fine-tuning, you should be able to achieve the desired results in your audio processing application on the STM32F407G-DISC1 platform.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *