4 DISCUSSION
The HS processing method is highly nonlinear and
hence sensitive to the amplitude of the signals. Good
results are obtained with the parameters we used for
signal amplitudes in the ranges seen in the figures. We
multiplied all signals in the cited database by a factor
of 10 before processing.
The HS filters are causal and the processing results
have a lag with respect to the signal. To determine the
lag, we shifted the result and compared the sum of
squared errors obtained for various shifts. The lowest
error was obtained, in case of the signal Apnea-ECG
A01 (length 10 seconds, data format: standard) for a
lag of 3 time steps. The total squared error was com-
puted for the various filters for 750 samples, for the
samples from 200 to 950. We skipped the first 200
samples to avoid the transitory regime of the swarm
filter. The mean square error, MSE, was determined
as MSE
2
= (
∑
t=200..950
(s
c
[t] − s
0
[t])
2
)/750. The re-
sults related to the determination of the lag are shown
in Table 1 in the Annex.
While the algorithm is O(n) in the number of input
signal samples, the calculations at each step involve
looping over the swarm, moreover involve many mul-
tiplications. As a result, the processing is time con-
suming. A swarm of 55 agents, with η
1
= 4 and
eta
2
= 4, implemented in a C++ unoptimized program
that also writes more that 10 files on the disk, takes
about 3 seconds to process 2500 samples of input sig-
nal. This means that the process can be performed in
real time for ECG signals at a sampling frequency of
about 800 Hz.
The HS filter produces smoother output than the
average and median filters of order 11 (see Appendix).
The results are not exactly the same when the code
is run several times. The method is not perfectly de-
terministic, as the swarm starts with random condi-
tions, moreover several configurations of the swarm
may have the same or similar internal energy, thus al-
lowing the swarm to follow close but not identical tra-
jectories when following the same prey.
The system is not guaranteed stable. For example,
swarms with 25 agents or with 85 agents, the other
parameters being the same as above, are unstable. As
far as the swarm remains stable, the number of agents
in the swarm was found to have less influence on the
filtering error than parameters like µ and constants in
adaptation.
While we used the analogy with the hunting pro-
cess, the presented algorithm might be regarded as a
social process of agreement of a group with a model,
represented by the signal. While the analogy is simi-
lar with the one of swarms with leaders, it is still diff-
erent, because the leaders are assumed to be influ-
enced by the rest of the group, while the model acts
independently from the behavior of the ‘followers’
group.
5 CONCLUSIONS
The HSA is essentially a new nonlinear filtering algo-
rithm derived as a combination of several approaches
in the literature and with a method of mapping the
signal filtering process into a swarm dynamics. The
HSA filtering was demonstrated on a set of bench-
mark ECG signals with intrinsic and added noises.
The results were compared with those obtained with
the average and median filters.
The hunting swarm method may work remarkably
well when the parameters of the swarm are trimmed
according to the processed signal and noise peculiari-
ties. However, the trimming procedure is not enough
transparent at this stage of development and the use
of genetic algorithms or other evolutionary method to
improve the behavior of the swarm is desirable. The
main advantage is that the HS filters leave the signals
that have fast as well as slowly varying regions only
slightly altered, while removing a consistent part of
the noise. In this respect, we found that the HS filters
behave better than the basic average and median filters
and combinations of them. We conclude that the HSA
might be a strong candidate in filtering signals with
non-stationary, wide bandwidth noise, where simpler
filters can not cope. Further research is needed to ex-
tensively compare the swarm-based filters with other
types of nonlinear filters.
ACKNOWLEDGEMENTS
I thank Dr. David Malan and Professor Leslie Valiant
for essential advice and critics. Also, I thank the two
anonymous referees for very useful comments.
REFERENCES
Almenar, V. and Albiol, A. (1999). A new adaptive scheme
for e.c.g. enhancement. Signal Processing, 75(3):253
– 263.
Bansal, D., Khan, M., and Salhan, A. K. (2009). A com-
puter based wireless system for online acquisition,
monitoring and digital processing of ecg waveforms.
Computers in Biology and Medicine, 39(4):361 – 367.
Goldberger, A. L., Amaral, L. A. N., Glass, L., Hausdorff,
J. M., Ivanov, P. C., Mark, R. G., Mietus, J. E., Moody,
BIOSIGNALS 2011 - International Conference on Bio-inspired Systems and Signal Processing
418