2023-03-01 12:50 AM
2023-03-01 02:00 AM
Dear All:
I would like to add FFT algorithms in the "AMICAM1\Microphones_Streaming" based on NUCLEO-STM32L476RG ?
From the document of UM1901, we can get audio data in the callback function(AMICAM1_AUDIO_IN_TransferComplete_CallBack) per 1 msec with 192KHz of samping rate as below.
We hope to save 6 msec of audio data in the PCM_Buffer(192*6=1152, 24 bits of data) from AD1974 for FFT analysis.
When finishing the 1152 bytes of audio data collection, we normalize transfer 24 bits audio data into the range of +/- 1 audio signal for implementing FFT analysis.
We also can find the fft.c in the library of middle ware as below.
There are some FFT API in a compiled HTML file located in the Documentation folder.
How to implement the 1024 point of FFT algorithms step by step?
Best Regards,
Sheng-Hua
2023-03-02 06:11 AM
Hello @shenghua yang
X-CUBE-MEMSMIC1 already provides an example using FFT.
Is it called UltrasoundFFT and it is placed here: Projects\STM32L476RG-Nucleo\Demonstration\AMICAM1\UltrasoundFFT\.
Start looking at this code example, that is fully working and already provides what you need.
Best regards
Simone
2023-03-03 01:11 AM
Dear Simone:
Thanks your help.
We have found the UltrasoundFFT and successfully compiles the project.
It runs a 512 points of FFT algorithm with 50% of overlapping.
FFT_Lib_Init(512, 0.5f);
Which microphone(M1,M2,M3,M4) elements are used to do FFT in this project?
void AMICAM1_Data_Ready(uint8_t *buf, uint16_t size, double timeStamp)
{
FFT_Lib_Data_Input((int16_t *)buf, size / 2);
}
Best Regards,
Sheng-Hua
2023-03-03 07:25 AM
Hi @shenghua yang
The demo uses M1.
Best regards
Simone