Biomedical Engineering Reference
In-Depth Information
From now on the processing is timed by a timer. In the corresponding ISR, either
the value at the ADC input is sampled and stored or the new digital word from the
tapping board is read. A global counter is incremented, to keep track of the number of
samples gathered and hence to extract time measurements from it. Then the actual signal
processing takes place on a sample-by-sample basis, in different ways depending on the
specific exercise, as explained in the following. The current sample is sent to the host
machine through the Bluetooth link, and only every second a vector containing statistics
which characterize the execution is sent too. If the stop condition which identifies the
end of an exercise is not met, the MCU enters the LPM again from which it will be
released by the acquisition of a new sample, otherwise the processing steps back to the
main loop, entering in LPM until the device gets triggered again from the GUI.
For all the exercises but the tapping one, the samples are first low-pass filtered by
an 8-tap moving average filter in order to smooth the signal. For the extension and iso-
metric rotation evaluations the algorithm simply detects the signal peaks corresponding
respectively to a hand extension or a torque application, as showed in Fig. 4. This is
done by comparing each sample with a threshold, which is set to a specific value by in-
verting each sensor calibration curve. In particular the minimum acceptable values are 1
cm for the extension exercise and 0.8 Kg for the isometric rotation one. The mean value
of the first acquired samples are used as the zero value of the subsequent measures. The
peak event is validated only if at least 75 consecutive samples are above the thresh-
old and only as soon as the samples go under the threshold again. The peak maximum
value, its duration and position are determined and used to compute their incremental
mean values as:
m N = ( m Nāˆ’ 1 ( N
āˆ’
1) + s )
(1)
N
where m i is the mean value computed over i samples, and s is the value of the new
sample. The device also stores the absolute maximum and minimum values for the peak
amplitude within the sequence. It is worth to underline that the variables which hold the
average values are float numbers, though the MCU is a 16 bit platform and floating
point is not supported in hardware. Nevertheless all these operations are translated by
the compiler in the proper microcode without additional coding effort.
The algorithm is different in the case of the dynamic rotation, since different signal
features must be detected. The typical signal has a terraced wave shape as showed in
Fig. 5, where the edges correspond to the spinning of the potentiometer whereas the
plateaus indicate that the transducer is still. The duration of both edges and plateaus,
and the amplitude of each edge, are computed. To detect both onset and end of an edge,
a simple detection mechanism based on thresholds has been designed, exploiting the
smoothness of the filtered signal. A FIFO buffer of 14 samples is linearly updated at
every new sample. The mean value of the oldest 4 samples is computed and compared
with the most recent sample. If the difference is greater than an empirically determined
threshold, the algorithm detects an edge and marks the onset n samples before the most
recent one. When the difference falls back under the threshold, the edge end is marked
and the processing is repeated, until the potentiometer reaches the limit. By using
absolute values, the processing is the same for both clockwise and counter-clockwise
exercises.
 
Search WWH ::




Custom Search