LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Phase difference between signals received by two microphones

Hi everybody,

 

I'm trying to measure the phase difference between signals received by two microphones. I'm using two different USB measurement microphones that are plugged into separate USB ports. The problem I'm having is that I can't get the microphones to sync. If the microphones aren't synced up then it becomes nearly impossible to measure phase differences because the source frequency is on the order of KHz. Would it be possible to program this in Labview and sync them up or would I have to buy new hardware for this? 

 

Things I tried:

1) I tried to make the two microphones show up as the two channels of the task ID for Sound Read Input VI so that one microphone would be "left" and the other microphone would be "right". Can't find a way for this to work.

 

2) I tried to just make two separate Sound Input Configure and Sound Read Input tasks but even then, one microphone will run its task and then after the other microphone will run its task until it eventually gives me Error 4823. Either way, they're not synced up.

0 Kudos
Message 1 of 6
(3,446 Views)

I do not know if you can do it in hardware, but,

 

can you record a fiducial, like a hammer hitting a table, and use that to sync your measurements?

 

mcduff

0 Kudos
Message 2 of 6
(3,409 Views)

You can never truly do this because USB uses polling.  It's never going to be true real-time, there will always be a delay at the millisecond level.  Longer than you can perceive (humans tend to think of anything under 100 ms as being a "real time" response to input with things like mouse clicks) but even a 1 ms delay will be too much for KHz waveforms.

 

You will either need to use 1 USB device with 2 microphones, or use some kind of external hardware sync connection between the two (probably not possible with the hardware you have).

 

Or some sort of external sync as suggested, generated exactly equidistant from the 2 microphones.

0 Kudos
Message 3 of 6
(3,405 Views)

@Kyle97330 wrote:

You can never truly do this because USB uses polling.  It's never going to be true real-time, there will always be a delay at the millisecond level.  Longer than you can perceive (humans tend to think of anything under 100 ms as being a "real time" response to input with things like mouse clicks) but even a 1 ms delay will be too much for KHz waveforms.

 

You will either need to use 1 USB device with 2 microphones, or use some kind of external hardware sync connection between the two (probably not possible with the hardware you have).

 

Or some sort of external sync as suggested, generated exactly equidistant from the 2 microphones.


I see, you're definitely right, a 1 ms delay would mean a huge change in phase difference! Do you have any suggestions for a USB device? My two microphones are the UMM-6 USB Measurement Microphone by Dayton Audio:

http://www.daytonaudio.com/index.php/umm-6-usb-measurement-microphone.html

 

I also think the fiducial signal would be an interesting workaround but I'd rather have a more streamlined solution.

0 Kudos
Message 4 of 6
(3,392 Views)

Just FYI, this problem can be also solved with the new cDAQ 9185/9189 chassis. The chassis are able to synchronize to each other over an ethernet network (using IEEE 802.1AS) which will allows them to do a synchronized I/O.

 

Check out this community example: https://forums.ni.com/t5/LabVIEW-Time-Sensitive/Analog-Input-Acquisition-with-TSN-cDAQs-Example/gpm-...

 

 

0 Kudos
Message 5 of 6
(3,382 Views)

I don't think I need anything that complex... I was thinking more of a simple 2 channel audio mixer, just something that can take the two microphones, synchronize them, and then I can interface with the signals in Labview.

0 Kudos
Message 6 of 6
(3,345 Views)