LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Read Microphones

Solved!
Go to solution

This should be quite trivial... I've used VISA a while ago for reading/writing to spectrum analyzers. This is quite a step down:

 

I have three mics (2 Genius - MIC-01A and the one in my laptop). The two external ones are connected via Sound->USB adapters (Sabrent USB-SBCV). So I have 1 input from my built-in mic and 2 USB inputs.

 

I wish to read these into MATLAB (simultaneously). 

 

 

Should I work with VISA? The trouble is I doubt the manufacturer will give me a list of proper commands.

 

It seems like if the Windows Sound Recorder can do it, Labview shouldn't really have any difficulty.

 

Thanks,

Alex 

0 Kudos
Message 1 of 9
(3,668 Views)
Not sure why you would first consider VISA instead of the built-in sound card functions. If the USB devices show up in windows as sound devices, then in theory, LabVIEW should see them the same way. Have you even tried the sound functions? You start with the Acquire Sound Express VI as that will display a list of sound devices.
Message 2 of 9
(3,650 Views)

Thanks very much. I didn't realize that labview too would recognize it as a sound device, so I never even considered trying. So simple!

 

Here's the current question: I think the buffer is overflowing with my settings. At the moment I'm collecting at about 0.6 duration at the max sample rate of 48000Hz. I'm getting the following error after a few seconds of running:

 

"LabVIEW:  (Hex 0x12D7) You cannot perform this operation without an active task.  Ensure that a task is active and try again. An input task might stop running if the input buffer overflows. Overflow occurs when the data is not read fast enough."

 

 

0 Kudos
Message 3 of 9
(3,642 Views)
I think it depends on what else your VI might be doing, similiar to errors with DAQmx where a lot of processing is done after the acquisition. You might need to pass the data to another loop via a queue (i.e producer/consumer architecture).
Message 4 of 9
(3,636 Views)

Thanks. 

 

What I want to do is calculate the inverse fourier transform of the cross-spectrum of 2 signals.

 iF_of_CS.jpg

How do I go about doing this? I've attached the current file.

 

Any help greatly appreciated. 

0 Kudos
Message 5 of 9
(3,623 Views)

Here is another attempt. 

 

I attempted to do: iFFT(FFT(x)*conjugate(FFT(y))) 

0 Kudos
Message 6 of 9
(3,615 Views)

Hmm.. It seems I can't find a way to connect anything to the FFT or iFFT vi's. 

 

This is the error I keep getting:

 

 "The type of the source is 1-D array of

double [64-bit real (~15 digit precision)].

The type of the sink is double complex [~15 digit precision]."

 

 

Any ideas? 

0 Kudos
Message 7 of 9
(3,602 Views)

Here is an image of the problem:

error.jpg 

0 Kudos
Message 8 of 9
(3,597 Views)
Solution
Accepted by topic author ap8888

You have been deluded by the Express VI concept and the dynamic data type. This is a quite common mistake for Labview beginners, they only see a blue wire. But do not reflect any about the real data embedded and hidden in the dynamic data type . If you want to be a good Labview programmer you should avoid the Express VI concept. The whole Express VI concept is just some flimflams that NI has glued onto Labview using very cheap glue. 

The output from the sound card is a data array with consecutive samples from the sound card. And this is the correct data to feed to the filter and spectrum functions. But the PtbyPt VIs want single data points and not arrays. So your programming strategy will not work as it is now. I see you have the context help enabled and that is good. But do not be afraid to use the detailed help option. Here you will all the info you need, and quite often a link to examples.    

 



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