Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Queueing operations

Hi there I am currently coding with Labview FPGA and am streaming data through three DMA FIFO's. What is occuring is that I am streaming 10000 points (from a speaker and a microphone) then performing cross correllation. As I'm aquiring data at 100kHZ the data aquisition takes approximately 100ms. Performing the cross correlation then takes about another 100ms. the problem I am having is that I wish to decouple these 2 bits of code so that the FIFO will continue to stream data while the cross correlation is being performed. My code is attached. Any advice would be much appreciated!
0 Kudos
Message 1 of 3
(2,215 Views)

Hi tlin067,

 

The simplest change you can make to your code to decouple or "de-serialize" the two bits of code is use shift registers to pipeline your application into two stages as shown in the attached image.  You can easliy pipeline the DMA FIFO acquisition portion of the application as stage 1, and place the cross-correlation portion into stage two.  Pipelining essentially places the two (or more) previously serial operations in parallel so they no longer run as two sequential operations within a single loop cycle. 

 

There are many articles on ni.com and other sources on techniques for pipelining.  I like this introduction.

 

If you are feeling zealous, the best LabVIEW architecture for this type of streaming & signal processing application is the Producer/Consumer template.  This can be found by creating new VI via the File>>New... menu (not File>> New VI). In the resulting dialog box, expand VI>>From Template>>Frameworks>>Design Patterns>>Producer/Consumer Design Pattern(Data).

 

The Producer/Consumer is a very flexible design pattern used in many LabVIEW applications, in various forms.   The producer/consumer adds flexibility to your application because it separates your acquistion  and analysis tasks.  This frees you up in some ways, for example, you could acquire data at a different chunk size and loop rate than your analysis loop.  The producer/consumer handles the buffering between the tasks, so the consumer analysis loop will automatically process a given chunk size of data when the producer has provided enough. For more information on the producer/consumer design pattern and other common LabVIEW design patterns, search the developer zone on ni.com. 

 

Cheers,

Message Edited by Spex on 02-11-2009 12:55 AM
Message Edited by Spex on 02-11-2009 12:56 AM
Spex
National Instruments

To the pessimist, the glass is half empty; to the optimist, the glass is half full; to the engineer, the glass is twice as big as it needs to be has a 2x safety factor...
0 Kudos
Message 2 of 3
(2,209 Views)

That is a great suggestion, please let us know if you have any questions implementing a pipeline.

 

Have a good weekend all 🙂

 

Anna K.

National Instruments
0 Kudos
Message 3 of 3
(2,167 Views)