Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.
/**
* Zero-Latency Exponential Moving Average.
*/
float zlema(float* vals, int numVals, int currentSample)
{
static float factor = 0;
static int lag = 0;
static float lastema = 0;
float ema;
if(currentSample <= 1)
{
ema = vals[0];
factor = 2.0 / (((float) numVals) + 1.0);
lag = (numVals - 1) / 2;
}
else
{
ema = (factor * ((2.0 * vals[0]) - vals[lag])) +
((1.0 - factor) * lastema);
lastema = ema;
}
return ema;
}
...
static long cs0 = 0;
for(int cnt = NUM_AVERAGE_VALS - 1; cnt > 0; cnt--)
{
m_arrAct0AverageVals[cnt] = m_arrAct0AverageVals[cnt-1];
}
m_arrAct0AverageVals[0] = lPos;
float lPosNew = zlema(m_arrAct0AverageVals, NUM_AVERAGE_VALS, cs0);
cs0++;
...
Would be extremely grateful if someone with a better understanding of the math could please sanity check this for me to see if I've got anything slightly wrong?float y[NUM_VALS -1];
float dy;
float A;
y[0] = 0;
for (int cnt = 1; cnt < NUM_VALS; cnt++){
dy = (u[cnt] - y[cnt-1])/A;
y[cnt] = y[cnt-1] + dy;
}
function NextOutput(float input,float A){
static float dy = 0;
static float y = 0;
dy = (input - y)/A;
y = y + dy;
return y;
}
Copy-of-Low-Pass-Filter.xls
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
xamarin c# deserialize Json containing nested object | 2 | 91 | |
Triangle - computing angles | 3 | 50 | |
using a 220V in USA vs 110 in Asia- which is more reliable. | 14 | 45 | |
Autosar OS Multicore Share Resources confusion ? | 2 | 37 |
Join the community of 500,000 technology professionals and ask your questions.