1. Limited time only! Sign up for a free 30min personal tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Propagation of waves in solid and FFT

  1. Aug 29, 2007 #1

    I wasn't really sure whether to put this post under Physics or Engineering. I was just wondering whether someone can gimme some help or info or guidance... I am currently working on a project in which I am using the FFT (Fast Fourier transform) algorithm.

    In a nutshell, I am trying to use two microphones (which are plugged into each of the two channels on the line-in of a soundcard) in order to track the motion of an object sliding over a surface (such as a finger or pencil sliding over a table-top). So basically I am trying to create a wireless mouse device that uses microphones to determine position. The microphones are placed on the table-top in a particular configuration. Then, as the object slides over the surface, the microphones receive the signals and analyse them to determine (for now) the position of the object. Here's some specifics:

    - I define a rectangular surface with a set height and width which could be, as I've said, a section of a table-top.
    - I have two microphones placed on the top-left and bottom-left corners of the rectangular surface.
    - As the object slides over the surface, I collect the samples (at a particular sampling rate) and put them into the FFT algorithm.

    (Ideally:) - I then use FFT information of the waves that the object generates in the solid to determine the position of the object from each microphone. (given I will have calibrated the system against background noise)

    - Lastly, I use the two distances ( from each microphone) to triangulate the position of the object.

    BIG PROBLEM: How do I analyse and use the FFT information to be able to determine a reproducible and correct distance from the microphone? Will audio fingerprinting be of any use here? If so, how?

    Then again, should I be using the FFT algorithm at all? Is there a better way? Basically, how do I do this thing??

    I'll appreciate any comments, directions and thoughts greatly.

    Thanks again for your time and help.

    Last edited: Aug 29, 2007
  2. jcsd
  3. Aug 29, 2007 #2


    User Avatar
    Science Advisor

    This sounds like a neat project. I must say that I have never done anything like this, so I am just thinking out loud here:

    I don't see how knowing the frequency make up of the signal is going to give you the information that you need. I suppose there could be a frequency shift depending on the location of the object. I would think that you would need to look at this like a police radar detector in a way. If you had some kind of ultrasonic transmitter you could use doppler shifts to calculate the distance and speed from the two measuring stations.

    I guess the first question that comes to mind is does the movement create a measurable wave form?
  4. Aug 29, 2007 #3
    Thanks for the reply. Yeah I probably could use an ultrasonic emitter and it could probably work. But I don't wanna go that way. That's been done. And you already get commercial devices that use that principle. What I want is the intelligence of the device to be in the software rather than the hardware. I want the device to:

    1. Come out really cheap (i.e. a set of low end microphones).
    2. Be flexible in terms of the user being able to use either his finger or a pencil or anything as the object.

    If I find no other way I think I will probably eventually go that way but I'm looking for ideas in the time being...

    Thanks for the reply.

  5. Aug 29, 2007 #4


    User Avatar
    Science Advisor
    Homework Helper

    The key thing here is the finite speed of sound. If the source is a different distance from the two mikes, in an ideal world you would pick up the same signal at two different time delays.

    I'm assuming the Doppler effect will be too small to be interesting - and anyway you can't measure it because you don't know the frequency spectrum of the sound relative to the moving sound source, since it's not a transducer producing a fixed frequency.

    If you do FFTs of the two signals and look at the phase angle of each frequency component, the phase difference of each frequency component will tell you something about the time delay.

    Try it in MATLAB or whatever software you have: take a "random noise" signal, do an FFT, delay the signal by a few samples, do another FFT, then understand the difference between the two FFTs and compare the numbers you get with what the maths is telling you.

    To do this with "noisy" signals, you will have to do some sort of least squares fitting to the phases.

    A different way would be forget about the FFTs, do a correlation of the two signals in the time domain and see what delay gives the best correlation. My instinct says the FFT method will work better though.

    One issue is the resolution. If you are sampling at 44.1 KHz with a consumer-type soundcard, sound travels about 1/4 inch in one sample period. That probably limits the spatial resolution in the time domain to about 1/4 in, which is a bit crude for a mouse-type device! However with the FFT method you might be able to get better resolution because you are averaging over several samples (e.g. 256 or 1024). You will have to find the best compromise between rapid response (short FFT length) and accuracy (long FFT length).

    One big downside though: you won't get a unique answer from only 2 mics. You need 3 mic positions in a plane, or 4 mics (in a tetrahedron arrangement) in space, but consumer-type soundcards only have two input channels. The reason is, you can't distinguish between different positions with the same time delay - e.g. at every point on the line bisecting the 2 mics, the delay to each mic is the same. That's one reason why GPS position location, and earlier ground-based marine radio location systems, use more than 2 transmitters!

    But ignoring that problem, it sounds a fun project - good luck!
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook