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.
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.
Implementing an Efficient, Moving Average Filter in LabVIEW FPGA
Track/Summit: Embedded Systems
Session ID#: TS1360
Abstract: Many embedded control and monitoring systems suffer from noisy sensor data, putting the functionality and accuracy of the system at risk. Noisy sensor data can be smoothed using moving average filters, but implementing such filters on a CompactRIO system with FPGA and resource constraints can be challenging. Explore the challenges and steps for achieving an efficient FPGA-based moving average filter algorithm. Examine the LabVIEW FPGA code in detail and discuss techniques to aid in resource conservation.
Speaker(s): Neville Dholoo, Advanced Measurements Inc.
Hi Everyone,
thanks for turning up for a presentation late on the last day of NI-WEEK. I will be happy to answer any questions if any, on this list. The above is a slightly older version of the presentation. For the latest version: https://decibel.ni.com/content/docs/DOC-31567
Neville.
Block RAM and LUT are both forms of memory. LUT's have performance benefits, but are implemented via Flip-Flops. Since the resource usage plots show plent of BRAM, but not enough FF's, I decided to go with BRAM.
Another issue to keep in mind is that BRAM can't be simulated on a desktop, but LUT's can when using LV 2011. Although this is no longer true in LV 2013 according to NI folks I spoke to after my presentation.
Thanks Neville.
Do you know anything more about the performance benefits of LUTs over BlockRAM? I mean, can BRAM be used in a single-cycle timed loop and hence be accessed at the clock rate? Can LUTs? Would a performance comparison of the two show that one is marginally faster, or significantly faster, or massively faster?
I've implemented a moving average filter myself in FPGA and also went with BRAM, for the same reason as you describe, but I have to admit I'm not especially versed in FPGA technology and therefore wonder about the performance and resource statistics of these things.
Take a look at the NI LabVIEW for CompactRIO Developers Guide for a lot of helpful tips. The question always is performance vs available resources. LUT's (also called distributed memory) are faster, and recommended only for upto 300 bytes of data. Otherwise they can be very expensive in terms of FF's.
LUT's can be used in SCTL's. Don't know about BRAM. In many cases, memory speed may not be an issue, unless you are really worried about throughput > 40MHz.
BRAM can be used in an SCTL but it takes a full clock cycle to read so it always has to be followed by a feed forward node causing a cycle of latency.
There is a slightly updated version of this presentation (as presented during NI-WEEK) at:
This file does not open:
TS1360 Implementing an Efficient, Moving Average Filter.pdf 3574 KB
error message appears when link to this file is clicked
Neville, is the code for your solution posted somewhere?