Skip to main content
Visitor II
December 29, 2016
Question

How PDM_Filter_XX_XX works?

  • December 29, 2016
  • 1 reply
  • 973 views
Posted on December 29, 2016 at 15:42

I'm trying to connect SPH0641LU4H-1 microphone to STM32F411RE Nucleo board.

According to the Wikipedia 

https://en.wikipedia.org/wiki/Pulse-density_modulation

 format should represent lowest and highest amplitude as 0b0000...(all 0) and 0b1111...(all 1) accordingly.

When I connect microphone pin to the ground ->  0b0000... PDM data is transferred to PDM_Filter_XX_XX and output sound is silence. But when I connect it to 3.3v source to emulate PDM 0b1111... ->  the output I get is 1KHz noise. (

mailto:16bit@16KHz

 PCM). PDM_Filter_128_LSB function outputs big(depends on micGain) int16_t values with + or - sign.

But I expect that 0b0000... and 0b1111... represents maximum and minimum diffuser deflection. Am I wrong?

In general, I receive strange binary from PDM_Filter which doest'n looks like a wave and sounds like very noisy 1KHz square wave oscillator.

Some ideas where I went wrong? I can provide details for every step I did.

Thanks!

(configuration:

   I2S:   MasterClock: ON

            PLLI2SN: 192

            PLLI2SM: 16

            PLLI2SR: 2

            AudioFreq: 64000

      PDM_Buffer size: 128 * uint16_t

      PCM_Buffer size: 16 * uint16_t

)

#nucleo #microphone #i2s #stm32f4-i2s
    This topic has been closed for replies.

    1 reply

    Technical Moderator
    December 29, 2016
    Posted on December 29, 2016 at 16:08

    Dear

    Kukhar.Volodymyr

    ‌,

    This application Note

    http://www.st.com/content/ccc/resource/technical/document/application_note/ca/18/be/bb/f8/53/47/a5/DM000408pdf/files/DM000408pdf/jcr:content/translations/en.DM000408pdf

    ,

    in

    '5.2 PDM_Filter_xx_xx' section, may help you with more details and clarification aboutthis topic. Also, t

    here is anAudioexample under STM32CubeF4 firmware package, so you can get inspiredto develop your application and

    update it according to your needs:

    STM32Cube_FW_F4_V1.0\Projects\STM32F4-Discovery\Applications\Audio\Audio_playback_and_record

    You shouldfollow the instructions on the

    readme.txt file describing how to usethe example.

    Hope this helps you.

    Best Regards

    Imen

    Visitor II
    December 30, 2016
    Posted on December 30, 2016 at 13:56

    Yes, I have read

    /external-link.jspa?url=http%3A%2F%2Fwww.st.com%2Fcontent%2Fccc%2Fresource%2Ftechnical%2Fdocument%2Fapplication_note%2Fca%2F18%2Fbe%2Fbb%2Ff8%2F53%2F47%2Fa5%2FDM000408pdf%2Ffiles%2FDM000408pdf%2Fjcr%3Acontent%2Ftranslations%2Fen.DM000408pdf

    m

    any times, and my application done similar

    to

    https://github.com/fboris/STM32Cube_FW_F4/tree/master/Projects/STM32F4-Discovery/Applications/Audio/Audio_playback_and_record

    and

    http://www.st.com/en/embedded-software/x-cube-memsmic1.html

    examples with some differences:

    1. External microphone connected to i2s2,

    2. Icollect 0.5sec of sound and transmit it via UART to pc.

    My question is more narrow about PDM_Filter_xx_xx function, and the way it works.