Skip to main content
Visitor II
February 17, 2021
Question

what format is the return buffer of the PDM2PCM function

  • February 17, 2021
  • 1 reply
  • 653 views

Hello,

I am trying to understand how the PDM_Filter() function works.

If I am using 48Khz with a decimation factor of 64 and a output samples = 16

If I call the function like this...

uint16_t MidBuffer[16];
uint16_t pdmRxBuf[128];

PDM_Filter(&pdmRxBuf[0],&MidBuffer[0], &PDM1_filter_handler);

is the MidBuffer a 16 bit array or a 16 byte array

I am trying to store the PCM data into bytes that I can eventually send out of my UART.

Could anyone please help explain this to me? I have read the app notes and am still confused.

my configuration is below

void MX_PDM2PCM_Init(void)
{
 /* USER CODE BEGIN 2 */
 /* USER CODE END 2 */
 
 /** 
 */
 PDM1_filter_handler.bit_order = PDM_FILTER_BIT_ORDER_MSB;
 PDM1_filter_handler.endianness = PDM_FILTER_ENDIANNESS_BE;
 PDM1_filter_handler.high_pass_tap = 2104533974;
 PDM1_filter_handler.in_ptr_channels = 1;
 PDM1_filter_handler.out_ptr_channels = 1; 
 PDM_Filter_Init(&PDM1_filter_handler);
 
 PDM1_filter_config.decimation_factor = PDM_FILTER_DEC_FACTOR_64;
 PDM1_filter_config.output_samples_number = 16;
 PDM1_filter_config.mic_gain = 0; 
 PDM_Filter_setConfig(&PDM1_filter_handler, &PDM1_filter_config);
 
 /* USER CODE BEGIN 3 */
 /* USER CODE END 3 */
 
}

    This topic has been closed for replies.

    1 reply

    ST Employee
    February 18, 2021

    Hi @kcire L.​ ,

    for the PDM_Filter() function description, you can find references in:

    But is this post related to this other one?

    If so, can you check if that answer can be at least partially valid also for this post?

    -Eleon