Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-USB 9229: how to do audio signal acquisition?

Solved!
Go to solution

Hello,

 

this is one of those stupid beginner questions 🙂 I am using a NI USB 9229 to capture audio signal from my computer's line out as follows:

- line out's left goes to AI0+

- line out's right goes to AI1+

- line out's ground is split in two and goes to AI0- and AI1-

 

Is this the correct way of wiring?

In case this is alright, I (think I) have problems acquiring the audio signal. In Measurement & Automation Explore, I am creating a task for acquiring voltage from AI0 (44100Hz, etc.) -- nothing is shown on the graph when I run the task! (I have some music running on the computer while measuring) Otherwise, the 9229 is blinking green, seems to be ok, selftest is working, etc.

 

Anyone have an idea what I am doing wrong?

 

Thank you!

 

0 Kudos
Message 1 of 4
(4,246 Views)
Solution
Accepted by topic author acgrama

Hi acgrama,

 

That sounds like it should give you a signal of some sort (i.e. not a blank graph or a flat line at 0 V), but the USB-9229 is not terribly appropriate for audio:

  • The USB-9229's input range is +/-60 V. A line level audio signal is going to use a small fraction of that. Are the USB-9229's accuracy and noise specs adequate for your application? 
  • The USB-9229 doesn't support acquiring at exactly 44.1 kS/s. It supports sample rates of 50 kS/s divided by a number between 1 and 31, such as 50 kS/s, 25 kS/s, 16.7 kS/s, and so on. When you specify a sample clock rate that DAQmx does not support, it coerces to the next higher supported rate, which in this case is 50 kS/s. (You can read back the SampClk.Rate property to see what DAQmx coerced the rate to.) To get 44.1 kHz audio from the USB-9229, you'll have to resample the acquired data (which is programming environment specific).


Assuming you're just trying to do this for learning or experimentation, here are some ideas:

  • Is the line out connector configured as a line out? A lot of motherboards these days have reassignable audio connectors.
  • Is the volume of the source (wave, CD, whatever) high enough?
  • On the graph, is auto-scaling turned on? If you display data as a table instead, are the numbers exactly 0 or just close?
  • Does the line output work if you connect it to another device that is designed to handle line-level signals?
  • If you connect a battery (AA, 9V, whatever) to the USB-9229 instead, do you read the right voltage in MAX?


Brad

Message Edited by Brad K on 02-10-2010 05:56 PM
---
Brad Keryan
NI R&D
Message 2 of 4
(4,229 Views)

Hi Brad,

thank you for your detailed answer!
Unfortunately, this is a project where our institute only implements the app for processing audio; the choice of the USB-9229 is not ours and we have no influence over that. But thank you for the heads-up regarding the sampling rate of 50kS/sec: I had seen that in the spec at some point, but forgot about it afterwards.

In the meantime I realised I could not get samples from a simulated device, either! (with/without auto-scaling). The table is not filled with anything. But maybe simulated devices cannot be used this way?

Anyway, regarding your ideas:
- it could be that my line out connector is not configured properly, I'll have to look into this
- the volume was turned to maximum
- in the graph, I have tried both with and without auto-scaling and various scales, but even the table (like for simulated device above) stays empty

- I will also try to check the last two suggestions

 

However, I think that the line out connector not being configured is the likeliest explanation. Hopefully that will solve it!

 

--Cristina.

0 Kudos
Message 3 of 4
(4,214 Views)

Thank you, seems like it was indeed the reassignable line out problem! I have connected my iPod to the 9229 and I can see in the Test Panels for the device higher amplitudes when music is running and lower amplitudes (roughly 1-1.5 orders of magnitude) when music is not running. Also, the samples' amplitude reacts to volume changes on the iPod.

 

It's still not showing me anything in the "Tasks" section where the table was empty before -- but perhaps I have some limitation in the software I'm using?(We don't have a licence for LabView Signal Express

However, I work programatically via the NIDAQmx C++ API with the card, so I don't mind if there's nothing shown there as long as the reading of samples via the API is working (or that will be another forum post 🙂 ).

 

Thanks again!

0 Kudos
Message 4 of 4
(4,199 Views)