Download Dokument_1.

Transcript
5. IMPLEMENTATION
the sum at all frequencies can be calculated. The division of this sum by the logarithm
of the number of frequency components in the corresponding band gives the SE.
% spectral entropy (SE)
SEX = calc_SE(winX,rate);
SEY = calc_SE(winY,rate);
SEZ = calc_SE(winZ,rate);
The AR model is estimated with Burg’s method and the coefficients are computed by
the built-in arburg function. According to KHAN ET AL. [KhLK08] the most suitable
model is of order 3.
% autoregressive coefficient (AR)
% estimating AR model coefficient based on Burg's method
% with order = 3
ARX = arburg(winX,3);
ARY = arburg(winY,3);
ARZ = arburg(winZ,3);
The SMA is calculated according to Equation 3-11 in chapter 3.2.3. Basic arithmetic
operations are used as shown below.
% signal magnitude area (SMA)
SMA = sum(abs(winX)) + sum(abs(winY)) + sum(abs(winZ));
5.3.5. Neural network training
Function name: main_train.m
This chapter explains the main function for the training of an ANN from acceleration
data. It is adjusted for the use during the NutriHEP study, thus, combining the training
of two ANNs (static and dynamic) for two accelerometers (hip and tibia). According to
Req9, a training function for a single accelerometer is available. It is based on the
same algorithm principles and the code is adjusted to one ANN for one sensor position.
The main function is called main_train_single.m.
A standardized activity catalog and its number of static activities are declared as
global variables. The user chooses a folder containing the training data from hip and
tibia position. It is assumed that the second upper folder name corresponds to the subject's ID, which is ensured by using the import function (see chapter 5.2.1). The ANNs
for the tibia and for the hip are trained and saved.
40