LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I get the soundcard to create event markers on voltage acquisition

Hello,

 

I'm new to Labview and I'm required to create a program that can acquire a voltage..  sounds simple.. the difficult part is that it needs to be able to create event markers on the data to indicate that a sound has occurred.  

 

If I could somehow route the audio input to the trigger channel of my NI DAQcard6024E and set the threshold level it would work, but I can't find a way to do this.

 

To put it in a real-life scenario... what is happening is that I'm acquiring EEG (brainwave) voltages whilst presenting a series of auditory 'clicks'.  We want to examine the changes in EEG that occur in response to these clicks.  So I need to have some way of establishing exactly when the sounds were presented on the EEG data.

 

Hope somebody can help 🙂  At the moment my VI can acquire voltage data continuously and write the files to excel, but I can't work out how to create event markers for when the stimulus occurred.

 

Thanks

 

Shane 

0 Kudos
Message 1 of 16
(3,746 Views)

So you have a 6024 to sample the output of an EEG amplifier. If you have another free analog input at this card you can use  it for a mic. 

A crude way: EEG signals are low frequent. So if you sample high enough (10kHz) you can add a  small burst of a 3kHz tone as an indicator and cut it out later with a filter.

If your tone signal is always higher than 500Hz and all EEG signal of interest below 50Hz you can simply add the NF to the EEG and seperate in LabVIEW with a filter. 

 

The simplest way of adding the NF are two resistors , one from NF one from the EEG that meet at the 6024 input.

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 2 of 16
(3,727 Views)
It would be very hard to accurate synchronize sound card with a DAQ card. So the best thing is to use the DAQ card for registering the clicks. Which samplerate do use for the EEG signals? And what is the frequency of the sound clicks? Is it also no sound (silence) between the clicks?


Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 3 of 16
(3,729 Views)

Thanks for responding.  

 

Yes i understand that it's not ideal to use the soundcard rather than a spare channel in the DAQ card, but unfortunately the amplifier is connecting to the DAQ card with a D connector that doesn't allow me to use any other inputs or trigger inputs etc.  The only way around it would be to pull apart the D connector and I really don't think my lab head would like me to do this.

 

There ARE pauses between clicks.. the paradigm uses two clicks, 500ms apart.  There is a random intertrial interval (between 10 and 20 seconds).  So I need marks for every click.. and because we're looking for a response 40ms after the stimulus, precise synchronisation is required.  Lagtimes of 10ms or more will cause problems.  The sample rate is arbitrary but needs to be quite high.  I'm going at 1000Hz at the moment.

 

I like the idea of using 3kHz tone and then filtering it out, however the clicks we use are sort of standard protocol and are bursts of white noise.. I can't really just switch to 3kHz test tones.

 

At the moment I have got it working but it's far from ideal (VI attached).  The 'acquire sound' input goes through a gate and trigger to indicate when the onset of a sound has occurred and this is displayed on the same graph and written to the same measurement file as the EEG voltages.  They can therefore be plotted on the same graph.  Annoying issues at the moment are that the write file does not line up the sound onset with the voltage with reference to time (ie. they both show up with different x (time) values, but could be manually plotted).. I also don't have any way to measure that the sound input is being acquired at the same time as the voltages..  Any suggestions?  I might need to put in a constant delay somewhere to account for acquisition delays from one of the pathways, but I've got no idea how to measure the required delay.

 

Thanks for your help,

 

Shane 

0 Kudos
Message 4 of 16
(3,713 Views)

There is no magic in a using a female and male Sub D  to build a short extention cable 😉

If you use a soundcard to create the click, use a spare channel to output the wave burst (or the click itself maybe with a highpass filter). 

 

A hardware solution might be to use a 556 dual timer, one for the burst lengh and the other for 430Hz (@1000S/s) . 

 

Message Edited by Henrik Volkers on 04-23-2010 09:59 AM
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


Message 5 of 16
(3,703 Views)

I am quite sure your Lab setup do have unit named SCB-68. https://www.ni.com/en-us/support/model.scb-68.html It should be easy to connect your sound signal to this unit as it is connector box. Talk to the person responsible for the lab and tell him/her that it is important for your project that you cam make use of a free AD channel. Make some good arguments, and I am sure your problem will be saved. You can also take your request via your teacher professor. The trick is to make good arguments. Like this is imperative for my project because this....



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 6 of 16
(3,693 Views)

EEG Channels are like PC memory: There is only one thing better than a lot of electrodes: MORE electrodes!

(OK, here we are in the analog world, so a better SNR also count 😉 )

So I asume the EEG amplifier already eats up all analog channels ...

 

Dig into the spec of your EEG amp and the 6024 : If there is a spare analog channel, use it! (Shure you did it 😉 )

Next: If you have a spare digital input check if you can configure the DAQ mx to read analog and digital simultanious. I don't know your 6024 but it is most likely that it is possible.

However you need to get a physical connection to your daq card. The 68-pin female VHDCI connector isn't very common (compared to a DB9 😉 ) look at digikey.com or ask NI.

 

If you don't care about one EEG channel you can try a transformer coupling: Get a small current sense transformer and use it the as a induktion coil , driven by the (attentuated)  speaker output . One or two turns of a electrode cable trough the transformer, grounded with a 50k will give you a lot of sync signal.....  I don't know how good or bad the crosstalking will be, but you won't loose galvanic isolation!    AT OWN RISK !! If the input of the EEG amp has a bad design you might overload and kill it. EEG signals a very small 😉

Message Edited by Henrik Volkers on 04-23-2010 04:27 PM
Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 7 of 16
(3,683 Views)
For event related potentials like this where you are looking for a response in the EEG due to a stimulus, you should be able to overlay the stimulus marker on top of any one of the EEG channels.  The signal of interest (response) is 10s to 100s of milliseconds after the stimulus, so it is OK to overlay the stimulus marker onto the EEG signal at the time of stimulus.  You just need to sum the stimulus signal (perhaps with a small passive network to rectify and attenuate it) into the output of the amplifier before the DAQ card.  By tweaking the amplitude and shape of this signal you can make it so that your software can easily find these markers.  In fact, since you sum in after the amplifier, you could actually make the marker signal bigger than the output range of your EEG amplifiers (but still withing the DAQ input range) and then it makes it very simple to peak-detect the marker.
Message 8 of 16
(3,673 Views)

Henrik,  that is a great idea to create a breakout adaptor...  I'm not actually using all the input channels with the EEG, there are lots of channels spare.  My issue is not having an interface box to easily patch in to the spare channels.  However, your breakout adaptor cable suggestion could allow that.  I'm not THAT comfortable with soldering but I think I could sort it out.

 

Coq Roq.. We don't have one of those units.. the National Instruments DAQ card is actually a part of a third party product (ie.  Sandiego Instruments create scientific equipment using National Instruments DAQcards.)  Therefore their system works but does not allow for much flexibility with regard to the DAQ.. it just does what the San Diego Instrument device requires (no breakouts).

 

 

S.E. Johnson,  great minds think alike! hehe..  I am currently recording EEG voltages and audio from the sound card into one data file and onto the one graph.  My concern with this approach (using soundcard rather than the same DAQ card as EEG signals) is that I don't really trust that they are synched correctly.  In my resulting .lvm data files I get two columns for EEG (x-time, y-voltage) as well as two columns for sound acquisition.   However, the x-time values in these files do not match up and I'm suspicious that they are not completely synched but can't think of a way to test for that.  I think I will try Henrik's idea of creating a breakout adaptor without having to touch any of the expensive San Diego Instruments gear.  That way, the sound will go straight into the same DAQcard with the same clock as the EEG voltages.

 

Thanks heaps for all your help guys, I'd been getting depressed and hitting walls left-right and centre with this problem but I'm making some ground now 😄

 

Cheers,

 

Shane 

 

0 Kudos
Message 9 of 16
(3,644 Views)

I still think it should be possible to make a breakout cable. But I guess the person responsible for the Lab is not a technical person. Or he/she is more concerned about the equipment than the student projects. That is quite common among such personal.

I am also reading you are using a sound card for acquiring EEG. That is a very big NO-NO. This because sound cards are AC coupled. And this will limit the lower bandwidth to about 10Hz. So signals below about 10Hz is filtered out. EEG require a bandwidth from about 0.5Hz to 100Hz.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 10 of 16
(3,630 Views)