LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sound VIs with digital audio input

I am using the LabVIEW Sound VIs to capture digital audio from my sound card.  Currently I am using the digital audio output of my sound card to drive the digital input.

 

Regardless of what sample rate I choose for my capture the data appears fine.

 

My question is what mechanism is performing the sample rate conversion?  Is there anyway I can use labview to determine what the sample rate and bit depth of the input is before I setup my audio capture that way I know I am capturing exactly what the input was?

 

Also, is there anyway to capture un-coerced data?  If I know the input stream is 24 bit can I get values between -8,388,608 and 8,388,608 besides simply multiply the -1 to 1 scaled data by a constant?

0 Kudos
Message 1 of 6
(2,700 Views)

Hello j.collins,

 

Are you configuring the sample rate using the Sound Input Configure.vi?  That input also has an option for the number of bits you want per sample.  I believe the rate you can sample at is dependent on your sound card.  What sound card do you have?  The manual should specify what rates it can run at.

 

Mason M
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(2,641 Views)

Yes, I am using the 'Sound Input Configure' vi.

 

The problem I have is that since this is a digital audio input the original data stream already has a sample rate and bit depth associated with it.  I want the signal that I record to be as similar to, or exactly the same as, the signal which was tranmitted to me.

 

Is there anyway to do this with the Sound vi's, or should I be looking at a custom solution?

0 Kudos
Message 3 of 6
(2,582 Views)

Hello,

 

If your sound card is capable of reading at a given rate and you specify the Configure Sound.vi to read at that rate then it should.  Same goes for the bit depth.  If you are looking for more control then you might want to consider the Sound and Vibration Toolkit:

 

http://sine.ni.com/nips/cds/view/p/lang/en/nid/209056

 

Are you having issues with the quality of the cound you're recording? How does it compare to the original signal?

Mason M
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(2,550 Views)

If the input to my sound card was analog then it would make sense to be able to select any sample rate supported by the card; however the input to my sound card is digital.  The digital input stream already has a sample rate and bit depth.  Somewhere between the sound card input and labview a sample rate conversion is being performed. 

 

My questions are:

Who/what is performing this sample rate conversion?

What is the method being used?

Can I use labview to determine the sample rate and bit depth of the input stream before I choose the recording format, that way I can avoid the sample rate and bit depth conversion?

0 Kudos
Message 5 of 6
(2,533 Views)

Did you check the output sample rate? (for DAQ it would be the actual samplerate property) here you can check the dt value of the waveform.

The driver will choose the samplerate, OK, sometimes mark an error of a wrong analog samplerate, however if you choose the digital sound input, the samplerate is fixed by the inputstream, so I assume the output will be at the same samplerate no matter what you configured.

 

 

The sound input read has different types to choose from for the output format. to determine the digital input resolution (you can't read with the not so well supported sound vis)

Read the values as dbl and plot a histogram of the +- 4/2^16 range with 256 bins and you should be able to determine the source resolution

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 6 of 6
(2,527 Views)