Bat flight model

With only a pair of microphones, there isn’t enough information to fully track the trajectory of the bat. You can only get the angle orthogonal to the baseline as a function of time. However, if we make a few assumptions, it’s possible to model data and get some idea of what the bat was doing. So, if we assume that the bat was travelling in a straight line at a constant speed, we can find a starting position and velocity that agrees with the data. After a little playing around with some geometry and a python script, here’s what I came up with. The graph shows the data I reported yesterday (angle vs time) and the model trajectory:

A model for the bat’s flight across our back garden. Data in orange and the model in blue. Starting positions and the velocity components in x, y and z are shown.

While it’s probably not a unique solution and not very well constrained, the data are consistent with a bat moving at 5 m/s at a height of 4.4m, which doesn’t sound too unreasonable.

It's just a phase I'm going through

So far I've been looking at signal strength but there's another fundamental quantity that an interferometer measures: phase. Amplitude tells you how bright (loud) something is but phase tells you the direction it's coming from. How well does the prototype detector do this?

Read More

Two microphones are better than one

In radio astronomy the signals being collected are typically much weaker than the noise and a lot of effort is put into building high sensitivity, stable receiving systems. The individual telescopes are big to collect as much light as possible and hence reduce integration times. One method that can improve signal-to-noise is interferometry, where signals from two or more telescopes are cross-correlated (in pairs). The signal from an astronomical source, received by each telescope will be preserved but the noise that is different at each telescope will be different and therefore suppressed in the correlation.

The following simulations are of audio data with similar properties to my data from the prototype recorder. Sampling is at 96 kHz giving a maximum audio frequency of 48 kHz. The initial assumption is that the microphones are co-located and therefore there is no delay between receiving the same signal.

Background noise

These simulations compare the noise levels from a single microphone to that obtained by combining two of them. The data are combined in two ways:

  1. The first is a simple summation of the data streams in the time domain. This emulates a technique that is commonly used in the data collection process. Adding the two signals together doubles the signal strength (i.e. a 6 dB increase) and increses the noise by 3 dB for a 3 dB improvement in SNR overall (InvenSense Application note AN-1140).
  2. A technique used for radio interferometry is to cross-correlate the two data streams. This is done by multiplying the Fourier transform of one channel by the conjugate of the Fourier transform of the other.

The noise that is recorded from each microphone will contain a component generated by the microphone itself as well as noise generated elsewhere in the system that is common to both.

In this simulation two data streams are made that contain only random Gaussian noise with a fraction of that noise common to both that is varied. If all noise is common then there should be no difference between the single and two-microphone case. The signal noise floor has been calculated as a function of this fraction.

The following plot shows the predicted noise floor for a single microphone ("Left"), the sum from a pair of microphones and the cross-correlation of the two signals. As predicted, in the case where the noise from the two microphones is independant (i.e. fraction correlated noise is zero), the noise floor for the sum of two data streams is a factor of two (3 dB) higher. A cross correlation shows dramatic improvement in noise level. For example, data where 10% of the noise is common to both channels will result in a 10 dB decrease in noise.

Simulated noise floor as a function of the fraction of noise common to both signals.

Simulated noise floor as a function of the fraction of noise common to both signals.

We can compare these predictions with actual data from the prototype recorder. For this test, I wanted to measure the noise floor so the microphone pair was sandwiched between two pieces of acoustic foam[^1] and a two-second recording was made.

The following graph shows the power spectral density as a function of frequency for the two microphones, their sum and the cross-correlation. Unlike the simulated data, which assumes that noise is constant as a funtion of frequency, the microphones have a changing response across the band.

It should be noted that these microphones have a specified operating range of up to ~15KHz and these tests far exceed that.

The spectral density plot shows very similar noise floors within the specified range but significant differences above that. It is however very clear that the noise floor of the cross-correlated data is much lower than the individual microphone signals.

[^1]: Which we originally bought to attenuate the sound coming from my son's drum kit!

The noise floor for two microphones, their sum and cross-correlation

The noise floor for two microphones, their sum and cross-correlation

The next graph shown the difference in power levels of the summed and cross-correlated data as a function of frequency. For the range of frequencies below 15 kHz, the 3 dB change is clearly seen. The improvement in noise for cross-correlated data is approximately 10 to 15 dB with an average of ~-12.5 dB or a factor of 0.056 or 6% correlated noise. In other words, over 90% of the internal noise can be removed using cross-correlation.

Comparison of noise floors on individual microphones with summed and crossed-correlated signals.

Comparison of noise floors on individual microphones with summed and crossed-correlated signals.

Signal to noise ratio

In the next set of simulations I combined the noisy data with a 10% common component with an input signal to estimate the difference in signal-to-noise betwen single and dual microphone configurations. The expectation is that the cross-correlation technique will provide the ability to detect much weaker signals than a single microphone or the sum of signals from two microphones.

A 15 kHz signal was inserted at varying intensity. The peak value was measured and compared to the noise level. To make the comparison clearer, the summed data have been expressed as an average (i.e. (Left+Right)/2). The following figure shows measured signal strength compared to input. As the signal gets weaker, the measured signal at 15 kHz becomes more and more dominated by the noise and the curve departs the input=output line. As expected, the average and cross correlation techniques perform better than a single microphone with the cross-correlated data the most sensitive.


The next plot shows signal-to-noise ratio (SNR) as a function of input signal strength and indicates the improvement in performance. If for example, the minimum acceptable SNR is 5, the minimum signal strength is

  • 58 V/sqrt(Hz) for single mic
  • 43 V/sqrt(Hz)for summed data
  • 18 V/sqrt(Hz) for cross-correlated data.

In other words, for a SNR detection limit of 5, cross-correlated data is capable of detecting signals 3 times weaker than a single microphone and 2.4 times weaker than summed data.

Signal to noise ratio (SNR) as a function of simulated input signal strength

Signal to noise ratio (SNR) as a function of simulated input signal strength

In the next post I’ll show some real signal detections and see if SNR is improved as expected…

What is Batto?

Acoustic detectors are widely used for the non-intrusive study of wildlife. It turns out that the data collected by these detectors have some similarities to radio astronomy data, which I’m much more familiar with. I’m interested to see how applicable some of the astronomical observation and analysis techniques are and if they can be used in eco-acoustics. This blog describes my work to build a detector to collect and analyse audio data to try out some of these techniques as a proof of concept. I’m focusing on the use of multiple microphones (two initially) and cross-correlation of their signals to improve sensitivity and signal to noise as well as provide estimates of signal location and speed. Audio data at frequencies up 48 kHz are being recorded at present but the techniques will also work at higher frequencies..

The detector is based on a Raspberry Pi computer with a pair of digital microphones attached. The cost of components is relatively small, ~$100, making it a nice entry-level device for anyone who doesn’t mind wielding a soldering iron.

In the next post I’ll describe some work on using two microphones to improve sensitivity and show some initial results. Following that, I’ll look into methods to measure location and movement of signals.

The Batto Mk-I. A Raspberry Pi Zero, a pair of MEMS microphones, a battery, some buttons, LEDs and an e-paper display.