Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 66923

Zero Crossing issue for calculating ITDs from two Microphones

$
0
0

Hello All,

 

Basically I'm trying to determine the location of a sound source using ITDs (Interaural TIme Difference)

I'm trying to calculate ITDs in the analog data recieved from the two microphones, so I decided to the find out the time at which the both signals crossed the x-axis (zero crossing) using the time difference between the two signals I should be able to the calcutate the ITD (the difference between the two time values would be the ITD).

 

- I'm using the NI USB 6211 to get my analog data from the microphones (@ 200samples / 2k Rate(Hz)

- Then I detect for a zero crossing in the two signals when a zero crossing occurs then I measure the time of the crossing then using the time value of the both the inputs I try to calculate the ITD

-  I'm calculating the Mean DC offset of the two signals so I subtract that from my signal so the signal actually crosses the x-axis since both of the signals start at a DC offset of about 0.26V. The subtracted signal is fed into the zero crossing vi  

- Then everytime a crossing occurs I view the time so I can use that to compare with the zero crossing of the other signal 

 

 

Issues:

- I'm not able to store the time value of when the zero-crossing occurs so I want to be able to store the time value when a zero crossing occurs in an array so I can view the last zero crossing (at present the time just 'pauses' everytime a zero crossing occurs) but it's not stored anywhere

- Also I only want to subtract the time values everytime a crossing occurs but since the case structure outputs a zero when a crossing doesn't occur most of my ITDs are zero

is there a way the subtracting only occurs when the time values are greater than 0, I try to do this using the 'greater than 0' but I want it to output the value everytime it is greater than 0.

- I'm sure this isn't is the best way to calculate ITD so I would appreciate it if someone could help me improve my method

 

 

I've attached my attempt at this so any help/suggestions would be great. 

 

Kevin

 


Viewing all articles
Browse latest Browse all 66923

Trending Articles