Past NIWeek Sessions

cancel
Showing results for 
Search instead for 
Did you mean: 

[NIWeek 2013] Implementing an Efficient, Moving Average Filter in LabVIEW FPGA

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.

Comments
Neville_D
Member
Member
on

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.

Thoric
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

Hi Neville,

On slide 31 (Design Decisions-Memory slide), you ponder "Block RAM or Look Up Table?". Can you expand on this a little please, and state the decision you came up with and why? Thanks!

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Neville_D
Member
Member
on

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.

Thoric
Trusted Enthusiast Trusted Enthusiast
Trusted Enthusiast
on

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.

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Neville_D
Member
Member
on

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.

James_McN
Active Participant Active Participant
Active Participant
on

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.

James Mc
========
CLA and cRIO Fanatic
My writings on LabVIEW Development are at devs.wiresmithtech.com
Neville_D
Member
Member
on

There is a slightly updated version of this presentation (as presented during NI-WEEK) at:

https://decibel.ni.com/content/docs/DOC-31567

m.yasir
Member
Member
on

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

D*
Member
Member
on

Neville, is the code for your solution posted somewhere?

Contributors