Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

low-pass filtering in GPU during continuous acquisition with NIDAQmx

I would like to use the GPU of a NVIDIA Series 7  card to digitally low-pass filter, downsample and visualize
data continuously acquired by three PCI 6034 E (6 diff. AI at 1kHz each) and one PCI 6220 M (8 diff AI at 5kHz). My
idea about how it would work is the following:
 
1) First, the DAQ use DMA to transfer acquired data in a buffer in the main memory.
    (buffer size is defined in DAQmxCfgSampClkTiming)
2) DAQmxReadAnalogF64 is used to read this buffer and copy available data in
    user-defined array (specified by readArray argument)
3) The array is converted from double precision (64 bits) to single precison (32 bits: a sign bit, 23
    mantissa bits, and 8 exponent bits: identical to the IEEE-754 standard) needed to
   defined a texture
4) texture is read and processed by the GPU (i.e., low-pass filter, downsample to 200 Hz and
   visualize each  channel)
5) result is written into main memory as a texture by the GPU (vertex-to-texture)
 
My current understanding is that
- step 1 does not require CPU because DAQs are able to transfer directly data to the memory (bus mastering)
- step 4 and 5 do not involve the CPU since, apparently, GPU is able to do it.
 
My questions are
- how to optimize steps 2 and 3? Is there a way to read data from the DAQ in a single precision real format that
  would correspond to the texture format (on a NVIDIA Series 7 card)? Is there a way of avoiding the call to
   DAQmxReadAnalogF64 or alike function altogether?
- is it really true that step 1 does not involve the CPU? Is there some limit or significant performance slowdown with
  the DMA due to the fact that there are four DAQ on the system?
 
Thank you,
 
Gabriel
 
0 Kudos
Message 1 of 2
(4,088 Views)

Hi Gavril,

The fastest way to collect data from DAQmx devices is through DAQmxReadRaw function.
You can find the function description under Start>>Programs>>National Instruments>>NI-DAQ>>NI-DAQmx C Reference Help.

This function does not perform typecasting leaving you the burden, you have to know very well how the xxBit of your ADC map your signal.   
Unfortunately there aren't  DAQmx functions that directly output single precision floating.  

The link below briefly describe how DMA transfer take place maybe can help you figuring out the workload of your processor.
http://www.eventhelix.com/RealtimeMantra/FaultHandling/dma_interrupt_handling.htm

I'm pointing this 2 link out since you need to perform DMA transfer and DMA channel are limited on E series devices.

How Many DMA Channels Does My E Series Data Acquisition (DAQ) Device Have?
How Many DMA Channels Does My M Series Data Acquisition (DAQ) Device Have?

Hope this may help you.   

Bye

 

FiloP
It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
Richard P. Feynman
0 Kudos
Message 2 of 2
(4,069 Views)