Dynamic Signal Acquisition

cancel
Showing results for 
Search instead for 
Did you mean: 

Round-up of acquisition speed of USB-9233 4-port 24-bit device

Using a MAX test panel, I set a USB-9233 device to have a sampling rate of 44100 Samples/s (a standard sampling rate for audio files), and then look at the test panel graph with a sine wave signal.
 
Unfortuanately, MAX does not seem to be sampling at the rate that it says it is.  It is actually sampling at 50000 Samples/s, despite the setting for 44100 Sample/s.  I determined this by counting the number of displayed cycles.
 
Using DAQmx also exhibits the same "rounding up" behavior with the sampling rate.
 
We need to use a sampling rate of 44100 Samples/s.  How can we acheive this using this device?
 
Thanks,
Chris
0 Kudos
Message 1 of 26
(10,326 Views)
The  expression for the rates is  Fs = 100 kHz/N, where N is an integer  rangeing from 2 to 50.  You can't get 44,100 Hz with the 9233.

For a lengthier discussion, see:

http://forums.ni.com/ni/board/message?board.id=250&message.id=18723&query.id=97177#M18723


0 Kudos
Message 2 of 26
(10,314 Views)

First of all, make sure that you really need to sample at 44.1 kS/s.  At 50 kS/s, all of the signal information that you would have gotten at 44.1k is still there, and any of the analysis VIs that you would want to apply to the data (spectral analysis, finding a single tone, THD, etc.) all still apply regardless of the input sample rate.

If you really need to have the data at 44.1 kS/s (for example, to output to a standard audio file) try using the "Resample Waveforms" VI in LabVIEW under the "Signal Processing >> Waveform Conditioning" pallette. On this VI you need to choose the interpolation mode; you should choose either "Spline" or "FIR".  Don't use "Linear".

If your primary signal amplitudes are below 2 kHz, the Spline method will not degrade your signal and will be faster (expect over 500,000 pts resampled per second on a 2GHz Pentium 4).  Above 2 kHz, you may start seeing intermodulation distortion between the input signal (Fin) and harmonics of 5.9 kHz (50k-44.1k); in otherwords, you'll get tones at Nx5.9kHz + Fin and at |Nx5.9kHz - Fin|.  The worst of these tones will be about 110 dB below the input signal (or 0.0003% of the input signal's amplitude) with Fin = 2kHz, and 60 dB down (0.1%) at Fin = 8kHz. Above 8 kHz you'll also start to see some attenuation of the input signal.

If you have higher than 2 kHz signals with enough amplitude that these IMD distortion levels could be a concern, you should pick the FIR option for interpolation.  Leaving the FIR parameters at their defaults (which are fine for the 9233) you should be in great shape up to 20 kHz signals- the drawback is that it takes more CPU time; expect in the neighborhood of 6 to 8 times slower than the Spline option.

0 Kudos
Message 3 of 26
(10,302 Views)
Good advice, Garritt.  I use CVI based spline interpolation in my vibration measurement software which uses integral powers of two from 64 Hz to 65536 kHz.  For my purposes, the useful bandwidth of the 9233 is greater than 24 kHz and I only really need 22.5 kHz!  For frequencies lower than 2 kHz or when I need more than one sampling rate, I use successive FIR filtering and decimation.  Life was simpler when I was only programming for the 447x series.  ;-))
0 Kudos
Message 4 of 26
(10,293 Views)

Hi

I am having the same problem using a 9233. The sampling as discussed is an integer division of 50kS/s. I wish to write the input channels to Microsoft ".wav" files using the standard SV Toolkit vi however it writes asumming the waveform is 44.1kS/s !

I have used the resampling vi and this does not help since regardless of which "dt" value is used in the resampling the timescale is "respected" and the resulting waveform is still wrong.

I have a 1000 Hz microphone calibrator playing into a high quality microphone connected to the 9233 and all the realtime S&V vi's are showing correct amplitude and frequency. The recorded wave file is written with RIFF header information saying 44,100 Hz using various RIFF reading software and therefore it always plays back on all players at 88.2 % of the speed or frequency!

Has anybody managed to solve this problem yet?

Can NI please correct the S&V Toolkit vi's since they are intended to be used with the DAQmx?

I have posted on the DAQ hardware forum last week but there has been no response, there may be more traffic here and I have to issue this as a working tool.

Many thanks for any help that you can offer. 

0 Kudos
Message 5 of 26
(10,086 Views)
I do a lot of work with creating and reading wav files, and I include a block of header information that doesn't affect it's ability to be played on standard audio software.  Just email me if you want further info/code.
Message 6 of 26
(10,072 Views)

Thank you Chris,

 

Does your application correct the RIFF file header to play back at the correct  higher rate?

I have not been able to find your e-mail in your profile information.

mine is:    alistair_plowman(remove this anti-spam text)@mactag(...and remove this).com

0 Kudos
Message 7 of 26
(10,045 Views)
Any data rate, any number of channels.  I'll send you an email.
Message 8 of 26
(10,028 Views)

Thanks,

It seems that the Wave Recorder is not capable of having the error corrected using the resampling technique as shown below:

There is no diference in the Probe between the before and after signal conditioning with 2e-5 and 2.27e-5 step size.

I think that Chris is writting the sample data to hard disk and then recompiling a correct wave file form the resampled information.

 

 

0 Kudos
Message 9 of 26
(10,018 Views)
The waveforms are not supposed to "look" any different.  They should show the same number of cycles of the wave form in the same amount of time.  What should be different is the number of samples in that amount of time.  In your example, you have a 1 kHz signal being sampled for 1 millisecond at 50 kS/s.  The output of the resample VI should still show a 1 kHz signal sampled for 1 millisecond.  The difference is that the input wave form should have 50 samples in that millisecond, and the output waveform should have 44 samples.  If you count the number of samples on that first set of probe waveforms, you should see the difference.  You can also select the "Table" tab on the probe windows to see the data as well.
 
 
 

Message Edited by Garritt on 10-31-2006 01:37 PM

Download All
0 Kudos
Message 10 of 26
(10,013 Views)