Livestream and Record Audio with Digilent Analog Discovery 2

In this project, you learn how to record and stream live audio data by Digilent Analog Discovery 2 and Pmod MIC3 Microphone. Multiple  instruments are used to capture and display the SPI communication protocol. The audio signals collected by Pmod MIC3  are presented in the time and frequency domain.

Required hardware and software

The required hardware for this application includes

  • Analog Discovery 2
  • Pmod MIC3

Digilent Analog Discovery 2 is a USB oscilloscope, logic analyzer, and multi-function instrument that allows users to measure, visualize, generate, record, and control mixed-signal circuits of all kinds. The Pmod MIC3 Microphone is powered by Knowles Acoustics SPA2410LR5H-B MEMs microphone and Texas Instrument’s ADCS7476 12-bit Analog-to-Digital Converter.

Top view product image of the Analog Discovery 2.

Pmod MIC3: MEMS Microphone with Adjustable Gain product image.

Digilent Waveforms is a powerful multi-instrument software application and is compatible to Windows, Mac OS X, Linux and Raspberry Pi 4. With Digilent WaveForms, you can configure Analog Discovery 2 any of several instruments including Oscilloscope, Waveform Generator, Power Supply, Voltmeter, Data Logger, Logic Analyzer, Pattern Generator, Static I/O, Spectrum Analyzer, Network Analyzer, Impedance Analyzer, and Protocol Analyzer. The JavaScript is used in the Waveforms to control various instruments and plot the captured audio data.

System Design

To enable Pmod MIC3, you utilize the the Pattern Generator of Analog Discovery 2 to produce the clock and chip select signals required for SPI communication.  Pmod MIC3 transmits 16-bits of data, of which the 12 least-significant are the audio data. Samples are taken by the Logic Analyzer of Analog Discovery 2 every 500 milliseconds (or once, over a period of 1.25 seconds). These data are pushed into an array Oscilloscope of Analog Discovery 2. You can plot the audio data in time domain and frequency domain.

You can walk through demo set-up and download the Project Workspace at Digilent Documentation.