## htrack

Simple horizontal dead-reckoned track estimation

## Syntax

#### Matlab & Octave

T=htrack(A,M,s,fs) A and M are matrices or T=htrack(A,M,s,fs,fc) A and M are matrices or T=htrack(A,M,s) A and M are sensor structures or T=htrack(A,M,s,fc) A and M are sensor structures

#### R

T <- htrack(A,M,s,fs) A and M are matrices or T <- htrack(A,M,s,fs,fc = NULL) A and M are matrices or T <- htrack(A,M,s) A and M are sensor lists or T <- htrack(A,M,s,fc = NULL) A and M are sensor lists

## Description

Simple horizontal dead-reckoned track (pseudo-track) estimation based on speed and heading. This differs from ptrack in that the animal's body angle is not considered. This makes it appropriate for animals that do not always move in the direction of their longitudinal axis.

## Inputs

Input var | Description | Units | Default value |
---|---|---|---|

A | is a nx3 acceleration matrix with columns [ax ay az]. Acceleration can be in any consistent unit, e.g., g or m/s^{2}. | g or m/s^{2} | N/A |

M | is the magnetometer signal matrix, M=[mx,my,mz] in any consistent unit (e.g., in uT or Gauss). | uT or Gauss | N/A |

s | is the forward speed of the animal in m/s. | m/s | N/A |

fs | is the sampling rate of the sensor data in Hz (samples per second). | Hz | N/A |

fc (optional) | specifies the cut-off frequency of a low-pass filter to apply to A and M before computing heading. | Hz | 0.2 |

## Outputs

Output var | Description | Units |
---|---|---|

T | is the estimated track in a local level frame. The track is defined as meters of northward and eastward movement (termed 'northing' and 'easting', i.e, T=[northing,easting]) relative to the animal's position at the start of the measurements(which is defined as [0,0]). The track sampling rate is the same as for the input data and so each row of T defines the track coordinates at times 0,1/fs,2/fs,… relative to the start time of the measurements. | meters |

## Notes & assumptions

- A and M must have the same size (and so are both measured at the same sampling rate).
- s can be a single number meaning that the animal is assumed to travel at a constant speed. s can also be a vector with the same number of rows as M, e.g., generated by ocdr.
- The filter length is 4*fs/fc. Filtering adds no group delay.

## Example

### Matlab & Octave

The example below uses data from the file testset1.nc. You can download it from the animaltags website's example data sets. If the file is saved in your current working directory, load it via:

testset1 = load_nc(‘testset1.nc’)

htrack(testset1.A.data, testset1.M.data, 4, testset1.A.sampling_rate)

### R

The example below uses data from the file testset1.nc. You can download it from the animaltags website's example data sets. If the file is saved in your current working directory, load it via:

testset1 <- load_nc(‘testset1.nc’)

htrack(A = testset1$A$data, M = testset1$M$data, s = 4, fs = testset1$A$sampling_rate, fc = NULL)

## About

bugs@animaltags.org Last modified: 10 May 2017