2024-02-29 2:15 AM - last edited on 2024-02-29 7:37 AM by Amel NASRI
Good morning, if possible, I would like more details about the following PDM2PCM(HP version) library used for converting PDM data to PCM.
typedef struct{
uint16_t bit_order// MSB / LSB
uint16_t endianness;// big endian / little endian
uint32_t high_pass_tap;// hig_pass_tap = alpha*(231-1) #alpha[0:1]
uint16_t in_ptr_channels;// number of input PDM channels
uint16_t out_ptr_channels;// number of output PCM channels
uint32_t pInternalMemory[PDM2PCM_INTERNAL_MEMORY_SIZE];// [default 23] I don't know, I need help here
}PDM_Filter_Handler_t;
typedef struct{
uint16_t decimation_factor;// decimation factor [16/24/32/48/64/80/96/128] HI_PERF[64/96] do the latter have faster execution times?
uint16_t output_samples_number;// I don't know, I need help here... could it be the number of PCM samples or the number of PCM bytes in output?
int16_t mic_gain;// gain [-12 dB: +51 dB]
int16_t bit_depth;// PCM resolution [16/24/24IN32]
}PDM_Filter_Config_t;
Furthermore, when I go to link the library I can specify (in my case I use CM4) the following libraries:
What differences are there between the libraries?
Finally, should the input PDM data be organized into a uint8_t array? because I have seen examples like this, but also different ones...
Thanks for the attention
2025-12-12 10:52 AM
There is a very little information from STM on HP PDM lib. I was using the PDM2PCM library with the MIMC microphone, and it worke but had high HF noise.
I'm trying to get the HP version working but get errors for PDM2PCM_DECIMATION_ERROR==8, PDM2PCM_BITDEPTH_ERROR=0x100, and I've tried all the permutations.
This is a nightmare, thanks STM!