miketeachman / micropython-esp32-i2s-examples

Usage and examples for I2S support on the ESP32 microcontroller
MIT License
145 stars 29 forks source link

Working on a PyCom FiPy with INMP411, searching for a FFT analysis part #14

Closed ClemensGruber closed 3 years ago

ClemensGruber commented 3 years ago

We can confirm that the record-mono-mic-to-sdcard.py example works with slight adaptions on a PyCom FiPy with an INMP411 I2S mic, see for details: https://community.hiveeyes.org/t/erschliessung-von-i2s-support-und-fft-fur-micropython-auf-pycom-esp32/2331/30

We used our home brewed firmware with your I2S driver, the official PyCom firmware has this driver not build in yet! Use at least version FiPy-1.20.1.r1-0.7.0-vanilla-dragonfly-onewire-i2s.tar.gz or better a newer release, see Dragonfly firmware for Pycom/ESP32.

Now we like to analyze the audio stream with a FFT to get smaller data packages we can easily forward with a not so high bandwidth telemetry. Do you have some code or examples to analyze the I2S output with a FFT or can point us to existing snippets?

ping @amotl

miketeachman commented 3 years ago

I don't have a FFT example. The closest example I have is for a dBA sound level meter that uses I2S audio samples as input. This might help to implement the FFT using I2S?

C code for dBA measurement https://github.com/miketeachman/micropython/blob/esp32-i2s-streetsense-littlevgl/ports/esp32/moddba.c

MicroPython implementation of DBA measurement https://github.com/miketeachman/micropython-street-sense/blob/master/streetsense.py#L923 https://github.com/miketeachman/micropython-street-sense/blob/master/streetsense.py#L969