Incorrect audio acquisition with PDM microphone Hi, I have a problem with audio acquisition using PDM microphones. After using PDM_Filter, single peaks of high amplitude appear in the data in addition to the correct readings. I am using 4 microphones MP34DT01-M, STM32H743 and SAI interface. I take 4096 samples from each microphone, convert PDM to PCM and save to SD card using FATFS. My code (excerpt) is very simple:void HAL_SAI_RxCpltCallback (SAI_HandleTypeDef *hsai) //PDM buffer full
{
rxstate = 2; //buffer full flag
real_round++; //next real round of acquisition
}
int main(void)
{
HAL_SAI_Receive_DMA(&hsai_BlockA1, (uint8_t*)PDM_buffer, PDM_buffer_size); //start acquisition
while (1)
{
if (rxstate == 2)//if PDM buffer is full
{
rxstate = 0; //clear the flag
current_round++; //next processed round of acquisition
if (current_round <= last_round) //processes and saves a predetermined number of cycles (rounds)
{
PDM_Filter(&(((uint8_t*)PDM_buffer)[0]), &(((uint16_t*)PCM_buffe