nwayt001 / sono-lumo

0 stars 1 forks source link

Data pre-processing: data collection (priority 1) #3

Closed crumplecat closed 7 years ago

crumplecat commented 7 years ago

Add line of code to store mic data from the pi. @nwayt001 @alfredyu

Lets try to have this on board by the end of the week (2/10/2017?) or by Monday 2/13/2017.

alfredyu commented 7 years ago

c4941f25e0cb326d8377d9ce40dacc0f8bbb55ac changes the default behavior to read RAW audio from stdin. PCM WAV has headers but RAW forgoes them; the script should be able to work on PCM WAV but might exhibit strange behavior as it reads the header.

Performance is improved by about an order of magnitude but some testing is required. In particular, I'm not sure whether the input is buffered so I'm not sure what happens with high system load when the script can't keep up with incoming data.

Example usage:

arecord -D hw:1,0 -f S16_LE -r 44100 -t raw | python sonolumo-main.py

or

python sonolumo-main.py < prerecordedaudio.wav

alfredyu commented 7 years ago

Here's a very long recording from yesterday. Recorded using arecord (16 bit signed integer, little endian, 44.1 KHz sampling rate) and the USB mic inside a foam ball. Audacity should be able to open it.

Long recording

And here's a 60 s snippet from that file that includes specific noise types:

Short recording

It starts out with the low pitched whistling noise from the mic being in the Loc-Line. Starting at 39.5 s there's some sound from gentle manipulation of the mic. Starting at 58 s you can hear three strikes of the same xylophone key.

Loc-Line noise is pretty loud. Not sure we can filter it out easily. I believe the USB mic by default uses an auto-gain adjustment so if the noise is consistently louder than everything else it may just get clipped (so we could just ignore samples with max values in them).