Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Highlighted

08-18-2014 07:25 PM

Options

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

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

08-19-2014 03:37 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

Hi kg21,

It seems like you might need to go more low-level than the DAQ Assistant is capable of. Have you looked at any of our analog input DAQmx examples, like the Voltage - Continuous Input.vi? These show how to code lower-level programs that will give you more flexibility in how you manipulate and access your data.

That being said, could you add some comments into your program so it's easier to understand? This will help with troubleshooting.

Julian R.

Applications Engineer

National Instruments

Applications Engineer

National Instruments

08-19-2014 11:17 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I've looked at some examples of DAQmx functions and I guess I can look more into those examples.

Sorry about not adding in comments but I can give you a basic rundown of what I'm trying to do:

- First I get the analog inputs from the NI USB 6211 DAO which then I split up to two separate signals which are top mic and bottom mic, just so I know which plot is which..

- Then I get the Mean DC offset of the two signals so I can subtract that from my signals because then 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 function which is fed to the case structure as the input.

- So then every time a zero crossing occurs I get the time stamp and then get just the seconds in a string which then I convert to a DBL which is the output of the case structure then I subtract the two values I get from the case structures but I would like to output just the zero crossing times however at the moment it outputs a zero when ever a zero crossing doesn't occur. I want to be able to store the previous zero crossing time so I rather than subtracting a zero crossing time from one input with a zero from other output, I need a way to subtract just the zero crossing times of the two inputs. So in the case a zero crossing doesn't occur I want to the subtract the current crossing time with the last crossing time rather than 0. Then I would like to store the ITD values in an array so I can view them on the fly as in real time.

- Before I get an ITD I'm trying to get the values that are greater than 0 using the select function but I'm unable to output only the values that are greater than 0. So half of my iTDs are generally zero or it generally subtracts a crossing time from one input with a zero, if a crossing hasn't occured for the other input. Is there a way to subtarct the current timing value with the previous crossing time of the other input and then storing the values in an array.

Thanks for the help

Kevin

08-19-2014 11:26 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report to a Moderator

I've looked at some examples of DAQmx functions and I guess I can look more into those examples.

Sorry about not adding in comments but I can give you a basic rundown of what I'm trying to do:

- First I get the analog inputs from the NI USB 6211 DAO which then I split up to two separate signals which are top mic and bottom mic, just so I know which plot is which..

- Then I get the Mean DC offset of the two signals so I can subtract that from my signals because then 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 function which is fed to the case structure as the input.

- So then every time a zero crossing occurs I get the time stamp and then get just the seconds in a string which then I convert to a DBL which is the output of the case structure then I subtract the two values I get from the case structures but I would like to output just the zero crossing times however at the moment it outputs a zero when ever a zero crossing doesn't occur. I want to be able to store the previous zero crossing time so I rather than subtracting a zero crossing time from one input with a zero from other output, I need a way to subtract just the zero crossing times of the two inputs. So in the case a zero crossing doesn't occur I want to the subtract the current crossing time with the last crossing time rather than 0. Then I would like to store the ITD values in an array so I can view them on the fly as in real time.

- Before I get an ITD I'm trying to get the values that are greater than 0 using the select function but I'm unable to output only the values that are greater than 0. So half of my iTDs are generally zero or it generally subtracts a crossing time from one input with a zero, if a crossing hasn't occured for the other input. Is there a way to subtarct the current timing value with the previous crossing time of the other input and then storing the values in an array.

Thanks for the help

Kevin