Recording and analysis of audio data from Normandy

I am testing on an OrangePi with an electret + amp and USB soundcard

arecord -f S16_LE -d59 -r 44100 -D hw:2,0 -c 1 /tmp/new.wav
ls -lah /tmp/new.wav 
sudo apt-get install python-scipy python-numpy sox libsox-fmt-all
git clone --recursive https://github.com/hiveeyes/audiohealth
cd audiohealth/tools/osbh-audioanalyzer/
./build.sh 
cd ../..
sudo apt-get install virtualenv
virtualenv --system-site-packages .venv27
source .venv27/bin/activate
python setup.py develop

(.venv27)jody@orangepipcplus:~/audiohealth$ audiohealth analyze --audiofile /tmp/new.wav --analyzer tools/osbh-audioanalyzer/bin/test 
Duration: 59s
File:     /tmp/tmpXs1tsQ.wav.dat
Strategy: lr-2.1

==================
Sequence of states
==================
swarm, swarm, swarm, swarm, swarm

===================
Compressed timeline
===================
  0s -  50s   swarm           =====

==============
Total duration
==============
        50s   swarm           =====

======
Result
======
The most common events (i.e. the events with the highest total duration) are:

     The colony is mostly in »SWARM« state, which is going on for 50 seconds.
1 Like

Dear @Jodaille,

thanks for giving insights into your setup and welcome to our community!

Cool to see you are also using the audiohealth program together with the OSBH audio analyzer on your own hardware, thanks for sharing your results!

Is “swarm” really the correct detected state of your colony? I guess not… Maybe @Jabors of OSBH is interested to retrain their classifier using your audio samples to make it yield better results.

Could you provide a direct permanent download link to this specific audio sample (preferable with a good filename) and share it with us? In turn, supporting OSBH with this collaborative effort would enhance the detection quality for you and others, as far as we understood.

With kind regards,
Andreas.

P.S.: Otherwise, if the detected “swarm” state would be correct, you should probably watch out for your colony ;].

You might also want to generate the power spectrum using the “audiohealth” program:

xvfb-run audiohealth power --audiofile audio.wav --pngfile audio-power.png

Well guessed, I was testing the electret + ampli + USB soundcard on OrangePi near speakers playing Q-dance radio :-)

Can’t wait to be able to analyse the sound of the hive.

1 Like

Hello,

I think I have a too small power source for the RaspberryPi: this morning I went to replug the USB soundcard (recorder),
it has worked few hours and then Pi has restarted itself. I do no have access to the card anymore.

But I have added another usb soundcard with amp and an electret a friend of mine has given to me :

The mic is placed on the floor inside the hive, the sound seems I don’t know how to describe it :

http://jodaille.org/beehive_audio_monitor/lavalier_mic/2017-07-19-174600.wav
http://jodaille.org/beehive_audio_monitor/lavalier_mic/2017-07-19-174701.wav

I don’t think this microphone could well capture the sound for our needs, what do you think ?

true - this is a piezoceramic transducer you would rather use for burglar alarms on windows and alike. This is not a pressure-gradient microphone but due to its nature a vibration or impact sensor. It can be used as a contact microphone but you have to deal with lots of different resonances, just this protective housing counterfeits the record of the audio ambience.

On p. 23 of it’s combined datasheet you find the spec.

Hello Weef, thank you,

I have a ADMP401 MEMS, do you think I can use it adding +5v with a soundcard to record inside the hive ?

I have seen piezo microphone used for guitar “Piezo Microphone Pickup Contact Mic”, do you think it will be better than the shock sensor ?

I have a Zoom H1 Recorder that can be used as USB soundcard, the quality seems good but a bit too big to go inside.
It works well when I plug it and select the audio format but seems to drain too much current with the Raspberry or does not recover USB mode after a power fail/reboot.

Do you record your hives ? If yes what do you use for it ?

1 Like

I’m testing audio recording with the two digital I2S mics: Adafruit I2S MEMS Microphone Breakout and the Arduino ICS43432 I2S Digital Microphone, see this thread First Steps (digital) Sound Recording

Question is here: Do we need really an ordinary big sound file or can we aggregate the data and transmit only “profiles”, but that’s an other question after recording. ;-)

Hello Clemens,

I2S mics seems promising, thank you for your feedback.

Hello,

I have some unknown sounds near 8s in:
http://jodaille.org/beehive_audio_monitor/lavalier_mic/2017-08-01-125256.wav

and 6-7s in:
http://jodaille.org/beehive_audio_monitor/lavalier_mic/2017-08-01-130156.wav

does someone has an idea of what it could correspond ?

Today it has recorded 354 x 10 seconds every minutes, from 12:50:56 to 18:50:56

http://jodaille.org/beehive_audio_monitor/lavalier_mic/2017-08-01-125056.wav

http://jodaille.org/beehive_audio_monitor/lavalier_mic/2017-08-01-185056.wav

the record quality is far from awesome, with a background noise.

low et loud
http://jodaille.org/beehive_audio_monitor/lavalier_mic/2017-08-01-125856.wav

http://jodaille.org/beehive_audio_monitor/lavalier_mic/2017-08-01-132256.wav

another undetermined sound:
http://jodaille.org/beehive_audio_monitor/lavalier_mic/2017-08-01-142156.wav

Why not?! ,)
But it only needs 3,3V, so I guess you already have it on a breakout PCB, AC-coupled?

This mic was intended for cell phones, BT headsets and alike (so they’re proud that their frequency response complies TIA-920), they advertise

Flat frequency response from 100 Hz […]

