Recording and Replaying Ultrasounds

Hi everyone !

I wanted to try and record ultrasound signals from wild animals (insects, rodents...) in the 60-80kHz range, and then replay the exact same sounds.

Is anyone aware of ways of doing that with an Arduino ? By quickly scrolling though the forum I saw that most people say that Arduino is way too slow for such an application.

If indeed it is the case, maybe someone has some tips on how to achieve such a project (for a reasonable cost).

Best,

Tom

By quickly scrolling though the forum I saw that most people say that Arduino is way too slow for such an application.

That's true. :frowning:
I've forgotten what the maximum sample rate is but I do remember that accuracy falls-off above 15kHz, which means you can only handle signals up to about 7.5kHz before you start loosing resolution. And, the ADC is only 10-bits, and there is limited memory...

If indeed it is the case, maybe someone has some tips on how to achieve such a project (for a reasonable cost).

Maybe someone else can help. Soundcards/audio interfaces that sample up to 192kHz are not uncommon* and that means you can theoretically record signals up to 96kHz, but of course they are designed for audio so the electronics (including the required anti-aliasing filter) may cut-off somewhere above 20kHz.

Also, most microphones are not specified much beyond the audio range, and ultrasonic "sounds" attenuate quickly in the air so the microphone has to be close to the source.

There are similar issues on the playback side, including filtering by the soundcard or any "audio" electronics.

  • This can be tricky because Windows drivers will automatically re-sample. You can easily record at 192kHz with any old cheap soundcard, but the actual soundcard hardware might be running at 44.1 or 48kHz and the software/drivers will upsample without warning you.

Some (maybe most) of the 32 bit ARM Arduino compatibles (Teensy 3.x/4.x, STM32, etc) have analog to digital converters that are fast enough to sample those frequencies, DMA controllers to sling the data around, and native USB ports that are fast enough to offload data at such rates. Implementing such a scheme will probably involve register level programming well below the Arduino API. The cheap STM32 boards layout is pretty poor at isolating digital crosstalk to the analog inputs.

Microphones that will work at those sorts of frequencies are not the norm. Without knowing your budget ceiling, using a purpose designed USB microphone and a laptop PC is probably the quickest solution. This saves you from figuring out how to test and calibrate some home brew solution.

Download this PDF and look at the theory of operation: MFJ-5008.

It may give you ideas for recording at a normal audio frequency.

Paul

Without knowing your budget ceiling, using a purpose designed USB microphone and a laptop PC is probably the quickest solution.

And since a USB microphone will bypass your soundcard you won't have to worry about soundcard limitations.

Thanks a lot guys !

I'll have a look at the USB microphones then first and see if it's compatible with my budget :slight_smile:

Best,

Tom !

In a previous career I worked in sonar/acoustics, we were always faced with decisions such as build/buy, develop, time budget etc. Despite the apparent cost, the purpose built usb transducer with reflector (or maybe try making your own "wok", if keen) such as those shown certainly seem one of the best solutions. Especially if there is some free software too. Hopefully suitable for your budget!

If you're keen, keen to learn and/or have some development ability and resources there are other ways too, but all require cost, time and effort.

One fairly simple way would be a usb oscilloscope with a suitable "front end" and a suitable transducer/reflector. Data can be saved, and some have a "waterfall" display in addition to the normal display or fft function, useful for visualising intermittent, and various length signals accross the band. Maybe some have an "arb" sig gen function that may be able play back data into a suitable wide-band amplifier. Your still looking at substantial cost though, unless you already have one, and some and some effort .

A few years ago, i did find an open source oscilloscope that used a dsPic, maybe there are others now, and they could form the basis for an ultrasonic data-acq system at reasobale cost. I think I have also seen AVR/Arduino interfaced to highish speed ADC's via spi that could shove data fast enough into a laptop.

Also, medical ultrasound systems have devices and techniques of interest. There are also "codecs" such as made by Cirrus Logic that cover suitable sample rates, but that's another level of design.

The above receiver circuit too is good for ideas for a front end, and down-mixing signals of interest to a lower frequency for audible sounds and conversion.

Our own equipment evolved over the decades from using low-speed adc's combined with commercial analog downmixing euipment (basically superhet radio methods like above) to what is today called software defined radio, and class D pwm for transmit of fixed and arbitary waveorms, built in-house. <edit , we also did some d/a with linear amps at lower levels> Off the shelf items at reasonable cost sounds much easier :slight_smile:

I was going to mention downmixing, but @azeo has it covered.

You have several answers on recording the sounds or the product that a human can hear. Now, work on how you intend to replay the sounds using an Arduino.

Paul

and then replay the exact same sounds

when saying this do you mean at the original frequency, or audio for listening or both?