and therefore it has the same number of Wavelet co-
efficients in every decomposition level, and because it
is well defined for non-dyadic sequences.
The j th level of the MODWPT decomposes the
frequency interval [0, f
s
/2], where f
s
is the sam-
pling frequency of the original signal f, into 2
j
equal
width intervals. Each frequency interval will have N
Wavelet coefficients associated, N being the length of
the sampled signal f. The N-dimensional vector W
j,n
will denote the N Wavelet coefficients associated with
nth node (beginning at zero) in the jth level of the de-
composition tree (see Figure 1). The nth node in the
jth level of the decomposition tree, the ( j,n) node, is
associated with the frequency interval:
f
s
2
j+1
[n,n+ 1] (6)
The MODWPT coefficients fulfill that:
kfk
2
=
2
j
−1
∑
n=0
kW
j,n
k
2
∀j (7)
Therefore, given a frequency band [ f
1
, f
2
] =
f
s
2
J+1
[k,k
′
], being f
s
the sampling frequency and k, k
′
and J integers, we can calculate the spectral power in
[ f
1
, f
2
], P([ f
1
, f
2
]), from the appropriate MODWPT
coefficients. We just need to find the nodes (J,k)
and (J,k
′
); then we compute the spectral power in the
band [ f
1
, f
2
] as:
P([ f
1
, f
2
]) =
k
′
∑
n=k
kW
J,n
k
2
(8)
2.2 Finding a Proper Cover
Equation 8 can only be applied to bands that can be
written as
f
s
2
J+1
[k,k
′
], being f
s
the sampling frequency
and k, k
′
and J integers. In the general case, when
performing a HRV spectral analysis the user may be
interested in bands that cannot be written this way.
This forces us to permit a certain error when we try
to cover the bands specified by the user with coef-
ficients obtained from the MODWPT decomposition
(see Figure 2).
Let [ f
l
, f
u
] be the band in which we want to cal-
culate the spectral power, and let ε
l
, ε
u
be the maxi-
mum errors allowed for the beginning and the ending
of the band, respectively (RHRV allows the user to
specify errors in absolute terms or relatively in % of
the band’s boundary value, but here we will work with
absolute errors for the sake of simplicity). We need to
find a node ( j, n) whose lower frequency corresponds
roughly to f
l
with the tolerance allowed by ε
l
; that is:
f
l
∈
f
s
2
j+1
[n,n+ 1], (9)
f
l
−
f
s
2
j+1
n ≤ ε
l
. (10)
Equation 9 allows us to perform a quick search of
the adequate boundary node in the MODWPT de-
composition tree, while Equation 10 defines a cri-
terion of acceptability between the frequency values
delimited by a node and the frequencies specified by
the user. Analogously, we also need to find a node
( j
′
,n
′
) whose upper frequency corresponds roughly
to f
u
with the tolerance allowed by ε
u
:
f
u
∈
f
s
2
j
′
+1
n
′
,n
′
+ 1
, (11)
f
s
2
j
′
+1
(n
′
+ 1) − f
u
≤ ε
u
. (12)
The level j of the decomposition tree in which the
node ( j,n) that fulfills Equations 9 and 10 is found
needs not be the same as the level j
′
in which the
node ( j
′
,n
′
) that fulfills Equations 11 and 12 is found.
However, Equation 8 requires that j = j
′
. To avoid
this problem, after the nodes ( j,n) and ( j
′
,n
′
) have
been found, the node that is at the higher level is fur-
ther decomposed to the level of the other node (see
Figure 1). For example, let us suppose we have found
the nodes ( j, n) and ( j
′
,n
′
), j < j
′
, which correspond
to the lower and upper limits of the frequency band,
respectively. The lower frequency node ( j,n) will be
further decomposed j
′
− j = m additional levels, ob-
taining as the new node corresponding to the lower
limit of the band the node given by:
( j + m,n·2
m
), (13)
This situation is exemplified by the dotted nodes show
in Figure 1. If the nodes ( j, n) and ( j
′
,n
′
), are such
that j > j
′
, the higher frequency node ( j
′
,n
′
) will be
futher decomposed j − j
′
= m additional levels, ob-
taining a new node that corresponds to the upper limit
of the band. This node is given by:
( j + m,(n+ 1) ·2
m
−1), (14)
This situation is exemplified by the dashed nodes
shown in Figure 1.
Figure 2 illustrates the complete search process
for the band [0.26,0.99] Hz with f
s
= 2 Hz and ε
u
=
ε
l
= 0.01. We begin searching for the node whose
lower limit corresponds to the frequency f
l
= 0.26
Hz. The node (1,0) fulfills Equation 9, but not Equa-
tion 10. The node (1, 1) neither fulfills Equation 9
nor Equation 10. Therefore, we continue the search
decomposing the node (1,0) into the nodes (2,0) and
(2,1). The node (2, 0) does not verify Equation 9, but
(2,1) verifies both Equation 9 and 10; i.e., (2,1) is the
node whose lower limit corresponds to f
l
= 0.26 Hz,
with the tolerance indicated by ε
l
. In Figure 2 the
BIOSIGNALS 2012 - International Conference on Bio-inspired Systems and Signal Processing
208