Saturday 7 April 2018

Bat Call Logger: full-spectrum analysis

With the recent step change in the weather, I was able to run the system last night and capture bat calls for the first time this year.


It looks like my modifications to the system are paying off.


I'm now getting full-spectrum (ultrasonic) recordings which are much easier to analyse than the previously used Frequency Division recordings.


Background


My system started life as a Frequency Division (FD) bat detector, with poor sensitivity. Since then the circuit has been improved, a better transducer has been fitted, and the system expanded to allow automatic recording of bat calls. So while I'm safe inside in the warm, watching "Shed & Buried" on the Travel Channel, my bat call logger is doing most of the hard work for me.

I was finding it difficult to make much sense of the FD recordings, where each recording showed a signal that had been divided by 8 (e.g. a 48kHz ultrasonic call is divided by 8 to produce an audible signal at 6kHz). But during the winter I fitted a Wolfson audio card which supports a sampling rate of 192kHz. This allows frequencies up to about 95kHz to be captured by the system, and results in spectrograms which look much more like those shown in Jon Russ's book (British Bat Calls).

The second most significant winter modification was the implementation of "pre-capture". This basically ensures that I save a short recording just before the system is triggered. Looking through last nights recordings, the actual calls are often on the pre-recording, while the subsequent recording is sometimes empty. This shows that the system is taking too long to respond.

latest recordings


Sunset was at 17:42 last night, and the first bat call capture was about 30 minutes later. From 8:15 until 10:30 the system made over 80 recordings, each one is 10 seconds in duration. Having deleted all the empty files, and a few that clearly are of no use, I'm left with 44 that I believe contain bat calls and another 20 or so that contain some kind of unknown signal.

I'm still wading through these recordings, but here is one which I have analysed using Audacity.



The top trace is the full-spectrum recording showing signal amplitude against time.

The second (middle trace) is the FD signal which is of little interest, so I've squashed it down to a narrow strip. However, one interesting point is that it only includes 8 calls, rather than the 18 visible on the first trace. This means that the lower amplitude calls have not triggered the div-by-8 circuitry. This is one of the reasons that analysis was proving difficult using the FD signal.

The third trace is a spectrogram based upon the first (full-spectrum) trace. This shows the frequency components of each call, and illustrates the characteristic "hockey stick" shape associated with certain bat species. Although it may not be clear from this illustration, there are in fact two additional leading calls visible on this spectrogram, which are not visible from the full-spectrum trace. This gives an indication of the power of this technique to 'pull signals out of the noise'.

I can also use the spectrum analyser feature of Audacity to find the dominant frequency of each call (FmaxE), the start frequency, and the end frequency.

the dominant frequency (FmaxE) is about 48kHz

I can confirm that this is [probably] a common pipistrelle bat by comparing parameters with typical values for pipistrelles (both common & soprano values shown);
  • FmaxE: 48kHz (common pip, typ 42 - 50kHz) (sop pip, typ 50 - 64kHz)
  • start frequency: 52kHz (common pip, typ 50 - 95kHz) (sop pip, typ 64 - 108kHz)
  • end frequency: 48kHz (common pip, typ 40 - 50kHz) (sop pip, typ 50 - 64kHz)
  • call duration: 8-9ms   (common pip, typically 3 - 9ms) (sop pip, typ 2 - 8ms)
  • call period: 150-180ms (common pip, typ 60 - 210ms) (sop pip, typ 51 - 217ms)

This is what the call sounds like when the timescale of the full-spectrum recording is stretched 15 times (i.e. frequency is divided by 15):




more to do


Analysing bat call waveforms sure is time consuming, and an automatic bat call logger can create lots of sound files!

So I need to consider ways of speeding up or automating some steps in the process. The first step would be some way to scan the files for content and delete the duds.





2 comments:

  1. So... what are the chances of 50 quid usb condenser mic (like the sub zero 500) of working nicely to record up to 80khz? I’m only single digit IQ, and poor as a church mouse, so looking for something like the dodotronic without the cost!

    ReplyDelete
  2. The problem with trying to choose a microphone for bat detection, is that the specifications rarely include the frequency response above 20kHz. The exceptions include the Patterssen USB mics which cost SEK3500 (about £300).

    Most USB mics aimed at the audio market won't be suitable because the internal A-D converters generally have a max sample rate of 44-48kHz. According to Harry Nyquist, the sample rate has to be at least twice the upper audio frequency that you hope to capture. So even the sub 500 will probably only have a high frequency response up to 24kHz (i.e. 48k/2). If you already own one of these you could establish the sample rate (are you on Linux, OS or Microsoft?).

    Even if you buy a cheap electret mic insert (£5 - £15) you still need a sound card with a sample rate of 192kHz to give a high frequency response of 80-90kHz. (some notes here: https://captainbodgit.blogspot.com/2018/02/bat-call-logger-wolfson-frequency.html and here: https://captainbodgit.blogspot.com/2017/09/building-your-own-bat-detector-is.html).

    As I've already been around this loop, I can tell you that none of my laptops can sample audio any faster than 48kHz.

    Maybe the best option would be an audio USB dongle + a Panasonic WM61A mic insert, but a quick search for dongles that support 192kHz sample rates didn't reveal much below £100 (check out M-Audio & maybe Toslink).

    Once you have the ability to record bat calls on your computer, how will you trigger record?

    ReplyDelete