Close
0%
0%

High Performance Audio ADC for Machine Learning

A system that can record high quality audio (24 bit, 48kHz 120db SNR) continuously and unattended outdoors.

Similar projects worth following
This project was inspired by the SAFE acoustics project (http://acoustics.safeproject.net), which does continuous nature recordings in the rainforest to monitor wildlife. I wanted to collect similar recordings in my local area, and analyze them for patterns with machine learning. So I want a system that can record unattended for long periods of time with high quality audio.
Requirements:
Record high quality audio - at least - 24bit 48kHz sample rate, 2 channel, 120dB SNR
Microphones - sensitive, flat response, low noise
Ability to record continuously for 1 year
Autonomous recording - fault-tolerant, minimal intervention, self-preserving
Highly configurable ADC - be able to set/adjust gain, etc while recording
Logging of other data - time, GPS location, temp, sunlight, gain settings
Ability to swap out storage while recording
Power sources - allow multiple sources, car battery, solar, mains, etc.
Weatherized - waterproof, -40 C to +40C
Software Controlled


Here is the basic hardware I have landed on:

Raspberry PI - Use a zero for low power consumption, assuming it can process the audio

Audio ADC - TI's tlv320adc6140 is used in the Amazon Echo and other continuous listening devices.  Its based on a I2S or DSP interface, which is compatible with the PI.  Specs are impressive and its highly configurable -specs.   Has lots of room to grow (4 channel, mixing, dsp, delay)  I've looked at others (PCM4222, PCM1808, SGTL5000, CS4272, AC108, DA7212), as well as USB dongles and higher-end stuff, but too expensive, too much power, too large.


Microphones - electret capsules - This is the one - AOM-5024 from PUI audio.  High sensitivity, low noise, flat response, cheap.

Preamp - Not sure its needed, since the selected ADC has mic input, analog gain of 30dB and digital gain of 27dB.  Also would require an addl low noise power source. but here is my selections for adding a differential output preamp with dual opamps at 5v with low noise:

  • ISL28290 1nV/sqrt(Hz)
  • LMP7732 2.9nV/sqrt(Hz)
  • LME49721 4.0nV/sqrt(Hz)

Enclosure - Put the raspberry pi in the stereo microphone enclosure - see these outdoor stereo microphone designs:

Wind noise - This has to be handled in any design.  From what I have found it is crucial to reduce, probably biggest factor in a quality recording.  Here are some materials I have tested that pass sound suitably but block wind:

  • Landscape fabric
  • Nonwoven - Gardus Lintcatcher - a big bag with a drawstring - seems to repel water, but maybe needs treatment. Was $5 at the big box home improvement store.
  • Nonwoven - Swiffer dry sweeping cloths -  cover a microphone capsule with this.  Can use some aluminum window screen to make a framework to drape the this over.
  • Standard open cell foam - works too, but may absorb water

Other Materials - Here is some other stuff I've collected for their sound deadening properties:

  • Plumbers putty - heavy and does not resonate.  Also HVAC putty is same, but probably more weatherproof.
  • Heavy rubber - I found a step cover made of 1/4 inch heavy flexible black rubber at the big box home improvement store.  Could be cut up in a sheet.
  • Vinyl floor tiles
  • MLV - Mass loaded vinyl
  • Car sound deadening products?  - seems not as good - made for high temps.

Code

audio-recording-firmware-raspi-tlv320adc6140 - Raspberry Pi (device tree overlay, python firmware, python continuous recording)

nature-audio-ai - Jupyter Notebooks for classification and prediction, starting with bird calls.

ADC for RPI - Eagle.zip

ADC Board Eagle file

x-zip-compressed - 791.00 kB - 05/01/2021 at 12:36

Download

  • Published code for Raspberry Pi

    Filip Mulier07/31/2021 at 13:19 0 comments

    I put the working Raspberry Pi code out on github.  It is capable of running on a Pi Zero W writing to either a USB stick or a large microsd (64GB) using about 240mA.  My power source is ~12v with a stepdown regulator.  This draws <100mA at 12 volts.

    Recording is controlled by editing a configuration script.  The script allows control over the recording format (ogg, flac, opus).  I recommend either opus for lossy compression (~100MB/hr) or flac (~600MB/hr) for lossless.  The script controls the file chunking, I have used 1 hr files.  So far I have run for multiple days, generating up to 120 files on an hourly basis.   Script also controls the gain settings of the ADC, currently analog and digital gain settings.  Metadata collection settings are also set here.

    Following metadata is stored in each audio file (most visible in Rythmbox or other music players)

    Date, Title, Artist, Album, Genre, Location, Comment (used for recording gain), tracknumber, tracktotal

    A couple odd issues:

    • I've needed to run arecord -L before my script, otherwise the ADC is not recognized by ALSA and the script fails.
    • There is an automatic shutdown flag in the config file.  When using this, I have noticed a bug where shutdown occurs prematurely at random.  If I do not have auto shutdown, recordings work the full length every time.  The code for shutdown seems straightforward, so not sure why this happens at random.

  • ADC board

    Filip Mulier05/08/2021 at 01:55 0 comments

    ADC board with 40 pin connector for raspberry pi

    Inside of the stereo microphone

    Front of microphone

  • First Log - More to come

    Filip Mulier05/01/2021 at 12:44 0 comments

    So far the following is complete in prototype form:

    - ADC board

    - Driver overlay for ADC board for Raspberry Pi

    - Python library to control ADC board settings

    - Python code to record continuous files, 1 file per hour, with compression options (flac, vorbis, opus)

    - Microphone housing with wind noise reduction

    - Around 200 hours of recordings, longest run 100 hrs which I halted.

    - Interesting recording of owls, coyotes, birds

    - some calibration of sound pressure to ADC values

    - preamp design

    I will be posting more info on the details of each!

View all 3 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates