LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

sound card as a measurement device

I am trying to use PC sound card as a test platform. basically the sound card will play a wave file and analyze the signal via mic/direct input simultaneously. the code I generated seems not be able to sync them together. anyone has tips or example how to do it? Thanks.
0 Kudos
Message 1 of 9
(4,347 Views)
I share your concerns.  I am using the mic input to acquire the sound of a heartbeat.  My pregnant wife bought a device to listen to our babies heartbeat.  As the geeky engineer that I am, I wrote a LV app to acquire the sound and graph the heartbeat on a laptop.  I also calculate the heart rate.  Besides the noise on the signal, due to the cheap listening device, I have a 2 to 4 second delay on the graph and the sound that I output via the PC speaker.  Can anyone help with the delay.  I am using the simultaneous Sound IO example found in LV 7.1.
 
AJL
0 Kudos
Message 2 of 9
(4,328 Views)
 

Hi dumbidea,

There is a shipping example in LabVIEW of simultaneous sound I/O, but if you look at the block diagram of the example, you will see that the read takes place after the write which results in a delay.  If you would like less delay, I would recommend taking a look at the LabVIEW DSP module which is more geared towards sound acquisition.  As with any sound acquisition, there will still be a slight delay, but it will be much less than just using the sound VI's that come with LabVIEW.  There will always be an inherent delay in sound acquisition, just take for example a sound amplifier.  There is a slight delay between when the data is recorded and when it is played back.

Please let me know if you have any further questions regarding this issue.  Best of luck on your application, and have a great day!!

 
Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
0 Kudos
Message 3 of 9
(4,301 Views)

HI Ching,

Thanks for your comments. I noticed that example which causes delay by its coding. I am challenging LV which should be able to do multi-task by coding it differently. Is this because of the sound card itself can't handle such tasks simultaneously or simple due to LV program scheme? with today's computing power, it should have some way to get it around? what is your opinion?

Thanks again.

Regards,

Bumbidea....

0 Kudos
Message 4 of 9
(4,298 Views)

Hi dumbidea,

You should be able to program LabVIEW so that it can simultaneously read and write the sound file, but the sound card itself will introduce some delay.  For example, when you say something into a microphone on your computer, there is a slight delay from that point to when you can hear it on your speakers.  LabVIEW is unable to overcome this delay.

Please let me know if you have any further questions regarding this issue.

Best of luck on your application, and have a great day!!

Regards,
Ching P.
DAQ and Academic Hardware R&D
National Instruments
0 Kudos
Message 5 of 9
(4,271 Views)

As an aside, that's a really cool idea, AJL. Sounds like something I would come up with. I hope you get it working well, and congrats on the new baby!

Ok, threadjack over.

0 Kudos
Message 6 of 9
(4,264 Views)
here is a program I created. I thought it will perform the task "simultaneously". It did do the trick on one Dell PowerEdge. but when the code transfer to other computer, even with the same sound card, the analysis won't start until sound card finishes play wave file. see if you may find something obviously wrong in the vi from LV. thanks. (ps. I tried to include a wav file with this message, but not accepted. you may find any wav file to replace)
0 Kudos
Message 7 of 9
(4,253 Views)

Thanks Marc A. 

 

Dumbidea,

Can you repost your example code?  It looks like a cool program but your subvi's are missing so it will not run.

 

Thanks,

 

AJL

0 Kudos
Message 8 of 9
(4,231 Views)
Hi AJL
 
Could you repost the program with the subvis?
It sounds like exactly what I need to get hold of.
 
thanks
Pawel
 
0 Kudos
Message 9 of 9
(3,774 Views)