pravin Posted February 26, 2015 Report Share Posted February 26, 2015 Hi All, I would like to do some moving averaging on my FPGA based on building the sum of the values to around 200/N data points and then removing the oldest value and adding the newest value that way I'm only needing to acquiring one new point once the data point have reached the 200 limit but I have 16 channels and FPGA does not support 2-D arrays and I can do it with 16 1-d arrays but I don't think there will be enough resources on the FPGA. Anyone have any ideas how i can do this. I guess the main challenge is having a way to continuously store the last 200 or N points so that I can subtract the oldest value other than a two d array or multiple 1-d arrays. I am trying to do it this way as well so that I don't need to wait each time and acquire 200 or N samples and then averages them each time for a new averaged value. Kindly let me know if any suggestion. Thanks in advance. Pravin Quote Link to comment
Tim_S Posted February 26, 2015 Report Share Posted February 26, 2015 Looks like there is a discussion on this over at the NI forums. Quote Link to comment
smithd Posted February 26, 2015 Report Share Posted February 26, 2015 Hi All, I would like to do some moving averaging on my FPGA based on building the sum of the values to around 200/N data points and then removing the oldest value and adding the newest value that way I'm only needing to acquiring one new point once the data point have reached the 200 limit but I have 16 channels and FPGA does not support 2-D arrays and I can do it with 16 1-d arrays but I don't think there will be enough resources on the FPGA. Anyone have any ideas how i can do this. I guess the main challenge is having a way to continuously store the last 200 or N points so that I can subtract the oldest value other than a two d array or multiple 1-d arrays. I am trying to do it this way as well so that I don't need to wait each time and acquire 200 or N samples and then averages them each time for a new averaged value. Kindly let me know if any suggestion. Thanks in advance. Pravin For a fixed number you could use a feedback node with delay=200. For an unknown number you can use any number of memory blocks, either an array, an actual block of memory, or a FIFO. These all have advantages and disadvantages depending on how much space you have and if you need to have access to the data except to do an average. However the basic concept is exactly the same as what is shown in that other thread. Quote Link to comment
ShaunR Posted February 26, 2015 Report Share Posted February 26, 2015 (edited) Use this IP? Edited February 26, 2015 by ShaunR Quote Link to comment
MarkCG Posted February 26, 2015 Report Share Posted February 26, 2015 This is what I came up with in my work It is somewhat surprising that there is not an FPGA moving average express VI already provided by NI- there are IIR filters. I might even try to figure out scripting so I can create a moving average VI with a given fixed point configuration, window size, and choice of memory implementation. Quote Link to comment
Gary Rubin Posted February 26, 2015 Report Share Posted February 26, 2015 I don't know how applicable it is to FPGA, but using FIR filter was discussed here Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.