[Tutor] How can I realize a Echolot with Python on a Linux machine?

André Hilbig andre.hilbig at googlemail.com
Tue Dec 6 13:39:55 CET 2011


I am doing a special education project in Physic about the speed of
sound. I will do some experiments to measure it. At the end my pupils
should be able to build a little echolot. I want to have a very simple
buildup, so I thought of doing it with the soundcard of a computer and
python. This means that I want to use a mic to throw out a signal that
gets saved by a speaker. Then I can calculate the distance with the
time-difference and make a noise or something like that to know how far
away the next wall is. The algorithm is very easy, but I do not have the
know-how and the time to build a library that accesses the hardware.

Does anybody have some ideas how I can do this? A special library would
be nice, that can access the soundcard and measure the time difference
between two signals in realtime. I was thinking of a pulsing sinus made
by the speaker of the soundcard (or maybe by an extern device with a
fixed frequency) and measured by the mic. I had tested some things with
aubio (http://aubio.org/) to calculate the time difference, but then I
would have to write something like a deamon to handle the soundcard. And
there is always the time problem, because it should do everything in
realtime.

Maybe someone knows a special library that does the most work for me. My
main function should only do the calculation of the distance and get the
time by a simple deamon, etc.


wkr André



More information about the Tutor mailing list