From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Read one data point each time via sound card

Solved!
Go to solution

 

Hi there!

 

I am trying to read the output of a lock-in amplifier that can not be interfaced to my PC. So i decided to read througn my microphone input.

For this, I connect  channel 1 or 2 to my mic input.

 

However each time i do a read i cannot just grab one point but only several points at a time.

 

10 is the min number of points i can get when i set  sample rate 100 and duration 0.1 in the Acquire Sound VI.

 

Any combination that results in less than 10 points gives me an error  (e.g 100 sample rate and duration 0.01).

 

I thought that by indexing the dynamic data coming out from Acquire Sound VI  would solve the problem but the reading is differnet from the one i get when reading the lock-in amplifier

through GPIB.

 

(i am testing by using a lock-in amplifier which i can interface through GPIB.  So I simultaneously read with my sound card and the GPIB and compare the graphs)

 

Any way to read one point each time?  Or am i getting something else wrong here?

 

Thanks for your time!

 

 

 

0 Kudos
Message 1 of 11
(3,636 Views)

Why not read the 10, then either average them together, or index out either the first or the last data point?

Message 2 of 11
(3,634 Views)

 

i do index them but the graph is different.

 

I would infer that Output CH1 ot CH2 on the front panel would give me the same reading with reading the respective channel via GPIB.

 

Maybe I should try averaging them?

 

 

0 Kudos
Message 3 of 11
(3,632 Views)

 

I haven't tried averaging yet and i will get back to you when i do that.

 

However i was thinking i introduce noise with the BNC to 3.5mm jack cable and the sound card itself. Moreover the sound card has a different impedance so the reading will be different anyway?

 

Any views and ideas on the points mentioned above as well as on the original question about reading one data point are most welcome.

 

Thanks!

0 Kudos
Message 4 of 11
(3,603 Views)

Are the outputs of the lock-ins DC values or a sinusoidal signal? If sinusoidal, at what frequency? Is the sound card input DC coupled?

 

Assuming that both signals are DC voltages proportional to the amplitude of the unknown signal, it is very likely that the value you obtain through the GPIB is the result of some averaging.

 

Set your sound card so that the duration of each acquisition is the same as the filter time constant or the time between readings on the GPIB lock-in. Sample at a higher rate - such as a typical rate for audio for your card. Then average all the points collected in one acquisition. This may produce results which are more similar between the two instruments.  There are many subtle interactions among settings and signal charactersitics on lock-ins which make direct comparisons of readings tricky.

 

The output of the lock-in should be a high level, low source impedance signal. If you are picking up noise with the cable between the lock-in and the sound card, you have much worse problems than can be solved with sampling rates and averaging.

 

Lynn

Message 5 of 11
(3,558 Views)

Hi John,

 

Very goog point. Thank you for you answer.

 

The output of the lock-in should be DC by definition but i will check anyway. 

 

As far as I can see (attached pic) my sound card is DC coupled?

 

I don't think i am picking up any significant noise with the cable.  I will try your suggestions and get back to you asap.

 

I am testing on the same lock-in. So  i read the output from the front panel with the sound card and the same channel with GPIB and compare.

 

Thank you very much for your help!

0 Kudos
Message 6 of 11
(3,538 Views)
Solution
Accepted by topic author thomas8491

Looks like the min freq responce of the ADC is 10Hz, pg 69 of the spec sheet:

 

http://www.hardwaresecrets.com/datasheets/ALC888_1-0.pdf

 

Though you may want to apply a known value of low DC voltage to the mic input to see if it reads properly. Note that mics output low level signals, looks like the ADC full scale input is ~1-1.5V so make sure your input does not exceed that. You could use resistive voltage dividers if needed to scale down the input voltage.

 

-AK2DM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 7 of 11
(3,509 Views)

 

Well it appears that the sound card cannot read DC.

 

I am attaching the readings at 10 Hz,  3Hz, 1Hz, DC and signal generator switched off.

 

To be more precise i have to say that these measurements were taken with an ALC262 sound card and not with the ALC888.

 

And for the record the min frequency responce of the ADC for ALC262  is 16Hz.

 

ALC888 is on my other computer which is currently running OpenSuse (i.e. no Labview) and is waiting to become a dual boot with Windows as the second OS.

 

I am planning to use the ALC888 for this project. Probably i will go for an all software Lock-in Amp (LIA) with one mic receiving the signal and the other mic receiving the

reference. 

 

Thank you all for the input and the amazing ideas.

 

 

 

 

0 Kudos
Message 8 of 11
(3,498 Views)

 

Last two

0 Kudos
Message 9 of 11
(3,496 Views)

i said that the output of the LIA is DC which it's true when we set the channels to read R and θ i.e. magnitude and phase. 

 

We could also set the LIA to output the in-phase and the 

quadrature components which are AC (cosθ and sinθ) but if we choose this and read only one we lose information.

 

That's for being accurate 🙂

0 Kudos
Message 10 of 11
(3,473 Views)