version and bluetooth transmission to the computer.
Signals were sampled at a 1000 Hz frequency and
converted using a 12 bit ADC (PLUX, 2012).
The ECG signals were obtained in different con-
texts. A 7 hour signal was acquired during a night of
sleep of a person diagnosed with amyotrophic lateral
sclerosis under the project wiCardioResp. One ECG
was also acquired under the project ICT4Depression
where patients with depression are monitored at
home. An ACC signal where the subject was walking
at average speed was also acquired under this project.
For research and evaluation purposes, one respiratory
signal was acquired. Besides, one BVP signal was
acquired right after a subject performed some exer-
cise and then, at rest. Finally, two scenarios (Act1:
Walk, Run, Walk, Jump; Act2: Crouching, leg flex-
ion, leg elevation) were created enabling the acquisi-
tion of ACC signals with different modes. Both activ-
ities were performed by a single subject. From Activ-
ity 2, an EMG signal was also acquired.
2.2 Algorithm Implementation
2.2.1 Events Detection
As it was stated in the previous section, the first step
in our algorithm is to detect events in cyclic biosig-
nals. We propose two different methods for events
detections which will be described next.
Peaks Detection Approach. In our approach, we
define the threshold as being the RMS of the signal.
In order to obtain a higher accuracyin detecting signal
events, our algorithm updates the threshold every ten
seconds. Due to its simplicity and low computational
cost, using the signal RMS as an adaptive threshold
for peaks detections is an interesting method for ac-
complishing the first step of our algorithm.
Meanwave Approach. In this approach, the basic
concept was previouslyimplemented by (Nunes et al.,
2011). The main goal of the autoMeanWave algo-
rithm is to separate the cycles from a periodic biosig-
nal. For that, the cycles (or waves) size – winsize – is
estimated by computing the fundamental frequency,
f
0
, of the signal. Then, the events are detected and the
meanwave is computed. The signal events are aligned
using a notable point from the meanwave.
The main concept of this algorithm was kept but
some improvements were made. In fact, a time-
domain method for f
0
estimation based on the auto-
correlation of finite time series was used. The events
alignment step was also improved by adding a second
phase of alignment which is wave-specific. In fact,
after performing the alignment by choosing a notable
from the meanwave, our algorithm runs through all
the signal waves and relocates the events to the same
notable point from each wave. Finally, the ability to
process long-term biosignals was achieved by divid-
ing the signal into parts and detecting the events in
each part individually. To guarantee that no informa-
tion was lost among transition zones, a f
0
-dependent
overlap was introduced.
2.2.2 Distance Functions and Distance Measures
In order to obtain inputs to the parallel k-means algo-
rithm, a set of different distance functions was used.
First of all, the Minkowski-form Distance defined as
(Chan et al., 2000)
L
p
(P,Q) =
∑
i
|P
i
− Q
i
|
p
!
1/p
, 1 ≤ p ≤ ∞ (1)
In this study, the L
1
, L
2
and L
∞
distance functions
were used and the squared version of L
2
, L
2
2
, also. Be-
sides, the χ
2
histogram distance was also tested.
In order to obtain distance measures that will be
used as inputs for a clustering algorithm, the com-
puting of a distance matrix it is usually necessary.
This distance matrix is obtained by computing the dis-
tance between each observation and all the other ones.
However, the order relationship between two consec-
utive samples, which is a property of time series, al-
lows morphological comparisons between waves (or
cycles of a signal), w
i
, by simply computing a dis-
tance array where each element, d
i
, is given by:
d
i
= f(w
i
,w
i+1
), i = 1,... , n − 1 (2)
being f the distance function and n the number of
waves. w
i
can also represent the meanwave but, in
this case, i = 1,...,n.
Although the distance matrix carries richer infor-
mation about waves resemblance than the distance ar-
ray, its high computational cost makes it impossible
to be used in long records.
2.2.3 Clustering Algorithm
In our algorithm, the observations to be clustered
are divided into N parts. Then, the k-means algo-
rithm is applied in each part and a set of centroids
[a
i
,b
i
,...,k
i
] are computed, with i = 1, . . . , N being
number of each part and k the number of partitions
given as input for the k-means algorithm. Since the
k-means algorithm randomly assigns clusters to the
computed k partitions, different clusters assignment
is obtained. By assembling all the N sets of cen-
troids, a new set of observations is computed. By run-
ning one last time the k-means algorithm, the global
BIOSIGNALS2013-InternationalConferenceonBio-inspiredSystemsandSignalProcessing
324