Coder Social home page Coder Social logo

makerportal / rpi_i2s Goto Github PK

View Code? Open in Web Editor NEW
28.0 1.0 10.0 1009 KB

Raspberry Pi I2S Stereo Microphone Analyses in Python

Python 100.00%
raspberry-pi i2s i2s-audio i2s-microphone python python3 audio audio-processing audio-processing-with-python rpi4

rpi_i2s's Introduction

I2S Microphone Recording on Raspberry Pi with Python

Python codes that read, save, and analyze audio input from I2S MEMS microphones on a Raspberry Pi

Raspberry Pi boards are capable of recording stereo audio using an interface called the inter-IC sound (I2S or I2S) bus. The I2S standard uses three wires to record data, keep track of timing (clock), and determine whether an input/output is in the left channel or right channel. First, the Raspberry Pi (RPi) needs to be prepped for I2S communication by creating/enabling an audio port in the RPi OS system. This audio port will then be used to communicate with MEMS microphones and consequently record stereo audio (one left channel, one right channel). Python iS then used to record the 2-channel audio via the pyaudio Python audio library. Finally, the audio data will be visualized and analyzed in Python with simple digital signal processing methods that include Fast Fourier Transforms (FFTs), noise subtraction, and frequency spectrum peak detection.

The full tutorial can be found at: https://makersportal.com/blog/recording-stereo-audio-on-a-raspberry-pi

Mono Wiring

Mono I2S INMP441 Wiring

Stereo Wiring

Stereo I2S INMP441 Wiring

Mono Output

Example Output for 557Hz Test Frequency:

I2S Mono Test

Stereo Output

Example Stereo Output for 1012Hz Test Frequency:

I2S Stereo Test

rpi_i2s's People

Contributors

josh-hrisko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

rpi_i2s's Issues

questions about data normalization in the function of data_grabber(rec_len)

Thank you very much for your tutorials and codes.

I noticed that in the function of data_grabber(rec_len), after you got the raw data from the pyaudio stream, you did not normalize it by dividing 2**15 (say the format is np.int16). I want to know if you realized it and if there is a good reason of the current choice.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.