Standardize: Standardize accelerometer and magnetometer data

Description Usage Arguments Details Value Author(s) Examples

View source: R/Standardize.R

Description

Calculates intercept and slope values with a linear model to standardize accelerometer and magnetometer data to values between -1 and +1.

Usage

1
2
3
Standardize(MagOrSR, MagOrHV, MagOrSW, AccOrSR, AccOrHV, AccOrSW, magSRmin, 
magSRmax, magHVmin, magHVmax, magSWmin, magSWmax, accSRmin, accSRmax, accHVmin,
accHVmax, accSWmin, accSWmax)

Arguments

MagOrSR

Surge Magnetometer Orientation -1 or 1

MagOrHV

Heave Magnetometer Orientation -1 or 1

MagOrSW

Sway Magnetometer Orientation -1 or 1

AccOrSR

Surge Accelerometer Orientation -1 or 1

AccOrHV

Heave Accelerometer Orientation -1 or 1

AccOrSW

Sway Accelerometer Orientation -1 or 1

magSRmin

Surge Magnetometer minimum

magSRmax

Surge Magnetometer maximum

magHVmin

Heave Magnetometer minimum

magHVmax

Heave Magnetometer maximum

magSWmin

Sway Magnetometer minimum

magSWmax

Sway Magnetometer maximum

accSRmin

Surge Accelerometer minimum

accSRmax

Surge Accelerometer maximum

accHVmin

Heave Accelerometer minimum

accHVmax

Heave Accelerometer maximum

accSWmin

Sway Accelerometer minimum

accSWmax

Sway Accelerometer maximum

Details

Standardization/Calibration/normalization/relativizing of accelerometer and magnetometer data. The right-hand-rule indicates the orientation (polarity) of the magnetometers and accelerometers required for the pseudotrack reconstruction algorithm, so that when the front, top or left side of the tag is facing the earth, the accelerometers are at the maximal reading (+1) when the tag is not moving. A similar rule applies for the magnetometers except the maximal reading for each axis will be when the front, top or left side is facing north and at the angle of inclination of the magnetic field (the angle at which the magnetic field enters the earth) at that location on the planet. If the tag sensors conform to this rule all the orientation parameters should be 1, any sensors that are opposite to this should have -1 as an orientation value. Instead of labeling the tag in X,Y and Z dimensions, the directions are labeled as Surge, Heave and Sway where Surge indicates the front (anterior) to back (posterior) axis, the Heave is the top (dorsal) to bottom (ventral) axis and the Sway is the right to left (lateral) axis.

Value

Returns a [2,6] matrix with intercept in the first row and slope in the second row and columns in the order of the orientation parameter input. Row names are c("B0 Intercept","B1 Slope") and column names are c("MagSurge","MagHeave","MagSway","AccSurge","AccHeave","AccSway").

Author(s)

Brian Battaile

Examples

1
2
3
betas<-Standardize(1,1,-1,1,1,1,-57.8,68.76,-61.8,64.2,-70.16,58.08,-10.1,9.55,-9.75,9.72,
-9.91,9.43)
betas

Example output

Loading required package: fields
Loading required package: spam
Loading required package: dotCall64
Loading required package: grid
Spam version 2.1-1 (2017-07-02) is loaded.
Type 'help( Spam)' or 'demo( spam)' for a short introduction 
and overview of this package.
Help for individual functions is also obtained by adding the
suffix '.spam' to the function name, e.g. 'help( chol.spam)'.

Attaching package: 'spam'

The following objects are masked from 'package:base':

    backsolve, forwardsolve

Loading required package: maps
Loading required package: RColorBrewer
                MagSurge    MagHeave     MagSway   AccSurge    AccHeave
B0 Intercept -0.08659924 -0.01904762 -0.09419838 0.02798982 0.001540832
B1 Slope      0.01580278  0.01587302 -0.01559576 0.10178117 0.102722137
                AccSway
B0 Intercept 0.02481903
B1 Slope     0.10341262

TrackReconstruction documentation built on Dec. 11, 2021, 10:07 a.m.