Showing posts with label sonar. Show all posts
Showing posts with label sonar. Show all posts

Thursday, December 11, 2014

Omnidirectional sonar antenna

Because I'm interested in collecting indoor sonar data that has lots of multipath, it is useful to have an omnidirectional antenna either for reception or transmission.  Here's a simple design for an antenna that radiates omnidirectionally in the azimuthal plane, but rejects sound from above and below.  Roughly, it consists of two round disks with a speaker or microphone placed in the center of one of them.  This acts like a cylindrical waveguide.

Before building this, I wrote a simple boundary element method simulator in GNU Octave to test the radiation pattern.  This was helpful to choose dimensions for the disks and the spacing between them.  The simulator used a dense grid of boundary points (blue below) and propagated to a dense slice of points (green).
After a bit of tweaking, I settled on a separation of 20 cm and a diameter of 60 cm.  This yielded a radiation pattern that's roughly flat for equatorial elevations, and drops off sharply beyond that.
Here's a near field plot as well, showing the standing wave structure between the disks.
I constructed the antenna from 1/4" plywood, using 1" dowels as standoffs between the disks.  To ensure the standoffs were reasonably precisely made, I faced off their ends in the lathe, and used the lathe to drill pilot holes for mounting screws. 

I also cut a tripod mounting bracket using the router.





The speaker is mounted in the center of the top disk. 



Here is the finished antenna.


The antenna seems to reject sound from above and below pretty noticeably, but as could be expected from an omni, its overall gain is not very high.

Sonar sounder

Computer sound cards can record at 44.1 kHz, and the CPU can process this data in real time.  With a little thought, this can be pressed into service to make a simple sonar setup.  I wrote a small Python program that uses NumPy, GStreamer, and GTK to make a real-time sonar display.  With a microphone and reasonable speakers, you can sense moving targets pretty easily.  I used cheap, 10 W speakers, and made a low-ultrasound sonar waveform that works well enough.

This picture below shows the setup.  The two white speakers emit the waveform.  The microphone is a small electret wired microphone and is sitting on the laptop keyboard.  The big wooden disk is a target.



The program plays a pre-recorded waveform on the speakers while simultaneously recording audio from the microphone.  In essence, the program implements two GStreamer pipelines.  A transmit pipeline

gst-launch filesrc location=<whatever.wav> ! wavparse ! pulsesink

which gets restarted every time it finishes, and a receive pipeline

gst-launch pulsesrc ! fakesink

from which the recorded data are snatched from the fakesink using signal handoffs right before the data are deleted.  Once the data are recorded, they're sliced into equal pulses (the pulse durations are known beforehand) and aligned so that the peaks are all at the start of the recorded pulses.  Consecutive blocks of pulses are averaged sample-by-sample to reduce noise without impacting resolution.  The result looks like the following screenshot, in which the target's echo appears between 77 cm and 166 cm.



Next steps for this project:
1. Apply a constant false alarm rate (CFAR) detector to the data with a user-defined trigger and window. 
2. Locate targets using the centroid of CFAR detection blobs. From that,
3. Estimate target velocity.
4. (Farther out.)  Switch to a dual pulse repetition frequency (PRF) waveform to improve velocity and range resolution simultaneously.