Skip to main content
. 2016 Mar 28;16(4):448. doi: 10.3390/s16040448
Algorithm 1 An example of ASA algorithm.
  1. Store an initial number of sensor samples (W);

  2. Estimate the fMax on the acquired W samples;

  3. 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;

  4. 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;

  5. h1 = 0; h2 = 0; i = W + 1;

  6. while(1){

  7. Acquire a sample and add to the dataset;

  8. Estimation of the current maximum frequency fCurr on the sequence (i − W + 1, i);

  9. Count the consecutive number of events when the frequency was higher or lower than previously

  10. If (|fCurr − fUp|< |fCurr − fMax|)

  11. h1++; h2 = 0;

  12. else if (|fCurr − fDown|< |fCurr − fMax|)

  13. h2++; h1 = 0;

  14. if ((h1 > h) || (h2 > h)){

  15. fSampling = c fCurr; fMax = fCurr;

  16. fUp = min{(1 + δ)fMax, fSampling/2}; fDown = (1 − δ) fMax}}