New Reply

How to record in to matlab using two microphones simultaneously?

 
Share Thread Thread Tools
Jun8-12, 12:38 PM   #1
 

How to record in to matlab using two microphones simultaneously?


I’m working on a project to make a sound source locator. My theory is to detect the sound using two microphone located at a known distance and find out the time delay to make out the direction of the sound.
I am using matlab to take input from the microphone.
To take input from two microphones, I used two laptops.
I need the recording to start automatically, so I used Internet time synchronisation in both the laptops and then wrote a code in matlab to start the recording at a specified time.
But the problem is that, the internet time synch is not accurate enough. I need something like millisecond precision.
That’s not happening with internet time synch.
Any solutions to any part of the problem?
PhysOrg.com
PhysOrg
science news on PhysOrg.com

>> Bird's playlist could signal mental strengths and weaknesses
>> Minus environment, patterns still emerge: Computational study tracks E. coli cells' regulatory mechanisms
>> Bacterium uses natural 'thermometer' to trigger diarrheal disease, scientists find
Jun8-12, 09:33 PM   #2
 
Quote by sudevschiz View Post
I’m working on a project to make a sound source locator. My theory is to detect the sound using two microphone located at a known distance and find out the time delay to make out the direction of the sound.
I am using matlab to take input from the microphone.
To take input from two microphones, I used two laptops.
I need the recording to start automatically, so I used Internet time synchronisation in both the laptops and then wrote a code in matlab to start the recording at a specified time.
But the problem is that, the internet time synch is not accurate enough. I need something like millisecond precision.
That’s not happening with internet time synch.
Any solutions to any part of the problem?
Hey sudevschiz and welcome to the forums.

The one thing I can recommend is to check what network protocol you are using and also don't use the internet if you don't have to: use a LAN cable and connect it directly to both computers (you will need to use a special LAN cable and not the same one you use for connecting to a router for example).

So use a LAN cable and look into something like UDP over the reliable TCP/IP if you need more speed since the LAN will provide a high degree of reliability which means UDP should be good to use.
Jun9-12, 08:08 AM   #3
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
A regular PC running windows won't be accurate to better than a few ms at best (1 ms if you are lucky). If you need to sync to 1 ms you need a real-time OS, OR a hardware solution of some sort. There are professional solutions for "distributed" recording but they are very expensive.

This would be an easy problem to solve if the computers can be connected to cables (just record a common sync signal and use that to sync the signals in post-processing)?
If not, you need some sort of external hardware.


.
Jun9-12, 10:12 AM   #4
 

How to record in to matlab using two microphones simultaneously?


I found somewhere in the internet that it's possible to make another laptop in a network with the time of my laptop by announcing myself as the time server.

Anybody has any idea about that?

Or should I think about jumping in to the next step and working with a micro controller which can take multiple inputs from two microphone?

Do you think a micro controller can provide me the accuracy required?
If yes, which one?

Is it a good idea to move on to the hardware level without confirming the theory I have?
Jun11-12, 06:43 AM   #5
 
Recognitions:
Gold Membership Gold Member
Science Advisor Science Advisor
You need to figure out exactly what you want to do.

Using a microcontroller would be difficult, and it would not necessarily solve the main problem which is that it is difficult (but not impossible) to accurately sync over a standard network.
You might as well just install a real-time OS on your two laptops.

There are already frameworks for accurate syncing over networks, in particular IEEE Standard 1588 which -I believe- should let you sync two events with microsecond accuracy if you use real-time targets and an external 1MHz oscillator as a reference (at least this is what Labview claims to be able to do which uses said framework).

But again, this would be an easy problem to solve if you could just connect your two laptops using a cable ( a standard coax-cable would on). Then you could just use a common sync signal (which could even be generated by the soundcard on one of the laptops). You could then do a stereo-recording, with the mic connected to e.g. the left channel and the sync signal to the right.
Aligning the signals in post-processing would be easy.
Jun23-12, 05:07 PM   #6
 
I used to work at Autec in the Bahamas and we used hydrophones all over TOTO, on the bottom in patterns and hanging vertically. They picked up pings from torpedo's and such and the old computers of the day had no trouble tracking them in real time, well real time minus the time of flight of the sound but all the signals of all those hydrophones were digitized and sent over microwave to the main site where a computer with all the power of a commodore 64 generated 3D information as to the location of the torpedo being tracked and then plotted on 3 separate plot boards, XY in one, like looking down at the top of a fishtank, then XZ, like looking at one side and YZ looking at the other side, you could figure out just where the torpedo was very quickly.

I imagine things have gotten a whole lot faster now with modern computers and such and probably much higher bandwidth links, maybe even fiber optic by now.

Why can't you have a variable delay in one sound track and carefully adjust that to sync sound sources? For instance, you can use one of those child's toy clickers to send out a pulse that would bounce off walls and such and one click propagation would arrive at a mic before the other depending on where the mics were placed. Send me an email to dnphoton@ptd.net as I have a similar project but with different aims, maybe we could help each other. Name here is Don.
New Reply

Tags
gadgets, matlab, time synchronisation, two microphone
Thread Tools


Similar Threads for: How to record in to matlab using two microphones simultaneously?
Thread Forum Replies
solving four ordinary dif equations simultaneously using ode45 matlab Math & Science Software 12
Solving two ODE's Simultaneously using MATLAB Math & Science Software 0
Matlab: Fitting to two functions simultaneously Math & Science Software 5
Any free that can record and edit simultaneously? Computing & Technology 6
Scientists record new internet speed record Computing & Technology 11