Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

fpga Standard Deviation calculation - any examples?

Hello,

 

Im looking for a way to implement 'Moving Standard Deviation' into the FPGA module.

 

Are there any examples out there?

 

 

I'm using cRIO-9012 chassis.

 

Thanks,

Yuval

0 Kudos
Message 1 of 20
(6,556 Views)
how many data points are you considering?  since the algorithm requires a pass through all the data for each new data point, it will be cycle consuming.  how fast does it need to run?
Stu
0 Kudos
Message 2 of 20
(6,542 Views)

I don't know much about the algorithm, but from what I've seen it seems like just a few simple calculations.  It doesn't seem like it would be too tough to implement using the numeric palette calculations. 

 

http://www.transitionstrading.com/mstd.htm

 

0 Kudos
Message 3 of 20
(6,528 Views)

stu@viewpointusa.com wrote:
how many data points are you considering?  since the algorithm requires a pass through all the data for each new data point, it will be cycle consuming.  how fast does it need to run?
Sorry, the algorithm does NOT require a pass through the system.  is the same calculation as computing the AC RMS value of X which can be computed point by point on a fairly arbitrary set of data.  You do have to keep the set of data around though.  There is a built in calculation of standard deviation pt by pt that will show you an implementation but it is not coded for FPGA.
Stu
0 Kudos
Message 4 of 20
(6,519 Views)

I've calculated variance and standard deviation in FPGA using FXP math toolkit.  Attached are the VIs.

 

StdDev.png

Download All
Message 5 of 20
(6,509 Views)

Thanks very much to all of you.

 

I will look at it today and come back with the results.

 

Yuval

0 Kudos
Message 6 of 20
(6,501 Views)

dwisti wrote:

I've calculated variance and standard deviation in FPGA using FXP math toolkit.  Attached are the VIs.

 

StdDev.png


Whenever i code an FPGA algorithm, i create a test case with known inputs.  I am not sure if you did for this

code or not but i put together a test case that does not produce expected results.  I am not sure if i implemented the 

your code correctly but you can check it out.

 

Stu
0 Kudos
Message 7 of 20
(6,484 Views)

Many thanks Stu. I'll be back with results.

 

Yuval

0 Kudos
Message 8 of 20
(6,481 Views)
I did have a test project. Here it is.
0 Kudos
Message 9 of 20
(6,469 Views)
Your test vi was wired wrong.  I fixed it.
0 Kudos
Message 10 of 20
(6,468 Views)