Skip to main content
Visitor II
October 28, 2020
Question

Problems with filtered data of MEMS microphone MP34DT01 ussing library "pdm2pcm"

  • October 28, 2020
  • 2 replies
  • 2337 views

Good afternoon, I ran into such a problem. I use an MP32DT01 digital microphone and an STM32F411CE microcontroller. The data comes over I2S and is filtered by the "pdm2pcm" library from CUBE MX. But the sound has very strong noises, it is difficult to distinguish the voice. The filter parameters are shown in the 1st figure, the waveform of the received sound is shown in the 2nd figure. Can you please tell me what to do? How to get high-quality sound using this particular library for filtering and decimation? There is no way to use the "pdm_filter" library.

0693W0000059ZLbQAM.jpg0693W0000059ZLHQA2.png

    This topic has been closed for replies.

    2 replies

    ST Employee
    October 29, 2020

    Hi @DPavl.1​ ,

    you could try to change the PDM_FILTER_DEV_FACTOR parameter from PDM_FILTER_DEV_FACTOR_64 to PDM_FILTER_DEV_FACTOR_80, to check if you get the same strange noise.

    This because the MP34DT01 datasheet reports the low PDM clock frequency at 1MHz and if you are running at 1.024MHz you may be border line to this limit.

    0693W0000059hwpQAA.png 

    -Eleon

    DPavl.11Author
    Visitor II
    November 2, 2020

    I tried to change the parameters, the noise did not disappear. I found out that the library does not provide a low pass filter. Could this be a problem and where to get (if any) examples of using such filters in use with a 16-bit PCM signal

    ST Employee
    November 3, 2020

    Hi @DPavl.1​ ,

    if you generate a pure tone( for example at 1kHz), are you then able to see it in the Audacity waveform?

    If not, and if you are perceiving only high noise, can you check with a microscope or a lens watching through the microphone sound inlet on the top side of its package if the membrane of the MEMS microphone is OK? Or you can send me a picture of it and I'll tell you.

    -Eleon

    DPavl.11Author
    Visitor II
    November 10, 2020

    For this case, the I2S initialization code:0693W000005ArxGQAS.jpgRCC initialization code:

    0693W000005ArxVQAS.jpgPDM buffer processing:

    0693W000005ArxpQAC.jpgpdm_filter initialization:

    0693W000005ArxzQAC.jpg

    ST Employee
    November 10, 2020

    Hi @DPavl.1​ ,

    Please note that this code looks not coming from the MEMSMIC1 library, since it is using an old conversion library (different from the one you were using in your first screenshot). Now the API are different.

    It is not clear what's happening in the conversion procedure... it looks like you are calling the library a number of "J" times,shifting every time of “DEC_FACTOR�? bytes. But if DEC_FACTOR is the decimation factor, this is wrong, since there is a factor of 8 missing (Bytes vs bits of the decimation factor).

    There are also a number of collateral parameter that should be controlled: the DMA size (that library has to be called on 1ms time-base) the I2S register setting, etc...

    Basically, it doesn't seem you are starting from the MEMSMIC1 library, or from an ST-supported code...

    But maybe I'm not the right person for this, so I've added the STM32F4 tag to your post. You may ask for more support directly in the STM32 community.

    -Eleon