Raspberry Pi Bat Detector
- KVRian
- Topic Starter
- 799 posts since 25 Apr, 2011
This is not really a music project, but it is an audio gadget.
I built a real-time pitch-shifting time-stretching device, using a Raspberry Pi Zero running in 'bare metal' mode (i.e. without any operating system). It's basically a kind of granulator which slows down incoming audio by up to 4 octaves, but works in approximately real-time by overlapping the slowed down sounds as necessary.
I originally designed it for listening to slowed down birdsong, but the mics I used are responsive up to 100KHz so it's turned out to be a rather effective bat detector - it's very cool to hear them chirping as they fly overhead at dusk.
I recorded the output of a session, trimmed out the silences and tidied it up a bit: Pipistrelle bats audio
There is more info on the project here.
I built a real-time pitch-shifting time-stretching device, using a Raspberry Pi Zero running in 'bare metal' mode (i.e. without any operating system). It's basically a kind of granulator which slows down incoming audio by up to 4 octaves, but works in approximately real-time by overlapping the slowed down sounds as necessary.
I originally designed it for listening to slowed down birdsong, but the mics I used are responsive up to 100KHz so it's turned out to be a rather effective bat detector - it's very cool to hear them chirping as they fly overhead at dusk.
I recorded the output of a session, trimmed out the silences and tidied it up a bit: Pipistrelle bats audio
There is more info on the project here.
- Beware the Quoth
- 33163 posts since 4 Sep, 2001 from R'lyeh Oceanic Amusement Park and Funfair
What did you use for the high-frequency audio capture?
my other modular synth is a bugbrand
- KVRian
- Topic Starter
- 799 posts since 25 Apr, 2011
The microphone is a PDM device that emits a stream of 1's and 0's that encode the acoustic pressure - the more 1's in a given interval, the higher the pressure. It's clocked at nearly 5 MHz, so it's quite capable of encoding 100KHz audio. You have to do some noise-shaping/filtering on the stream to reconstruct an audio signal, particularly if you're interested in the higher frequencies, but the processor on the Pi has a built-in 'peripheral' that does some of that for you - I did the rest of the job, and stored/added the signal into a circular buffer.
It's working the processor pretty much flat out, I had to cut a few corners to get it to produce an acceptable sound quality, but in the end I was pretty happy with the result.
It's working the processor pretty much flat out, I had to cut a few corners to get it to produce an acceptable sound quality, but in the end I was pretty happy with the result.
- KVRAF
- 7746 posts since 13 Jan, 2003 from Darkest Kent, UK
- KVRAF
- 2268 posts since 10 Jul, 2008 from Orbit NE US
Good work
gadgets an gizmos..make noise https://soundcloud.com/crystalawareness Restocked: 3/24
old stuff http://ww.dancingbearaudioresearch.com/
if this post is edited -it was for punctuation, grammar, or to make it coherent (or make me seem coherent).
old stuff http://ww.dancingbearaudioresearch.com/
if this post is edited -it was for punctuation, grammar, or to make it coherent (or make me seem coherent).
-
- addled muppet weed
- 105824 posts since 26 Jan, 2003 from through the looking glass
-
- Banned
- 2525 posts since 4 Jul, 2019
excellent quality sound
-
- KVRAF
- 2265 posts since 30 Aug, 2004 from Lancaster, UK
This is amazing work! Not just tech-wise but also the end result per se. I read in EM back in the days that with a mic that goes up to 60 kHz, you can record insects on/under tree bark. When down-pitched, the sound is supposed to be very cool. (If you try it and it works, then please upload the track, because I have always wanted to know what it sounds like.)
Hmmmm.... just came to think of that we have six or seven unopened boxes of Pis in the office. Hmmmmm......
Hmmmm.... just came to think of that we have six or seven unopened boxes of Pis in the office. Hmmmmm......
Thu Oct 01, 2020 1:15 pm Passing Bye wrote:
"look at SparkySpark's post 4 posts up, let that sink in for a moment"
Go MuLab!
"look at SparkySpark's post 4 posts up, let that sink in for a moment"
Go MuLab!
- KVRian
- Topic Starter
- 799 posts since 25 Apr, 2011
Thanks - the audio file was tidied up a bit, but it pretty much reflects what you hear live. I'll have to try listening to tree bark some time, sounds intriguing!
If you have Pis floating around, have a go - but watch out, it's addictive! I've recently discovered the 'circle' bare-metal environment, which is really very good - it makes things much easier.
If you have Pis floating around, have a go - but watch out, it's addictive! I've recently discovered the 'circle' bare-metal environment, which is really very good - it makes things much easier.
-
- KVRAF
- 2265 posts since 30 Aug, 2004 from Lancaster, UK
Hi again,kryptonaut wrote: ↑Fri Nov 08, 2019 8:47 am Thanks - the audio file was tidied up a bit, but it pretty much reflects what you hear live. I'll have to try listening to tree bark some time, sounds intriguing!
If you have Pis floating around, have a go - but watch out, it's addictive! I've recently discovered the 'circle' bare-metal environment, which is really very good - it makes things much easier.
I read the stuff on your web page and also noticed your thoughts on different sounds and communication amongst bats. My brother is a scientist in biology and he asked a colleague about this, in relation to your webpage. Here is the answer (it's a Google translate, so linguistically it's a bit off, but you get the picture):
(Must say Google Translate is actually very good! )Yes, bats can have many different sounds, and many of them tend to be species-typical. Each species uses a special sound to orient and find insects, ie. sonar sound. This song has a characteristic rhythm, frequency, etc. Some species alternate between two or more different sonar sounds. Their sonar also varies a bit depending on where and how they fly.
In addition to this, they have a lot of social sounds, the most characteristic of which is usually the male's leprosy when they claim mating revelry. You may have heard gray-skinned bats yourself? It claims mating revelry around the castle and cathedral in Uppsala [Sweden] in October and you can then hear a rhythmic ticking sound without a detector.
The example below [i.e. your MP3 file] with the pipistrell is also a typical social song. Now I do not know what it is for a pipistrell that he has heard, but our usual pipistrell in Sweden, Pipistrellus pymaeus, has a sonar which is at 52 kHz. It also has a species-characteristic swirling sound that can be heard at many different frequencies, down to 20 kHz. In time expansion [i.e. down-pitching] it sounds like a drill.
Thu Oct 01, 2020 1:15 pm Passing Bye wrote:
"look at SparkySpark's post 4 posts up, let that sink in for a moment"
Go MuLab!
"look at SparkySpark's post 4 posts up, let that sink in for a moment"
Go MuLab!
-
UltimateOutsider UltimateOutsider https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=216800
- KVRian
- 810 posts since 5 Oct, 2009 from Portland, OR
- KVRian
- Topic Starter
- 799 posts since 25 Apr, 2011
Thank you very much for your interesting post. I haven't been aware of any clicks without using the detector, but I remember as a teenager I used to be able to hear bat calls, presumably pipistrelles, right at the limit of my hearing range. That was around 40 years ago though, and I can no longer hear such things - hence building the detector!SparkySpark wrote: ↑Fri Nov 08, 2019 10:52 pm I read the stuff on your web page and also noticed your thoughts on different sounds and communication amongst bats. My brother is a scientist in biology and he asked a colleague about this, in relation to your webpage. Here is the answer (it's a Google translate, so linguistically it's a bit off, but you get the picture):
-
- KVRAF
- 2265 posts since 30 Aug, 2004 from Lancaster, UK
kryptonaut wrote: ↑Mon Nov 11, 2019 8:40 amThank you very much for your interesting post. I haven't been aware of any clicks without using the detector, but I remember as a teenager I used to be able to hear bat calls, presumably pipistrelles, right at the limit of my hearing range. That was around 40 years ago though, and I can no longer hear such things - hence building the detector!SparkySpark wrote: ↑Fri Nov 08, 2019 10:52 pm I read the stuff on your web page and also noticed your thoughts on different sounds and communication amongst bats. My brother is a scientist in biology and he asked a colleague about this, in relation to your webpage. Here is the answer (it's a Google translate, so linguistically it's a bit off, but you get the picture):
You're welcome, it's very interesting actually. I personally wasn't aware bats were communicating with their sounds... but then again, why shouldn't they? Nature is fantastic and I'm glad you get this opportunity to experience it. Let us know if you can hear the insects eating wood!
Thu Oct 01, 2020 1:15 pm Passing Bye wrote:
"look at SparkySpark's post 4 posts up, let that sink in for a moment"
Go MuLab!
"look at SparkySpark's post 4 posts up, let that sink in for a moment"
Go MuLab!
-
- KVRAF
- 2265 posts since 30 Aug, 2004 from Lancaster, UK
SparkySpark wrote: ↑Mon Nov 11, 2019 11:46 pmkryptonaut wrote: ↑Mon Nov 11, 2019 8:40 amThank you very much for your interesting post. I haven't been aware of any clicks without using the detector, but I remember as a teenager I used to be able to hear bat calls, presumably pipistrelles, right at the limit of my hearing range. That was around 40 years ago though, and I can no longer hear such things - hence building the detector!SparkySpark wrote: ↑Fri Nov 08, 2019 10:52 pm I read the stuff on your web page and also noticed your thoughts on different sounds and communication amongst bats. My brother is a scientist in biology and he asked a colleague about this, in relation to your webpage. Here is the answer (it's a Google translate, so linguistically it's a bit off, but you get the picture):
You're welcome, it's very interesting actually. I personally wasn't aware bats were communicating with their sounds... but then again, why shouldn't they? I too grew up in Uppsala and remember hearing the bats by the river. Haven't heard them for a while, now that you mention it. Must be because of the -->
Anyway, nature is fantastic and I'm glad you get this opportunity to experience it. Let us know if you can hear the insects eating wood!
Thu Oct 01, 2020 1:15 pm Passing Bye wrote:
"look at SparkySpark's post 4 posts up, let that sink in for a moment"
Go MuLab!
"look at SparkySpark's post 4 posts up, let that sink in for a moment"
Go MuLab!