I have a PDM data input from the MEMS microphone on the Pynq-Z1 development board. My eventual goal is to take the FFT of the audio samples and display the frequency bins on some LED.

I am struggling to understand what exactly is needed to convert the PDM signal to an acceptable input for the FFT. I have seen some videos explaining converting the PDM to PCM by applying a low pass FIR and then decimating the sampling rate.

Is this needed for my hobby project? Can I just average the PDM samples ( 0 to 1 ) over chunks of time T, to give a really simple idea of the amplitude at that time, and then feed these samples to the FFT?

How much do I need to process my PDM? I am very weak in the area of DSP.

Any help much appreciated.


1 Answer 1


In a PDM microphone, the sigma-delta convertor pushes the noise to frequency regions above the 0-20kHz spectrum. So if you'd take the FFT of the signal that comes directly from the PDM microphone, the straight zeros and ones, and only look at the bins that fall in the 0-20kHz region, you'd get the data that you need.

You can see this here, where a 16kHz sine wave has been converted to a PDM signal:

spectrum of sigma-delta converted sine wave

The noise floor on the left of the green 20kHz line is well below -70dB, but quickly increases to the right of it.

In the plot above, the PDM data rate is 768kHz. A common PDM microphone data rate will be more on the order of 3MHz. The problem with this is that you'll doing FFTs of a large amount of data and that you're throwing away a lot of unused data.

A moving average filter would indeed quickly reduce the number of data samples that go into the FFT. It will result in attenuation in the pass band that is too high for good audio quality, but it should be totally fine for an LED display.

I wrote about my own PDM microphone learnings in a series of blog posts.

  • $\begingroup$ Fantastic blog posts, this is extremely helpful thanks. $\endgroup$
    – Bob John
    Feb 24, 2021 at 13:34
  • $\begingroup$ @Tom Verveure, so we can do FFT directly on the PDM output? Is there any data manipulation that is necessary? $\endgroup$
    – Vass
    Feb 24, 2023 at 21:26
  • $\begingroup$ If you don't mind wasting the processing power of doing an FFT on much more data than is necessary (not a problem usually on a PC), then you can do the FFT straight on the PDM data. $\endgroup$ Feb 25, 2023 at 22:24
  • $\begingroup$ Old post but I wonder if there's a lot to gain by designing an FFT with only binary inputs: each input is just 0 or 1 anyway. $\endgroup$
    – pipe
    Aug 15, 2023 at 14:49
  • $\begingroup$ @pipe an FFT with only binary inputs could save some area by having lower precision operators in the first butterfly stages. But if, by doing, you need to do that FFT on a much larger number of sample points, then the end results will almost certainly be a net loss in terms of area and performance (when compared to filtering first, and then doing the FFT.) $\endgroup$ Aug 24, 2023 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.