but look a the high pass roll-off: at 100Hz you get about -2dB, the lowest coeffecients for OSBH/audiohealth at 43Hz are attenuated by your mic source with about 5dB, keep this in mind for subsequent equalization/dynamics.

Yes, a little, but it still does not become a pressure gradient mic but remains a contact mic intended for solid-borne sound - which is considerably different! ,) But as an addition for a ‘real’ microphone on a hive both mentioned piezo sensors are perfect, their frequency response can complete each other (bandpass filters are needed anyway).

1 Like

Hello weef,

thank you for your tips.

–I can have 3.3v on OrangePi header, but I am not sure it could go far from two/three meters, I wil try.–
It works using 3.3v on header with more than 2 m cat5 cable :D

Not a good picture but it will help to remember the wiring (Pi side)

cf:
https://linux-sunxi.org/Orange_Pi_PC

First audio jack : ground is splitted in two wires, one to sound card via jack, the other to Pi (dupont connector).
In red the microphone, orange wire goes to Pi 3.3v, black to Pi ground, green to (center) jack, brown to (ground) jack and ground of mic (+ black dupont to Pi ground)
In back USB audio card, jack in mic input

but there is an impact on the mic (done with aligator clip, oups …)

the first record after increase mic level in alsamixer (be careful about the volume) :

I have removed the knock sensor last week, it seems bees do not like it (propolis) :

I better understand now why there was like eating/crunching sound in the records :-)

–I will try to put the mems mic under the roof to not disturb them too much.–
The mic is under the roof cover, the last box was not build at all, it is empty.

The sound is hummm less, below is a 10s record at 19:02:56 the 5th of august :
http://jodaille.org/beehive_audio_monitor/2017-08-05-190256.wav

2 Likes

Hello,

I have added an audio embed that plays 5 seconds before an after the snapshots.

http://jodaille.org/full/range.php

So picture snapshot is done automatically and sound recording also. Great!

You have 199 pictures per day is this a whole day? For me the time code is not clear it starts at 063001 and ends with 095801, first i thought this are seconds but 095801 / 60 = 1597 minutes / 60 = 26.7 hours, hmmm. This information in a human readable format would be great.

Where is the position of the microphone, still under the roof? It sounds some times like a car or bicycle (see - or better hear e.g. 071101, this is pic 41 of the day 2017-08-11 ;-) Is the mic outside or is this an artifact we already discussed before?

Do you have covered the mic with a mesh or cage? Like the example in this thread: I2S Mikrophone? It sounds really like bees can go nearby the mic and produce so “interesting” sound. We should remember this for an future art project in case the beekeping stuff is sometime finished! ;-)

The sound at all is still buzzing, but not from bees more artificial. So I think optimization on this side would be great before going in the sound analyzing direction.

The position of my mic (a mobile phone only!) was under the mesh of the floor board. As I can see you have a solid floor board so this is no option. But the sound on this position is more “active”, see Sound Samples and Basic Analysis Hive with Queen vs. Queenless and also Apivox recommend to position the mic near the entrance. I don’t know if this is due to convenience on the measuring approach or with regards to content.

But over all fantastic!!

Hello Clemens,

No, it is the images taken from 6:30 to 9:58 (one per minute)

I am using two cron tasks that run every minutes each.
The first one (on Raspberry Pi) do a wget on the IP address of the camera, if the light sensors (in the log) reaches a threshold (daylight).
The files names format is year-month-day-hoursminuteseconds (date +%Y-%m-%d-%H%M%S in bash),
for example: 2017-08-11-103601.jpg
The second cron task (on OrangePi) waits 55 seconds then starts recording for 10s with arecord, I have not yet implemented the daylight check.
If you go back to the page, you should be able to see more images.

The mic is between the mesh and the under roof cover, the last box is empty (from down to high), bees have access but have not built inside.
We can sometime hear a metal vibration it could be the mesh.
The buzz could be a result of the wire length, I have not used a coaxial but a cat 5 (soft) cable or the result of the impact of the aligator climp when I have soldered the mic, or maybe parasit noises due to electricity.

The previous mic on the floor was giving a bad sound but its location was better, I have order other sound cards + mems mic. I have a ds18b20 in the center of the floor, I can make another hole an put another mic :-)

For now all the records can be found at: http://jodaille.org/beehive_audio_monitor/
but I will soon have problems with too many files in the directories, I am archiving images by day for that.

1 Like

Dear Jody,

thanks a bunch for writing about and sharing your efforts. Great work and keep it up!

Thanks for mentioning that. We are aware of this problem and will address that important detail when implementing our long-term media storage API we are currently discussing in Web-Service "Audioanalyse".

Cheers,
Andreas.

Hello,
I have added a mic near the entry (outside),
the record:

the other (roof)

the mix of two (stereo):

Hello,

The only way I have found to reduce the “power” noise is to power the ADMP401 with two AA batteries

Oh and the ADMP401 breakout has a hole on the back of the circuit where the sound comes in …

1 Like

So this means decoupling from a power plug with 50 Hz?

Well I am not an expert, initially the power came from 3.3V of Orange Pi that were powered by an AC adapter.
I then try to use a voltage converter to get 3V from USB (of the soundcard) with no luck,
I then also try a “Wemos battery shield” that provide 5V and/or 3V from a 18650 battery (only powered by battery)
The last try and the only “successful” was with the two AA batteries in series to provide 3V.
That lets me think that 50Hz may not be the (only/main) source of the noise.

The good news is that the circuit on ADMP401 breakout seems not very power hungry, it is running from more than 3 weeks.