|
Algorithm 1 An example of ASA algorithm. |
Store an initial number of sensor samples (W);
Estimate the fMax on the acquired W samples;
Based on fMax set the sampling frequency to a value fSampling = c fMax where c is a confidence parameter that has to be ≥ 2 to avoid aliasing;
Define upper and lower frequency borders to detect the change in the maximum frequency fUp and fDown as: fUp = min {(1 + δ)fMax, fSampling/2}; fDown = (1 − δ) fMax;
h1 = 0; h2 = 0; i = W + 1;
while(1){
Acquire a sample and add to the dataset;
Estimation of the current maximum frequency fCurr on the sequence (i − W + 1, i);
Count the consecutive number of events when the frequency was higher or lower than previously
If (|fCurr − fUp|< |fCurr − fMax|)
h1++; h2 = 0;
else if (|fCurr − fDown|< |fCurr − fMax|)
h2++; h1 =
0;
if ((h1 > h) || (h2 > h)){
fSampling = c fCurr; fMax = fCurr;
fUp = min{(1 + δ)fMax, fSampling/2}; fDown = (1 − δ) fMax}}
|