LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Real time data storage and computation

I am working on a project which requires real time Fourier transform calculation of acquired data. I need to display the values after calculating the Fourier transform for a window of 20 samples each.  I'm creating an array of fixed size (20) and inserting elements into it and shifting it one by one like a moving window. But this is ineffective as it consumes a lot of time. How I can store 20 samples at a time in the array and after computation the next 20, I don't need to use a moving window. Can someone please suggest better/more effective methods.

0 Kudos
Message 1 of 3
(1,747 Views)

What are your timing constraints? ("Real time" is poorly defined without specifications). What is the data rate?

 

What you are describing is already implemented in "fft ptbypt".

 

Is this running on windows or an RT system? Do you have an FPGA?

Message 2 of 3
(1,726 Views)

Do you know about the Producer-Consumer Design Pattern (which sounds exactly like what you are describing)?  This Pattern involves two loops, running simultaneously:  the Producer "acquires" data (say, 20 samples from a DAQ Device) and immediately sends them (typically via a Queue) to the simultaneously-running Consumer that does whatever processing is required.  Since most DAQ processes involve hardware that "waits" until a fixed amount of data (say, 20 sample) have been acquired before consuming any processing power, this Design means that maybe 99% of the CPU cycles can be devoted to whatever the Consumer needs to do, with the Data Acquisition appearing to require almost no CPU cycles (largely because it requires almost no CPU cycles, as it happens).

 

You can find examples of LabVIEW's Producer-Consumer Design, and can also find discussions of it on the web.  It should easily enable you to do what you outline.

 

Bob Schor

Message 3 of 3
(1,711 Views)