Jump to content

Moving averaging on FPGA


pravin

Recommended Posts

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

Link to comment

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.

Link to comment

This is what I came up with in my work

 

post-16289-0-58953000-1424983160_thumb.p

 

 

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.

 

 

 

 

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.