Together with my friend and colleague John Berezney, I decided to make a sonar system using a microphone and speaker. The idea is to make an active sonar system using PC speakers as output and a microphone as an input. I got some inspiration for this project from this website: http://eddiem.com/projects/chirp/chirp.htm
The first step is to make a chirp, which is just a type of pulse that changes frequency (see Figure). The audio speakers I have can only make pulses up to 20kHz (I think?), so I make chirps that vary between around 4kHz and 16kHz. I used Labview software to program the chirp and make it come out of my speakers.
Note that we have to take the complex conjugate of the Fourier tranform of the chirp signal, multiply that by the Fourier transform of the Recording in frequency space, and then inverse Fourier transform to get a signal as a function of time. The signal S(t) has spikes wherever there is a reflection. Here you see S(t) which has a strong signal where the microphone picks up the direct wave, and a weaker signal for all the reflections.
The final step is to keep making chirps (my program could make around 4 per second) and then plot the intensity vs distance vs time (yes a 3D graph on a 2D plot!). To do this, I made an intensity graph, where height represents distance away in the reflection, and the time scrolls horizontally. I was holding a sound-reflecting clipboard, and walked away around 3 meters, and then returned to the computer. You can see that as a high intensity reflection going vertical on the graph (far away) and then closer.
John and I have some fun ideas for improving our sonar, I will keep the world updated as we make more improvements! I would be happy to hear if you guys have some fun ideas for improvements! I did all the signal processing and speaker output using Labview software. I am happy to give you the source code if you are interested.