Problem: Arduino Nano RP2040 Connect x arduinoFFT Library

How do you get or capture frequency of a sound using Arduino Nano RP2040 Connect board? I'm having a hard time doing this because the built-in microphone of this is Pulse Density Modulation (PDM) output. And i've searched something saying that PDM should be converted to Pulse Code Modulation (PCM) first before you can process it using arduinoFFT Library and capture the sound frequency. But I am having a hard time converting PDM to PCM because I cant find any resources on the internet. Can anyone help me please. Your help will be much appreciated!

The FFT library expects input in the form of digital values, an array of numbers that represents, in your case, SPL (sound pressure levels) as a function of time.

You must sample the audio input at at least twice the frequency of the highest audio frequency present. Otherwise the data will be confused by aliasing.

Are there any function or algorithm so that I can do that easily or atleast in a way that I could understand sir? I am a beginner in doing arduino.

To get started with the Nano RP2040, look for beginner tutorials and work through those.

Here is one for capturing sound: https://docs.arduino.cc/tutorials/nano-rp2040-connect/rp2040-microphone-basics

The sample buffer contains the amplitude data in integer form. You probably need to convert the data to float for ArduinoFFT.

You MUST understand and pay attention to the sound sample rate.

Thankyou, sir. I'll try to apply what I understood. And I'll update here.

I thought I need to convert the pdm to pcm first before i use arduinoFFT. This isn't true?

ArduinoFFT needs a fixed size array of numbers, representing the amplitude of the audio signal.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.