0% found this document useful (0 votes)
4 views85 pages

Matlabsimulink Sensor Fusion and Tracking Toolbox Reference The Mathworks Instant Download

The document provides a reference guide for the Sensor Fusion and Tracking Toolbox in MATLAB Simulink, detailing its functions, classes, and system objects. It includes examples of how to use specific functions like Allan variance and constant turn-rate rectangular target motion models. Additionally, it offers links to related resources and documentation for further learning and support from MathWorks.

Uploaded by

selezinkuah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views85 pages

Matlabsimulink Sensor Fusion and Tracking Toolbox Reference The Mathworks Instant Download

The document provides a reference guide for the Sensor Fusion and Tracking Toolbox in MATLAB Simulink, detailing its functions, classes, and system objects. It includes examples of how to use specific functions like Allan variance and constant turn-rate rectangular target motion models. Additionally, it offers links to related resources and documentation for further learning and support from MathWorks.

Uploaded by

selezinkuah
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 85

Matlabsimulink Sensor Fusion And Tracking

Toolbox Reference The Mathworks download

https://ebookbell.com/product/matlabsimulink-sensor-fusion-and-
tracking-toolbox-reference-the-mathworks-36497084

Explore and download more ebooks at ebookbell.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Matlabsimulink Radar Toolbox Users Guide V13 The Mathworks

https://ebookbell.com/product/matlabsimulink-radar-toolbox-users-
guide-v13-the-mathworks-46231538

Matlabsimulink Vehicle Dynamics Blockset Users Guide The Mathworks

https://ebookbell.com/product/matlabsimulink-vehicle-dynamics-
blockset-users-guide-the-mathworks-46470278

Matlab Simulink Ultra Basics Fujii Toshinori

https://ebookbell.com/product/matlab-simulink-ultra-basics-fujii-
toshinori-46694204

Matlab Simulink Installation Guide For Windows Release 14 Product


Family The Mathworks

https://ebookbell.com/product/matlab-simulink-installation-guide-for-
windows-release-14-product-family-the-mathworks-5429100
Matlab Simulink Documentation Mathworks

https://ebookbell.com/product/matlab-simulink-documentation-
mathworks-6741142

Feedback Control Systems Matlabsimulink Approach Farzin Asadi

https://ebookbell.com/product/feedback-control-systems-matlabsimulink-
approach-farzin-asadi-11052902

Modeling And Simulation Using Matlab Simulink For Ece Dr Shailendra


Jain

https://ebookbell.com/product/modeling-and-simulation-using-matlab-
simulink-for-ece-dr-shailendra-jain-231663150

State Feedback Control And Kalman Filtering With Matlabsimulink


Tutorials Liuping Wang

https://ebookbell.com/product/state-feedback-control-and-kalman-
filtering-with-matlabsimulink-tutorials-liuping-wang-46482740

Disturbance Observer For Advanced Motion Control With Matlab Simulink


Akira Shimada

https://ebookbell.com/product/disturbance-observer-for-advanced-
motion-control-with-matlab-simulink-akira-shimada-49607168
Sensor Fusion and Tracking Toolbox™
Reference

R2021b
How to Contact MathWorks

Latest news: www.mathworks.com

Sales and services: www.mathworks.com/sales_and_services

User community: www.mathworks.com/matlabcentral

Technical support: www.mathworks.com/support/contact_us

Phone: 508-647-7000

The MathWorks, Inc.


1 Apple Hill Drive
Natick, MA 01760-2098
Sensor Fusion and Tracking Toolbox™ Reference Guide
© COPYRIGHT 2018 – 2021 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied
only under the terms of the license agreement. No part of this manual may be photocopied or reproduced in any form
without prior written consent from The MathWorks, Inc.
FEDERAL ACQUISITION: This provision applies to all acquisitions of the Program and Documentation by, for, or through
the federal government of the United States. By accepting delivery of the Program or Documentation, the government
hereby agrees that this software or documentation qualifies as commercial computer software or commercial computer
software documentation as such terms are used or defined in FAR 12.212, DFARS Part 227.72, and DFARS 252.227-7014.
Accordingly, the terms and conditions of this Agreement and only those rights specified in this Agreement, shall pertain
to and govern the use, modification, reproduction, release, performance, display, and disclosure of the Program and
Documentation by the federal government (or other entity acquiring for or through the federal government) and shall
supersede any conflicting contractual terms or conditions. If this License fails to meet the government's needs or is
inconsistent in any respect with federal procurement law, the government agrees to return the Program and
Documentation, unused, to The MathWorks, Inc.
Trademarks
MATLAB and Simulink are registered trademarks of The MathWorks, Inc. See
www.mathworks.com/trademarks for a list of additional trademarks. Other product or brand names may be
trademarks or registered trademarks of their respective holders.
Patents
MathWorks products are protected by one or more U.S. patents. Please see www.mathworks.com/patents for
more information.
Revision History
September 2018 Online only New for Version 1.0 (Release 2018b)
March 2019 Online only Revised for Version 1.1 (Release 2019a)
September 2019 Online only Revised for Version 1.2 (Release 2019b)
March 2020 Online only Revised for Version 1.3 (Release 2020a)
September 2020 Online only Revised for Version 2.0 (Release 2020b)
March 2021 Online only Revised for Version 2.1 (Release 2021a)
September 2021 Online only Revised for Version 2.2 (Release 2021b)
Contents

Functions
1

Classes
2

System Objects
3

Blocks
4

Apps
5

iii
1

Functions
1 Functions

allanvar
Allan variance

Syntax
[avar,tau] = allanvar(Omega)
[avar,tau] = allanvar(Omega,m)
[avar,tau] = allanvar(Omega,ptStr)
[avar,tau] = allanvar(___,fs)

Description
Allan variance is used to measure the frequency stability of oscillation for a sequence of data in the
time domain. It can also be used to determine the intrinsic noise in a system as a function of the
averaging time. The averaging time series τ can be specified as τ = m/fs. Here fs is the sampling
frequency of data, and m is a list of ascending averaging factors (such as 1, 2, 4, 8, …).

[avar,tau] = allanvar(Omega) returns the Allan variance avar as a function of averaging time
tau. The default averaging time tau is an octave sequence given as (1, 2, ..., 2floor{log2[(N-1)/2]}), where
N is the number of samples in Omega. If Omega is specified as a matrix, allanvar operates over the
columns of omega.

[avar,tau] = allanvar(Omega,m) returns the Allan variance avar for specific values of tau
defined by m. Since the default frequency fs is assumed to be 1, the output tau is exactly same with
m.

[avar,tau] = allanvar(Omega,ptStr) sets averaging factor m to the specified point


specification, ptStr. Since the default frequency fs is 1, the output tau is exactly equal to the
specified m. ptStr can be specified as 'octave' or 'decade'.

[avar,tau] = allanvar(___,fs) also allows you to provide the sampling frequency fs of the
input data omega in Hz. This input parameter can be used with any of the previous syntaxes.

Examples

Determine Allan Variance of Single Axis Gyroscope

Load gyroscope data from a MAT file, including the sample rate of the data in Hz. Calculate the Allan
variance.
load('LoggedSingleAxisGyroscope','omega','Fs')
[avar,tau] = allanvar(omega,'octave',Fs);

Plot the Allan variance on a loglog plot.


loglog(tau,avar)
xlabel('\tau')
ylabel('\sigma^2(\tau)')
title('Allan Variance')
grid on

1-2
allanvar

Determine Allan Deviation at Specific Values of τ

Generate sample gyroscope noise, including angle random walk and rate random walk.

numSamples = 1e6;
Fs = 100;
nStd = 1e-3;
kStd = 1e-7;
nNoise = nStd.*randn(numSamples,1);
kNoise = kStd.*cumsum(randn(numSamples,1));
omega = nNoise+kNoise;

Calculate the Allan deviation at specific values of m = τ. The Allan deviation is the square root of the
Allan variance.

m = 2.^(9:18);
[avar,tau] = allanvar(omega,m,Fs);
adev = sqrt(avar);

Plot the Allan deviation on a loglog plot.

loglog(tau,adev)
xlabel('\tau')
ylabel('\sigma(\tau)')

1-3
1 Functions

title('Allan Deviation')
grid on

Input Arguments
Omega — Input data
N-by-1 vector | N-by-M matrix

Input data specified as an N-by-1 vector or an N-by-M matrix. N is the number of samples, and M is
the number of sample sets. If specified as a matrix, allanvar operates over the columns of Omega.
Data Types: single | double

m — Averaging factor
scalar | vector

Averaging factor, specified as a scalar or vector with ascending integer values less than (N-1)/2,
where N is the number of samples in Omega.
Data Types: single | double

ptStr — Point specification of m


'octave' (default) | 'decade'

Point specification of m, specified as 'octave' or 'decade'. Based on the value of ptStr, m is


specified as following:

1-4
allanvar

• If ptStr is specified as 'octave', m is:


N−1
0 1 log2
2 , 2 ...2 2

• If ptStr is specified as 'decade', m is:


N−1
0 1 log10
10 , 10 ...10 2

N is the number of samples in Omega.

fs — Basic frequency of input data in Hz


scalar

Basic frequency of the input data, Omega, in Hz, specified as a positive scalar.
Data Types: single | double

Output Arguments
avar — Allan variance of input data
vector | matrix

Allan variance of input data at tau, returned as a vector or matrix.

tau — Averaging time of Allan variance


vector | matrix

Averaging time of Allan variance, returned as a vector, or a matrix.

See Also
gyroparams | imuSensor

Introduced in R2019a

1-5
1 Functions

ctrect
Constant turn-rate rectangular target motion model

Syntax
updatedstates = ctrect(states)
updatedstates = ctrect(states,dt)
updatedstates = ctrect(states,w,dt)

Description
updatedstates = ctrect(states) returns the updated rectangular states from the current
rectangular states based on the rectangular target motion model. The default time step is 1 second.

updatedstates = ctrect(states,dt) specifies the time step, dt, in seconds.

updatedstates = ctrect(states,w,dt) additionally specifies the process noise, w.

Examples

Predict Constant Turn-Rate Rectangular State

Define a rectangular state.


state = [1 2 2 30 1 4.7 1.8];

Predict the state dt = 1 second forward using the default syntax.


state = ctrect(state,0.1)

state = 1×7

1.1731 2.1002 2.0000 30.1000 1.0000 4.7000 1.8000

Predict the state dt = 0.1 second forward without noise.


state = ctrect(state,0.1)

state = 1×7

1.3461 2.2006 2.0000 30.2000 1.0000 4.7000 1.8000

Predict the state dt = 0.1 second forward with noise.


state = ctrect(state,0.01,0.1)

state = 1×7

1.5189 2.3014 2.0010 30.3000 1.0010 4.7000 1.8000

1-6
ctrect

Predict Multiple Constant Turn-Rate Rectangular States

Define a state matrix.


states = [1 3 4;-1 2 10;5 3 1.3;1 1.3 2.1;30 0 -30;4.7 3.4 4.5;1.8 2 3];

Predict the state dt = 1 second ahead.


states = ctrect(states)

states = 7×3

5.7516 5.9992 5.2528


0.3625 2.0681 9.7131
5.0000 3.0000 1.3000
31.0000 1.3000 -27.9000
30.0000 0.0000 -30.0000
4.7000 3.4000 4.5000
1.8000 2.0000 3.0000

Predict the state dt = 0.1 second ahead without noise.


states = ctrect(states,0.1)

states = 7×3

6.1732 6.2992 5.3660


0.6311 2.0749 9.6493
5.0000 3.0000 1.3000
34.0000 1.3000 -30.9000
30.0000 0.0000 -30.0000
4.7000 3.4000 4.5000
1.8000 2.0000 3.0000

Predict the state dt = 0.1 second ahead with noise.


states = ctrect(states,0.1*randn(2,3),0.1)

states = 7×3

6.5805 6.5979 5.4759


0.9216 2.0816 9.5795
5.0054 2.9774 1.3032
37.0009 1.3004 -33.9007
30.0183 0.0086 -30.0131
4.7000 3.4000 4.5000
1.8000 2.0000 3.0000

Input Arguments
states — Current rectangular states
1-by-7 real-valued vector | 7-by-1 real-valued vector | 7-by-N real-valued matrix

1-7
1 Functions

Current rectangular states, specified as a 1-by-7 real-valued vector, 7-by-1 real-valued vector, or a 7-
by-N real-valued matrix, where N is the number of states. The seven dimensional rectangular target
state is defined as [x; y; s; θ; ω; L; W]:

Variable Meaning Unit


x Position of the rectangle center m
in x direction
y Position of the rectangle center m
in y direction
s Speed in the heading direction m/s
θ Orientation angle of the degree
rectangle with respect to x
direction
ω Turn-rate degree/s
L Length of the rectangle m
W Width of the rectangle m

Example: [1;2;2;30;1;4.7;1.8]
Data Types: single | double

dt — Time step
real-valued positive scalar

Time step, specified as a real-valued positive scalar in second.


Data Types: single | double

w — Process noise
real scalar | 2-by-N real-valued matrix

Process noise, specified as a 2-by-N real-valued matrix, where N is the number of states specified in
the states input. If specified as a scalar, it is expanded to a 2-by-N matrix with all elements equal to

1-8
ctrect

the scalar. The first row of the matrix specifies the process noise in acceleration (m/s2). The second
row specifies the process noise in yaw acceleration (degrees/s2).
Data Types: single | double

Output Arguments
updatedstates — Updated states
1-by-7 real-valued vector | 7-by-1 real-valued vector | 7-by-N real-valued matrix

Updated states, specified as a 1-by-7 real-valued vector, a 7-by-1 real-valued vector, or a 7-by-N real-
valued matrix, where N is the number of states. The dimensions and setups of updatedstates
output are exactly the same as those of the states input.
Data Types: single | double

Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also
gmphd | trackerPHD | ctrectmeas | ctrectmeasjac | ctrectjac | initctrectgmphd |
ctrectcorners

Introduced in R2019b

1-9
1 Functions

ctrectmeas
Constant turn-rate rectangular target measurement model

Syntax
measurements = ctrectmeas(states,detections)

Description
measurements = ctrectmeas(states,detections) returns the expected measurements from
the current rectangular states and detections.

Examples

Expected Detections Using Rectangular Measurement Model

Load detections and truth generated from a rectangular target.

load('rectangularTargetDetections.mat','detections','truthState');

Generate expected detections from the target's rectangular state and actual detections using
ctrectmeas.

tgtState = [3;48;0;60;0;5;1.9];
zExp = ctrectmeas(tgtState,detections);

Set up visualization environment using theaterPlot.

theaterP = theaterPlot;
stateP = trackPlotter(theaterP,'DisplayName','State','MarkerFaceColor','g');
truthP = trackPlotter(theaterP,'DisplayName','Truth','MarkerFaceColor', 'b');
detP = detectionPlotter(theaterP,'DisplayName','Detections','MarkerFaceColor','r');
expDetP = detectionPlotter(theaterP,'DisplayName','Expected Detections','MarkerFaceColor','y');
l = legend(theaterP.Parent);
l.AutoUpdate = 'on';
hold on;
assignP = plot(theaterP.Parent,NaN,NaN,'-.','DisplayName','Association');

Plot actual and expected detections.

inDets = [detections{:}];
inMeas = horzcat(inDets.Measurement);
detP.plotDetection(inMeas');

zExpPlot = reshape(zExp,3,[]);
expDetP.plotDetection(zExpPlot');

Plot association lines.

zLines = nan(2,numel(detections)*3);
zLines(1,1:3:end) = zExpPlot(1,:);

1-10
ctrectmeas

zLines(2,1:3:end) = zExpPlot(2,:);
zLines(1,2:3:end) = inMeas(1,:);
zLines(2,2:3:end) = inMeas(2,:);
assignP.XData = zLines(1,:);
assignP.YData = zLines(2,:);

Plot truth and state.

truthPos = [truthState(1:2);0];
truthDims = struct('Length',truthState(6),...
'Width',truthState(7),...
'Height', 0,...
'OriginOffset', [0 0 0]);
truthOrient = quaternion([truthState(4) 0 0],'eulerd', 'ZYX','frame');
truthP.plotTrack(truthPos',truthDims,truthOrient);

statePos = [tgtState(1:2);0];
stateDims = struct('Length',tgtState(6),...
'Width',tgtState(7),...
'Height',0,...
'OriginOffset', [0 0 0]);
stateOrient = quaternion([tgtState(4) 0 0],'eulerd', 'ZYX','frame');
stateP.plotTrack(statePos', stateDims, stateOrient);

1-11
1 Functions

Input Arguments
states — Current rectangular states
7-by-N real-valued matrix

Current rectangular states, specified as a 7-by-N real-valued matrix, where N is the number of states.
The seven-dimensional rectangular target state is defined as [x; y; s; θ; ω; L; W]:

Variable Meaning Unit


x Position of the rectangle center m
in x direction
y Position of the rectangle center m
in y direction
s Speed in the heading direction m/s
θ Orientation angle of the degree
rectangle with respect to x
direction
ω Turn-rate degree/s
L Length of the rectangle m
W Width of the rectangle m

Example: [1;2;2;30;1;4.7;1.8]
Data Types: single | double

detections — Detections of target


1-by-M cell array of objectDetection objects

Detections of target, specified as a 1-by-M cell array of objectDetection objects. The


MeasurementParameters property (that specifies the transformation from the state-space to
measurement-space) for each object must be the same for all the detections in the cell array.

1-12
ctrectmeas

Output Arguments
measurements — Expected measurements
P-by-N-by-M real-valued array

Expected measurements, returned as a P-by-N-by-M real-valued array. P is the dimension of each


measurement specified in the detections input, N is the number of states specified in the states
input, and M is the number of detections specified in the detections input.

Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also
trackerPHD | gmphd | ctrect | ctrectmeasjac | ctrectjac | initctrectgmphd |
ctrectcorners

Introduced in R2019b

1-13
1 Functions

ctrectmeasjac
Jacobian of constant turn-rate rectangular target measurement model

Syntax
jacobian = ctrectmeasjac(state,detections)

Description
jacobian = ctrectmeasjac(state,detections) returns the Jacobian based on the current
rectangular target state and detections.

Examples

Generate Jacobian for Rectangular Target Model

Load detections generated from a rectangular target.

load('rectangularTargetDetections.mat','detections');

Calculate Jacobian based on the rectangular state of the target and detections.

tgtState = [3;48;0;60;0;5;1.9];
jac = ctrectmeasjac(tgtState,detections);
jac1 = jac(:,:,1)

jac1 = 3×7

1.0000 0 0 0.0461 0 -0.2500 0.4330


0 1.0000 0 -0.0075 0 -0.4330 -0.2500
0 0 0 0 0 0 0

Input Arguments
state — Current rectangular target state
7-by-1 real-valued vector

Current rectangular target state, specified as a 7-by-1 real-valued vector. The seven dimensional
rectangular target state is defined as [x; y; s; θ; ω; L; W]. The meaning of these variables and their
units are:

Variable Meaning Unit


x Position of the rectangle center m
in x direction
y Position of the rectangle center m
in y direction

1-14
ctrectmeasjac

s Speed in the heading direction m/s


θ Orientation angle of the degree
rectangle with respect to x
direction
ω Turn-rate degree/s
L Length of the rectangle m
W Width of the rectangle m

Example: [1;2;2;30;1;4.7;1.8]
Data Types: single | double

detections — Detections of target


1-by-M cell array of objectDetection objects

Detections of target, specified as a 1-by-M cell array of objectDetection objects. The


MeasurementParameters property (that specifies the transformation from the state-space to
measurement-space) for each object must be the same for all the detections in the cell array.

Output Arguments
jacobian — Jacobian of measurement model
M-by-7-by-D real-valued array

Jacobian of measurement model, returned as a M-by-7-by-D real-valued array. M is the dimension of


each measurement specified in detections, and D is the number of detections specified in the
detections input.

Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

1-15
1 Functions

See Also
trackerPHD | gmphd | ctrect | ctrectmeas | ctrectjac | initctrectgmphd | ctrectcorners

Introduced in R2019b

1-16
ctrectjac

ctrectjac
Jacobian of constant turn-rate rectangular target motion model

Syntax
Jx = ctrectjac(state)
Jx = ctrectjac(state,dt)
[Jx,Jw] = ctrectjac(state,w,dt)

Description
Jx = ctrectjac(state) returns the Jacobian matrix of the constant turn-rate rectangular motion
model with respect to the state vector. The default time step is 1 second.

Jx = ctrectjac(state,dt) specifies the time step dt in seconds.

[Jx,Jw] = ctrectjac(state,w,dt) also specifies the process noise w.

Examples

Jacobian of Constant Turn-Rate Rectangular Motion Model

Define a state vector for the model.

state = [1;2;2;30;1;4.7;1.8];

Compute the Jacobian. dt = 1 second.

jac = ctrectjac(state)

jac = 7×7

1.0000 0 0.8616 -0.0177 -0.0089 0 0


0 1.0000 0.5075 0.0301 0.0150 0 0
0 0 1.0000 0 0 0 0
0 0 0 1.0000 1.0000 0 0
0 0 0 0 1.0000 0 0
0 0 0 0 0 1.0000 0
0 0 0 0 0 0 1.0000

Compute the Jacobian. dt = 0.1 second without noise.

jac = ctrectjac(state,0.1)

jac = 7×7

1.0000 0 0.0866 -0.0017 -0.0001 0 0


0 1.0000 0.0501 0.0030 0.0002 0 0
0 0 1.0000 0 0 0 0
0 0 0 1.0000 0.1000 0 0

1-17
1 Functions

0 0 0 0 1.0000 0 0
0 0 0 0 0 1.0000 0
0 0 0 0 0 0 1.0000

Compute the Jacobian. dt = 0.1 second with noise.

jac = ctrectjac(state,0.01,0.1)

jac = 7×7

1.0000 0 0.0866 -0.0017 -0.0001 0 0


0 1.0000 0.0501 0.0030 0.0002 0 0
0 0 1.0000 0 0 0 0
0 0 0 1.0000 0.1000 0 0
0 0 0 0 1.0000 0 0
0 0 0 0 0 1.0000 0
0 0 0 0 0 0 1.0000

Input Arguments
state — Current state
1-by-7 real-valued vector

Current state, specified as a 1-by-7 real-valued vector. The sate of the constant-turn rectangular
target model is [x; y; s; θ; ω; L; W]. The meaning of these variables and their units are:

Variable Meaning Unit


x Position of the rectangle center m
in x direction
y Position of the rectangle center m
in y direction
s Speed in the heading direction m/s
θ Orientation angle of the degree
rectangle with respect to x
direction
ω Turn-rate degree/s
L Length of the rectangle m
W Width of the rectangle m

1-18
ctrectjac

Example: [1;2;2;30;1;4.7;1.8]
Data Types: single | double

dt — Time step
real-valued positive scalar

Time step, specified as a real-valued positive scalar in second.


Data Types: single | double

w — Process noise
real scalar | 2-element real-valued vector

Process noise, specified as a 2-element real-valued vector. The first element specifies the process
noise in linear acceleration (m/s2). The second element specifies the process noise in yaw acceleration
(degrees/s2).
Data Types: single | double

Output Arguments
Jx — Jacobian matrix with respect to state
7-by-7 matrix

Jacobian matrix with respect to state, returned as a 7-by-7 matrix.


Data Types: double

Jw — Jacobian with respect to process noise


7-by-2 matrix

Jacobian with respect to process noise, returned as a 7-by-2 matrix.


Data Types: double

1-19
1 Functions

Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also
gmphd | trackerPHD | ctrect | ctrectmeas | ctrectmeasjac | initctrectgmphd |
ctrectcorners

Introduced in R2019b

1-20
jpdaEvents

jpdaEvents
Feasible joint events for trackerJPDA

Syntax
FJE = jpdaEvents(validationMatrix)
[FJE,FJEProbs] = jpdaEvents(likelihoodMatrix,k)

Description
FJE = jpdaEvents(validationMatrix) returns the feasible joint events, FJE, based on the
validation matrix. A validation matrix describes the possible associations between detections and
tracks, whereas a feasible joint event for multi-object tracking is one realization of the associations
between detections and tracks.

[FJE,FJEProbs] = jpdaEvents(likelihoodMatrix,k) generates the k-best feasible joint


event matrices, FJE, corresponding to the posterior likelihood matrix, likelihoodMatrix.
likelihoodMatrix defines the posterior likelihood of associating detections with tracks.

Examples

Generate Feasible Joint Events

Define an arbitrary validation matrix for five measurements and six tracks.

M = [1 1 1 1 1 0 1
1 0 1 1 0 0 0
1 0 0 0 1 1 0
1 1 1 1 0 0 0
1 1 1 1 1 1 1];

Generate all feasible joint events and count the total number.

FJE = jpdaEvents(M);
nFJE = size(FJE,3);

Display a few of the feasible joint events.

disp([num2str(nFJE) ' feasible joint event matrices were generated.'])

574 feasible joint event matrices were generated.

toSee = [1:round(nFJE/5):nFJE, nFJE];


for ii = toSee
disp("Feasible joint event matrix #" + ii + ":")
disp(FJE(:,:,ii))
end

Feasible joint event matrix #1:

1-21
1 Functions

1 0 0 0 0 0 0
1 0 0 0 0 0 0
1 0 0 0 0 0 0
1 0 0 0 0 0 0
1 0 0 0 0 0 0

Feasible joint event matrix #116:

0 0 1 0 0 0 0
1 0 0 0 0 0 0
0 0 0 0 1 0 0
0 1 0 0 0 0 0
0 0 0 1 0 0 0

Feasible joint event matrix #231:

0 0 0 0 1 0 0
0 0 1 0 0 0 0
0 0 0 0 0 1 0
1 0 0 0 0 0 0
0 0 0 0 0 0 1

Feasible joint event matrix #346:

0 0 0 0 0 0 1
0 0 0 1 0 0 0
0 0 0 0 1 0 0
1 0 0 0 0 0 0
0 1 0 0 0 0 0

Feasible joint event matrix #461:

1 0 0 0 0 0 0
0 0 1 0 0 0 0
1 0 0 0 0 0 0
0 0 0 1 0 0 0
0 0 0 0 0 0 1

Feasible joint event matrix #574:

1 0 0 0 0 0 0
1 0 0 0 0 0 0
1 0 0 0 0 0 0
1 0 0 0 0 0 0
0 0 0 0 0 0 1

Obtain Feasible Joint Events from Likelihood Matrix

Create a likelihood matrix assuming four detections and two tracks.

likeMatrix = [0.1 0.1 0.1;


0.1 0.3 0.2;
0.1 0.4 0.1;
0.1 0.6 0.1;
0.1 0.5 0.3];

Generate three most probable events and obtain their normalized probabilities.

1-22
jpdaEvents

[FJE,FJEProbs] = jpdaEvents(likeMatrix,3)

FJE = 4x3x3 logical array


FJE(:,:,1) =

1 0 0
1 0 0
0 1 0
0 0 1

FJE(:,:,2) =

0 0 1
1 0 0
0 1 0
1 0 0

FJE(:,:,3) =

1 0 0
0 1 0
1 0 0
0 0 1

FJEProbs = 3×1

0.4286
0.2857
0.2857

Input Arguments
validationMatrix — Validation matrix
m-by-(n+1) matrix

Validation matrix, specified as an m-by-(n+1) matrix, where m is the number of detections within the
cluster of a sensor scan, and n is the number of tracks maintained in the tracker. The validation
matrix uses the first column to account for the possibility that each detection is clutter or false alarm,
which is commonly referred to as "Track 0" or T0. The validation matrix is a binary matrix listing all
possible detections-to-track associations. If it is possible to assign track Ti to detection Dj, then the (j,
i+1) entry of the validation matrix is 1. Otherwise, the entry is 0.
Data Types: logical

likelihoodMatrix — Likelihood matrix


(m+1)-by-(n+1) matrix

Likelihood matrix, specified as an (m+1)-by-(n+1) matrix, where m is the number of detections within
the cluster of a sensor scan, and n is the number of tracks maintained in the tracker. The likelihood
matrix uses the first column to account for the possibility that each detection is clutter or false alarm,
which is commonly referred to as "Track 0" or T0. The matrix uses the first row to account for the

1-23
1 Functions

possibility that each track is not assigned to any detection, which can be referred to as "Detection 0"
or D0 . The (j+1,i+1) element of the matrix represents the likelihood to assign track Ti to detection Dj.
Data Types: logical

k — Number of joint probabilistic events


positive integer

Number of joint probabilistic events, specified as a positive integer.


Data Types: logical

Output Arguments
FJE — Feasible joint events
m-by-(n+1)-by-p array

Feasible joint events, specified as an m-by-(n+1)-by-p array, where m is the number of detections
within the cluster of a sensor scan, n is the number of tracks maintained in the tracker, and p is the
total number of feasible joint events. Each page (an m-by-(n+1) matrix) of FJE corresponds to one
possible association between all the tracks and detections. The feasible joint event matrix on each
page satisfies:

• The matrix has exactly one "1" value per row.


• Except for the first column, which maps to clutter, there can be at most one "1" per column.

For more details on feasible joint events, see “Feasible Joint Events” on page 1-24.
Data Types: logical

FJEProbs — Probabilities of feasible joint events


p-by-1 vector of nonnegative scalars

Probabilities of feasible joint events, returned as a p-by-1 vector of nonnegative scalars. The
summation of these scalars is equal to 1. The k-th element represents the probability of the k-th joint
events (specified in the FJE output argument) normalized over the p feasible joint events.
Data Types: logical

More About
Feasible Joint Events

In the typical workflow for a tracking system, the tracker needs to determine if a detection can be
associated with any of the existing tracks. If the tracker only maintains one track, the assignment can
be done by evaluating the validation gate around the predicted measurement and deciding if the
measurement falls within the validation gate. In the measurement space, the validation gate is a
spatial boundary, such as a 2-D ellipse or a 3-D ellipsoid, centered at the predicted measurement. The
validation gate is defined using the probability information (state estimation and covariance, for
example) of the existing track, such that the correct or ideal detections have high likelihood (97%
probability, for example) of falling within this validation gate.

However, if a tracker maintains multiple tracks, the data association process becomes more
complicated, because one detection can fall within the validation gates of multiple tracks. For
example, in the following figure, tracks T1 and T2 are actively maintained in the tracker, and each of

1-24
jpdaEvents

them has its own validation gate. Since the detection D2 is in the intersection of the validation gates
of both T1 and T2, the two tracks (T1 and T2) are connected and form a cluster. A cluster is a set of
connected tracks and their associated detections.

To represent the association relationship in a cluster, the validation matrix is commonly used. Each
row of the validation matrix corresponds to a detection while each column corresponds to a track. To
account for the eventuality of each detection being clutter, a first column is added and usually
referred to as "Track 0" or T0. If detection Di is inside the validation gate of track Dj, then the (j, i+1)
entry of the validation matrix is 1. Otherwise, it is zero. For the cluster shown in the figure, the
validation matrix Ω is

1 10
Ω= 1 1 1
1 01

Note that all the elements in the first column of Ω are 1, because any detection can be clutter or false
alarm. One important step in the logic of joint probabilistic data association (JPDA) is to obtain all the
feasible independent joint events in a cluster. Two assumptions for the feasible joint events are:

• A detection cannot be emitted by more than one track.


• A track cannot be detected more than once by the sensor during a single scan.

Based on these two assumptions, feasible joint events (FJEs) can be formulated. Each FJE is mapped
to an FJE matrix Ωp from the initial validation matrix Ω. For example, with the validation matrix Ω,
eight FJE matrices can be obtained:

1 0 0 010 1 00 1 0 0
Ω1 = 1 0 0 , Ω2 = 1 0 0 , Ω3 = 0 1 0 , Ω4 = 0 0 1
1 0 0 100 1 00 1 0 0
0 1 0 100 01 0 1 0 0
Ω5 = 0 0 1 , Ω6 = 1 0 0 , Ω7 = 1 0 0 , Ω8 = 0 1 0
1 0 0 001 00 1 0 0 1

As a direct consequence of the two assumptions, the Ωp matrices have exactly one "1" value per row.
Also, except for the first column which maps to clutter, there can be at most one "1" per column.
When the number of connected tracks grows in a cluster, the number of FJE increases rapidly. The
jpdaEvents function uses an efficient depth-first search algorithm to generate all the feasible joint
event matrices.

1-25
1 Functions

References
[1] Zhou, Bin, and N. K. Bose. "Multitarget tracking in clutter: Fast algorithms for data association."
IEEE Transactions on aerospace and electronic systems 29, no. 2 (1993): 352-363.

[2] Fisher, James L., and David P. Casasent. "Fast JPDA multitarget tracking algorithm." Applied optics
28, no. 2 (1989): 371-376.

Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Usage notes and limitations:

• When dynamic memory allocation is disabled in the generated code, the order of events with the
same probability can be different from the results in MATLAB.

See Also
trackerJPDA

Introduced in R2019a

1-26
tunernoise

tunernoise
Noise structure of fusion filter

Syntax
noiseStruct = tunernoise(filterName)

Description
noiseStruct = tunernoise(filterName) returns the measurement noise structure for the filter
with name specified by the filterName input.

Examples

Obtain Measurement Noise Structure of insfilterAsync

Obtain the measurement noise structure of the insfilterAsync object.


noiseStruct = tunernoise('insfilterAsync')

noiseStruct = struct with fields:


AccelerometerNoise: 1
GyroscopeNoise: 1
MagnetometerNoise: 1
GPSPositionNoise: 1
GPSVelocityNoise: 1

Tune insfilterAsync to Optimize Pose Estimate

Load the recorded sensor data and ground truth data.


load('insfilterAsyncTuneData.mat');

Create timetables for the sensor data and the truth data.
sensorData = timetable(Accelerometer, Gyroscope, ...
Magnetometer, GPSPosition, GPSVelocity, 'SampleRate', 100);
groundTruth = timetable(Orientation, Position, ...
'SampleRate', 100);

Create an insfilterAsync filter object that has a few noise properties.


filter = insfilterAsync('State', initialState, ...
'StateCovariance', initialStateCovariance, ...
'AccelerometerBiasNoise', 1e-7, ...
'GyroscopeBiasNoise', 1e-7, ...
'MagnetometerBiasNoise', 1e-7, ...
'GeomagneticVectorNoise', 1e-7);

1-27
1 Functions

Create a tuner configuration object for the filter. Set the maximum iterations to two. Also, set the
tunable parameters as the unspecified properties.
config = tunerconfig('insfilterAsync','MaxIterations',8);
config.TunableParameters = setdiff(config.TunableParameters, ...
{'GeomagneticVectorNoise', 'AccelerometerBiasNoise', ...
'GyroscopeBiasNoise', 'MagnetometerBiasNoise'});
config.TunableParameters

ans = 1×10 string


"AccelerationNoise" "AccelerometerNoise" "AngularVelocityNoise" "GPSPositionNoise"

Use the tuner noise function to obtain a set of initial sensor noises used in the filter.
measNoise = tunernoise('insfilterAsync')

measNoise = struct with fields:


AccelerometerNoise: 1
GyroscopeNoise: 1
MagnetometerNoise: 1
GPSPositionNoise: 1
GPSVelocityNoise: 1

Tune the filter and obtain the tuned parameters.


tunedParams = tune(filter,measNoise,sensorData,groundTruth,config);

Iteration Parameter Metric


_________ _________ ______
1 AccelerationNoise 2.1345
1 AccelerometerNoise 2.1264
1 AngularVelocityNoise 1.9659
1 GPSPositionNoise 1.9341
1 GPSVelocityNoise 1.8420
1 GyroscopeNoise 1.7589
1 MagnetometerNoise 1.7362
1 PositionNoise 1.7362
1 QuaternionNoise 1.7218
1 VelocityNoise 1.7218
2 AccelerationNoise 1.7190
2 AccelerometerNoise 1.7170
2 AngularVelocityNoise 1.6045
2 GPSPositionNoise 1.5948
2 GPSVelocityNoise 1.5323
2 GyroscopeNoise 1.4803
2 MagnetometerNoise 1.4703
2 PositionNoise 1.4703
2 QuaternionNoise 1.4632
2 VelocityNoise 1.4632
3 AccelerationNoise 1.4596
3 AccelerometerNoise 1.4548
3 AngularVelocityNoise 1.3923
3 GPSPositionNoise 1.3810
3 GPSVelocityNoise 1.3322
3 GyroscopeNoise 1.2998
3 MagnetometerNoise 1.2976
3 PositionNoise 1.2976

1-28
tunernoise

3 QuaternionNoise 1.2943
3 VelocityNoise 1.2943
4 AccelerationNoise 1.2906
4 AccelerometerNoise 1.2836
4 AngularVelocityNoise 1.2491
4 GPSPositionNoise 1.2258
4 GPSVelocityNoise 1.1880
4 GyroscopeNoise 1.1701
4 MagnetometerNoise 1.1698
4 PositionNoise 1.1698
4 QuaternionNoise 1.1688
4 VelocityNoise 1.1688
5 AccelerationNoise 1.1650
5 AccelerometerNoise 1.1569
5 AngularVelocityNoise 1.1454
5 GPSPositionNoise 1.1100
5 GPSVelocityNoise 1.0778
5 GyroscopeNoise 1.0709
5 MagnetometerNoise 1.0675
5 PositionNoise 1.0675
5 QuaternionNoise 1.0669
5 VelocityNoise 1.0669
6 AccelerationNoise 1.0634
6 AccelerometerNoise 1.0549
6 AngularVelocityNoise 1.0549
6 GPSPositionNoise 1.0180
6 GPSVelocityNoise 0.9866
6 GyroscopeNoise 0.9810
6 MagnetometerNoise 0.9775
6 PositionNoise 0.9775
6 QuaternionNoise 0.9768
6 VelocityNoise 0.9768
7 AccelerationNoise 0.9735
7 AccelerometerNoise 0.9652
7 AngularVelocityNoise 0.9652
7 GPSPositionNoise 0.9283
7 GPSVelocityNoise 0.8997
7 GyroscopeNoise 0.8947
7 MagnetometerNoise 0.8920
7 PositionNoise 0.8920
7 QuaternionNoise 0.8912
7 VelocityNoise 0.8912
8 AccelerationNoise 0.8885
8 AccelerometerNoise 0.8811
8 AngularVelocityNoise 0.8807
8 GPSPositionNoise 0.8479
8 GPSVelocityNoise 0.8238
8 GyroscopeNoise 0.8165
8 MagnetometerNoise 0.8165
8 PositionNoise 0.8165
8 QuaternionNoise 0.8159
8 VelocityNoise 0.8159

Fuse the sensor data using the tuned filter.

dt = seconds(diff(groundTruth.Time));
N = size(sensorData,1);
qEst = quaternion.zeros(N,1);

1-29
1 Functions

posEst = zeros(N,3);
% Iterate the filter for prediction and correction using sensor data.
for ii=1:N
if ii ~= 1
predict(filter, dt(ii-1));
end
if all(~isnan(Accelerometer(ii,:)))
fuseaccel(filter,Accelerometer(ii,:), ...
tunedParams.AccelerometerNoise);
end
if all(~isnan(Gyroscope(ii,:)))
fusegyro(filter, Gyroscope(ii,:), ...
tunedParams.GyroscopeNoise);
end
if all(~isnan(Magnetometer(ii,1)))
fusemag(filter, Magnetometer(ii,:), ...
tunedParams.MagnetometerNoise);
end
if all(~isnan(GPSPosition(ii,1)))
fusegps(filter, GPSPosition(ii,:), ...
tunedParams.GPSPositionNoise, GPSVelocity(ii,:), ...
tunedParams.GPSVelocityNoise);
end
[posEst(ii,:), qEst(ii,:)] = pose(filter);
end

Compute the RMS errors.

orientationError = rad2deg(dist(qEst, Orientation));


rmsorientationError = sqrt(mean(orientationError.^2))

rmsorientationError = 2.7801

positionError = sqrt(sum((posEst - Position).^2, 2));


rmspositionError = sqrt(mean( positionError.^2))

rmspositionError = 0.5966

Visualize the results.

figure();
t = (0:N-1)./ groundTruth.Properties.SampleRate;
subplot(2,1,1)
plot(t, positionError, 'b');
title("Tuned insfilterAsync" + newline + "Euclidean Distance Position Error")
xlabel('Time (s)');
ylabel('Position Error (meters)')
subplot(2,1,2)
plot(t, orientationError, 'b');
title("Orientation Error")
xlabel('Time (s)');
ylabel('Orientation Error (degrees)');

1-30
tunernoise

Input Arguments
filterName — Name of fusion filter
'insfilterAsync' | 'ahrs10filter' | 'insfilterMARG' | 'insfilterNonholonomic' |
'insfitlerErrorState'

Name of fusion filter, specified as specified as one of these:

• 'ahrs10filter'
• 'insfilterAsync'
• 'insfilterMARG'
• 'insfitlerErrorState'
• 'insfilterNonholonomic'

Output Arguments
noiseStruct — Structure of measurement noise
structure

Structure of measurement noise, returned as a structure. For the insfilterAsync object, the
structure contains these fields.

1-31
1 Functions

Field Description Default


AccelerometerNoise Variance of accelerometer noise, 1
specified as a scalar in (m2/s)2
GyroscopeNoise Variance of gyroscope noise, 1
specified as a scalar in (rad/s)2
MagnetometerNoise Variance of magnetometer 1
noise, specified as a scalar in
(μT)2.
GPSPositionNoise Variance of GPS position noise, 1
specified as a scalar in m2
GPSVelocityNoise Standard deviation of GPS 1
velocity noise, specified as a
scalar in (m/s)2

To use this structure with the tune function, change the values of the noise to proper values as initial
guesses for tuning the noise.

See Also

Introduced in R2020b

1-32
insfilter

insfilter
Create inertial navigation filter

Syntax
filter = insfilter
filter = insfilter('ReferenceFrame',RF)

Description
filter = insfilter returns an insfilterMARG inertial navigation filter object that estimates
pose based on accelerometer, gyroscope, GPS, and magnetometer measurements. See
insfilterMARG for more details.

filter = insfilter('ReferenceFrame',RF) returns an insfilterMARG inertial navigation


filter object that estimates pose relative to a reference frame specified by RF. Specify RF as 'NED'
(North-East-Down) or 'ENU' (East-North-Up). The default value is 'NED'. See insfilterMARG for
more details.

Examples

Create Default INS Filter

The default INS filter is the insfilterMARG object. Call insfilter with no input arguments to
create the default INS filter.

filter = insfilter

filter =
insfilterMARG with properties:

IMUSampleRate: 100 Hz
ReferenceLocation: [0 0 0] [deg deg m]
State: [22x1 double]
StateCovariance: [22x22 double]

Multiplicative Process Noise Variances


GyroscopeNoise: [1e-09 1e-09 1e-09] (rad/s)²
AccelerometerNoise: [0.0001 0.0001 0.0001] (m/s²)²
GyroscopeBiasNoise: [1e-10 1e-10 1e-10] (rad/s)²
AccelerometerBiasNoise: [0.0001 0.0001 0.0001] (m/s²)²

Additive Process Noise Variances


GeomagneticVectorNoise: [1e-06 1e-06 1e-06] uT²
MagnetometerBiasNoise: [0.1 0.1 0.1] uT²

1-33
1 Functions

Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also
imufilter | ahrsfilter | insfilterErrorState | insfilterAsync |
insfilterNonholonomic | insfilterMARG

Topics
“Estimate Position and Orientation of a Ground Vehicle”

Introduced in R2018b

1-34
ecompass

ecompass
Orientation from magnetometer and accelerometer readings

Syntax
orientation = ecompass(accelerometerReading,magnetometerReading)
orientation = ecompass(accelerometerReading,magnetometerReading,
orientationFormat)
orientation = ecompass(accelerometerReading,magnetometerReading,
orientationFormat,'ReferenceFrame',RF)

Description
orientation = ecompass(accelerometerReading,magnetometerReading) returns a
quaternion that can rotate quantities from a parent (NED) frame to a child (sensor) frame.

orientation = ecompass(accelerometerReading,magnetometerReading,
orientationFormat) specifies the orientation format as quaternion or rotation matrix.

orientation = ecompass(accelerometerReading,magnetometerReading,
orientationFormat,'ReferenceFrame',RF) also allows you to specify the reference frame RF
of the orientation output. Specify RF as 'NED' (North-East-Down) or 'ENU' (East-North-Up). The
default value is 'NED'.

Examples

Determine Declination of Boston

Use the known magnetic field strength and proper acceleration of a device pointed true north in
Boston to determine the magnetic declination of Boston.

Define the known acceleration and magnetic field strength in Boston.

magneticFieldStrength = [19.535 -5.109 47.930];


properAcceleration = [0 0 9.8];

Pass the magnetic field strength and acceleration to the ecompass function. The ecompass function
returns a quaternion rotation operator. Convert the quaternion to Euler angles in degrees.

q = ecompass(properAcceleration,magneticFieldStrength);
e = eulerd(q,'ZYX','frame');

The angle, e, represents the angle between true north and magnetic north in Boston. By convention,
magnetic declination is negative when magnetic north is west of true north. Negate the angle to
determine the magnetic declination.

magneticDeclinationOfBoston = -e(1)

magneticDeclinationOfBoston = -14.6563

1-35
1 Functions

Return Rotation Matrix

The ecompass function fuses magnetometer and accelerometer data to return a quaternion that,
when used within a quaternion rotation operator, can rotate quantities from a parent (NED) frame to
a child frame. The ecompass function can also return rotation matrices that perform equivalent
rotations as the quaternion operator.

Define a rotation that can take a parent frame pointing to magnetic north to a child frame pointing to
geographic north. Define the rotation as both a quaternion and a rotation matrix. Then, convert the
quaternion and rotation matrix to Euler angles in degrees for comparison.

Define the magnetic field strength in microteslas in Boston, MA, when pointed true north.

m = [19.535 -5.109 47.930];


a = [0 0 9.8];

Determine the quaternion and rotation matrix that is capable of rotating a frame from magnetic north
to true north. Display the results for comparison.

q = ecompass(a,m);
quaterionEulerAngles = eulerd(q,'ZYX','frame')

quaterionEulerAngles = 1×3

14.6563 0 0

r = ecompass(a,m,'rotmat');
theta = -asin(r(1,3));
psi = atan2(r(2,3)/cos(theta),r(3,3)/cos(theta));
rho = atan2(r(1,2)/cos(theta),r(1,1)/cos(theta));
rotmatEulerAngles = rad2deg([rho,theta,psi])

rotmatEulerAngles = 1×3

14.6563 0 0

Determine Gravity Vector

Use ecompass to determine the gravity vector based on data from a rotating IMU.

Load the inertial measurement unit (IMU) data.

load 'rpy_9axis.mat' sensorData Fs

Determine the orientation of the sensor body relative to the local NED frame over time.

orientation = ecompass(sensorData.Acceleration,sensorData.MagneticField);

To estimate the gravity vector, first rotate the accelerometer readings from the sensor body frame to
the NED frame using the orientation quaternion vector.

1-36
ecompass

gravityVectors = rotatepoint(orientation,sensorData.Acceleration);

Determine the gravity vector as an average of the recovered gravity vectors over time.

gravityVectorEstimate = mean(gravityVectors,1)

gravityVectorEstimate = 1×3

0.0000 -0.0000 10.2102

Track Spinning Platform

Fuse modeled accelerometer and gyroscope data to track a spinning platform using both idealized
and realistic data.

Generate Ground-Truth Trajectory

Describe the ground-truth orientation of the platform over time. Use the kinematicTrajectory on
page 3-201 System object™ to create a trajectory for a platform that has no translation and spins
about its z-axis.

duration = 12;
fs = 100;
numSamples = fs*duration;

accelerationBody = zeros(numSamples,3);

angularVelocityBody = zeros(numSamples,3);
zAxisAngularVelocity = [linspace(0,4*pi,4*fs),4*pi*ones(1,4*fs),linspace(4*pi,0,4*fs)]';
angularVelocityBody(:,3) = zAxisAngularVelocity;

trajectory = kinematicTrajectory('SampleRate',fs);

[~,orientationNED,~,accelerationNED,angularVelocityNED] = trajectory(accelerationBody,angularVelo

Model Receiving IMU Data

Use an imuSensor on page 3-587 System object to mimic data received from an IMU that contains
an ideal magnetometer and an ideal accelerometer.

IMU = imuSensor('accel-mag','SampleRate',fs);
[accelerometerData,magnetometerData] = IMU(accelerationNED, ...
angularVelocityNED, ...
orientationNED);

Fuse IMU Data to Estimate Orientation

Pass the accelerometer data and magnetometer data to the ecompass function to estimate
orientation over time. Convert the orientation to Euler angles in degrees and plot the result.

orientation = ecompass(accelerometerData,magnetometerData);
orientationEuler = eulerd(orientation,'ZYX','frame');

timeVector = (0:numSamples-1).'/fs;

1-37
1 Functions

figure(1)
plot(timeVector,orientationEuler)
legend('z-axis','y-axis','x-axis')
xlabel('Time (s)')
ylabel('Rotation (degrees)')
title('Orientation from Ideal IMU')

Repeat Experiment with Realistic IMU Sensor Model

Modify parameters of the IMU System object to approximate realistic IMU sensor data. Reset the IMU
and then call it with the same ground-truth acceleration, angular velocity, and orientation. Use
ecompass to fuse the IMU data and plot the results.
IMU.Accelerometer = accelparams( ...
'MeasurementRange',20, ...
'Resolution',0.0006, ...
'ConstantBias',0.5, ...
'AxesMisalignment',2, ...
'NoiseDensity',0.004, ...
'BiasInstability',0.5);
IMU.Magnetometer = magparams( ...
'MeasurementRange',200, ...
'Resolution',0.01);
reset(IMU)

[accelerometerData,magnetometerData] = IMU(accelerationNED,angularVelocityNED,orientationNED);

1-38
ecompass

orientation = ecompass(accelerometerData,magnetometerData);
orientationEuler = eulerd(orientation,'ZYX','frame');

figure(2)
plot(timeVector,orientationEuler)
legend('z-axis','y-axis','x-axis')
xlabel('Time (s)')
ylabel('Rotation (degrees)')
title('Orientation from Realistic IMU')

Input Arguments
accelerometerReading — Accelerometer readings in sensor body coordinate system (m/s2)
N-by-3 matrix

Accelerometer readings in sensor body coordinate system in m/s2, specified as an N-by-3 matrix. The
columns of the matrix correspond to the x-, y-, and z-axes of the sensor body. The rows in the matrix,
N, correspond to individual samples. The accelerometer readings are normalized before use in the
function.
Data Types: single | double

magnetometerReading — Magnetometer readings in sensor body coordinate system (µT)


N-by-3 matrix

Magnetometer readings in sensor body coordinate system in µT, specified as an N-by-3 matrix. The
columns of the matrix correspond to the x-, y-, and z-axes of the sensor body. The rows in the matrix,

1-39
1 Functions

N, correspond to individual samples. The magnetometer readings are normalized before use in the
function.
Data Types: single | double

orientationFormat — Format used to describe orientation


'quaternion' (default) | 'rotmat'

Format used to describe orientation, specified as 'quaternion' or 'rotmat'.


Data Types: char | string

Output Arguments
orientation — Orientation that rotates quantities from global coordinate system to sensor
body coordinate system
N-by-1 vector of quaternions (default) | 3-by-3-by-N array

Orientation that can rotate quantities from a global coordinate system to a body coordinate system,
returned as a vector of quaternions or an array. The size and type of the orientation depends on
the format used to describe orientation:

• 'quaternion' –– N-by-1 vector of quaternions with the same underlying data type as the input
• 'rotmat' –– 3-by-3-by-N array the same data type as the input

Data Types: quaternion | single | double

Algorithms
The ecompass function returns a quaternion or rotation matrix that can rotate quantities from a
parent (NED for example) frame to a child (sensor) frame. For both output orientation formats, the
rotation operator is determined by computing the rotation matrix.

The rotation matrix is first calculated with an intermediary:

R = (a × m) × a a × m a

and then normalized column-wise. a and m are the accelerometerReading input and the
magnetometerReading input, respectively.

To understand the rotation matrix calculation, consider an arbitrary point on the Earth and its
corresponding local NED frame. Assume a sensor body frame, [x,y,z], with the same origin.

1-40
ecompass

Recall that orientation of a sensor body is defined as the rotation operator (rotation matrix or
quaternion) required to rotate a quantity from a parent (NED) frame to a child (sensor body) frame:

R pparent = pchild

where

• R is a 3-by-3 rotation matrix, which can be interpreted as the orientation of the child frame.
• pparent is a 3-by-1 vector in the parent frame.
• pchild is a 3-by-1 vector in the child frame.

For a stable sensor body, an accelerometer returns the acceleration due to gravity. If the sensor body
is perfectly aligned with the NED coordinate system, all acceleration due to gravity is along the z-
axis, and the accelerometer reads [0 0 1]. Consider the rotation matrix required to rotate a quantity
from the NED coordinate system to a quantity indicated by the accelerometer.

1-41
1 Functions

r11 r21 r31 0 a1


r12 r22 r32 0 = a2
r13 r23 r33 1 a3

The third column of the rotation matrix corresponds to the accelerometer reading:

r31 a1
r32 = a2
r33 a3

A magnetometer reading points toward magnetic north and is in the N-D plane. Again, consider a
sensor body frame aligned with the NED coordinate system.

By definition, the E-axis is perpendicular to the N-D plane, therefore N ⨯ D = E, within some
amplitude scaling. If the sensor body frame is aligned with NED, both the acceleration vector from
the accelerometer and the magnetic field vector from the magnetometer lie in the N-D plane.
Therefore m ⨯ a = y, again with some amplitude scaling.

Consider the rotation matrix required to rotate NED to the child frame, [x y z].

r11 r21 r31 0 a1 m1


r12 r22 r32 1 = a2 × m2
r13 r23 r33 0 a3 m3

The second column of the rotation matrix corresponds to the cross product of the accelerometer
reading and the magnetometer reading:

1-42
ecompass

r21 a1 m1
r22 = a2 × m2
r23 a3 m3

By definition of a rotation matrix, column 1 is the cross product of columns 2 and 3:

r11 r21 r31


r12 = r22 × r32
r13 r23 r33
= a×m ×a

Finally, the rotation matrix is normalized column-wise:

Ri j
Ri j = , ∀j
3
∑ Ri2j
i=1

Note The ecompass algorithm uses magnetic north, not true north, for the NED coordinate system.

References
[1] Open Source Sensor Fusion. https://github.com/memsindustrygroup/Open-Source-Sensor-Fusion/
tree/master/docs

Extended Capabilities
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

See Also
quaternion | ahrsfilter | imufilter

Topics
“Determine Orientation Using Inertial Sensors”

Introduced in R2018b

1-43
1 Functions

magcal
Magnetometer calibration coefficients

Syntax
[A,b,expmfs] = magcal(D)
[A,b,expmfs] = magcal(D,fitkind)

Description
[A,b,expmfs] = magcal(D) returns the coefficients needed to correct uncalibrated
magnetometer data D.

To produce the calibrated magnetometer data C, use equation C = (D-b)*A. The calibrated data C
lies on a sphere of radius expmfs.

[A,b,expmfs] = magcal(D,fitkind) constrains the matrix A to be the type specified by


fitkind. Use this syntax when only the soft- or hard-iron effect needs to be corrected.

Examples

Correct Data Lying on Ellipsoid

Generate uncalibrated magnetometer data lying on an ellipsoid.

c = [-50; 20; 100]; % ellipsoid center


r = [30; 20; 50]; % semiaxis radii

[x,y,z] = ellipsoid(c(1),c(2),c(3),r(1),r(2),r(3),20);
D = [x(:),y(:),z(:)];

Correct the magnetometer data so that it lies on a sphere. The option for the calibration is set by
default to 'auto'.

[A,b,expmfs] = magcal(D); % calibration coefficients


expmfs % Dipaly expected magnetic field strength in uT

expmfs = 31.0723

C = (D-b)*A; % calibrated data

Visualize the uncalibrated and calibrated magnetometer data.

figure(1)
plot3(x(:),y(:),z(:),'LineStyle','none','Marker','X','MarkerSize',8)
hold on
grid(gca,'on')
plot3(C(:,1),C(:,2),C(:,3),'LineStyle','none','Marker', ...
'o','MarkerSize',8,'MarkerFaceColor','r')
axis equal
xlabel('uT')

1-44
magcal

ylabel('uT')
zlabel('uT')
legend('Uncalibrated Samples', 'Calibrated Samples','Location', 'southoutside')
title("Uncalibrated vs Calibrated" + newline + "Magnetometer Measurements")
hold off

Input Arguments
D — Raw magnetometer data
N-by-3 matrix (default)

Input matrix of raw magnetometer data, specified as a N-by-3 matrix. Each column of the matrix
corresponds to the magnetometer measurements in the first, second and third axes, respectively.
Each row of the matrix corresponds to a single three-axis measurement.
Data Types: single | double

fitkind — Matrix output type


'auto' (default) | 'eye' | 'diag' | 'sym'

Matrix type for output A. The matrix type of A can be constrained to:

• 'eye' – identity matrix


• 'diag' – diagonal

1-45
1 Functions

• 'sym' – symmetric
• 'auto' – whichever of the previous options gives the best fit

Output Arguments
A — Correction matrix for soft-iron effect
3-by-3 matrix

Correction matrix for the soft-iron effect, returned as a 3-by-3 matrix.

b — Correction vector for hard-iron effect


3-by-1 vector

Correction vector for the hard-iron effect, returned as a 3-by-1 array.

expmfs — Expected magnetic field strength


scalar

Expected magnetic filed strength, returned as a scalar.

More About
Soft- and Hard-Iron Effects

Because a magnetometer usually rotates through a full range of 3-D rotation, the ideal measurements
from a magnetometer should form a perfect sphere centered at the origin if the magnetic field is
unperturbed. However, due to distorting magnetic fields from the sensor circuit board and the
surrounding environment, the spherical magnetic measurements can be perturbed. In general, two
effects exist.

1 The soft-iron effect is described as the distortion of the ellipsoid from a sphere and the tilt of the
ellipsoid, as shown in the left figure. This effect is caused by disturbances that influence the
magnetic field but may not generate their own magnetic field. For example, metals such as nickel
and iron can cause this kind of distortion.
2 The hard-iron effect is described as the offset of the ellipsoid center from the origin. This effect is
produced by materials that exhibit a constant, additive field to the earth's magnetic field. This
constant additive offset is in addition to the soft-iron effect as shown in the figure on the right.

The underlying algorithm in magcal determines the best-fit ellipsoid to the raw sensor readings and
attempts to "invert" the ellipsoid to produce a sphere. The goal is to generate a correction matrix A to

1-46
Another Random Scribd Document
with Unrelated Content
"Speak! speak!"
"This tree, at the foot of which we are now standing, although
apparently possessing all the vigour of youth, is internally hollow, so
that only the bark stands upright. Your wife and daughter, supplied
with some provisions, will get into the tree and remain there in
safety till the danger has passed away. As for ourselves—"
"As for us," Black quickly interrupted her, "we are men accustomed
to danger: our fate is in the hands of God."
"Good; but do not despair: all is not lost yet."
The American shook his head.
"As you said yourself, what can four men do against a legion of
demons like those who menace us? But that is not the question of
the moment. I do not see the hole by which my wife and daughter
can enter the tree."
"It is twenty to twenty-four feet up, hidden among the branches and
leaves."
"The Lord be praised! they will be sheltered."
"Yes; but make haste and warn them, while your son and I make all
the preparations."
Black, convinced of the necessity of haste, ran off, while the stranger
and William constructed, with that dexterity produced by the
approach of danger, a species of handy ladder, by which the two
women could not merely ascend the tree, but go down into the
cavity. Black waked the ladies, and called the servants; in a few
words he explained to them what was passing; then, loading his wife
and daughter with provisions, furs, and other indispensable objects,
he led them to the spot where the stranger was expecting them.
"This is my most precious treasure," Black said; "if I save it, I shall
be solely indebted to you."
The two ladies began thanking their mysterious protectress; but she
imposed silence on them by a peremptory gesture.
"Presently, presently," she said; "if we escape, we shall have plenty
of time for mutual congratulations; but at this moment we have
something more important to do than exchange compliments. We
must get into a place of safety."
The two ladies fell back, quite repulsed by this rough reception,
while casting a curious and almost alarmed glance on the strange
creature. But the latter, perfectly stoical, seemed to notice nothing.
She explained in a few clear words the means she had found to
conceal them: recommended them to remain silent in the hollow
tree, and then ordered them to mount. The two ladies, after
embracing Black and his son, began resolutely ascending the rungs
of the improvised ladder. They reached in a few seconds an
enormous branch, on which they stopped, by the orders of the
stranger. Black then threw down into the interior of the tree the furs
and provisions, after which the ladder was placed inside, and the
ladies glided through the hole.
"We leave you the ladder, which is useless to us," the stranger then
said. "But be very careful not to come out till you have seen me
again; the least imprudence, under the circumstances, might cost
your lives. However, keep your minds at rest. Your imprisonment will
not be long, a few hours at the most: so be of good cheer."
The ladies once again tried to express their gratitude; but, without
listening, the stranger made Black a sign to follow her, and rapidly
descended from the tree. Aided by the Americans, she then began
removing every trace that might have revealed where the ladies
were bestowed. When the stranger had assured herself, by a final
glance, that all was in order, and nothing could betray those who
were so famously hidden, she sighed, and followed by the two men,
walked to the intrenchments.
"Now," she said, "let us watch attentively around us, for these
demons will probably crawl close up in the shadows. You are free
and honest Americans, show these accursed Indians what you can
do."
"Let them come!" Black muttered hoarsely.
"They will soon do so," she replied, and pointed to several almost
imperceptible black dots, which, however, grew larger, and were
evidently approaching the encampment.

CHAPTER VI.

THE DEFENCE OF THE CAMP.


The Redskins have a mode of fighting which foils all the methods
employed by European tactics. In order to understand their system
properly, we must, in the first place, bear in mind that the Indian
idea of honour is different from ours. This understood, the rest may
be easily admitted. The Indians, in undertaking an enterprise, have
only one object—success, and all means are good to attain it. Gifted
with incontestable courage, at times rash to an excess, stopping at
nothing, and recoiling before no difficulty—for all that, when the
success of these enterprises appears to them dubious, and that
consequently the object is missed, they retire as easily as they
advanced, not considering their honour compromised by a retreat, or
by leaving the battlefield to an enemy more powerful than
themselves, or well on his guard.
Thus, their system of fighting is most simple, and they only proceed
by surprises. The Redskins will follow the enemy's trail for entire
months with unequalled patience, never relaxing their watch for a
moment, spying him night and day, while ever careful not to be
themselves surprised: then, when the occasion at last presents itself,
and they fancy the moment arrived to execute the project, all the
chances for or against which they have so long calculated, they act
with a vigour and fury which frequently disconcert those they attack;
but if after the first onset they are repulsed—if they see that those
they attack will not let themselves be intimidated, and are prepared
to resist, then, on a given signal, they disappear as if by
enchantment, and, without any shame, begin watching again for a
more favourable moment.
Black, on the advice of the stranger, had placed himself and his party
in such positions that they could survey the prairie in every direction.
The stranger and himself were leaning on their rifles in the angle
that faced the river. The prairie at this moment presented a singular
appearance. The breeze, which at sunset had risen with a certain
strength, was gently dying out, scarce bending the tops of the great
trees. The moon, almost departed, only cast over the landscape an
uncertain and timorous gleam, which, in lieu of dissipating the
gloom, only rendered the darkness visible, through the striking
contrasts between the obscurity and the pale and fugitive rays of the
declining planet.
At times, a dull roar or sharp bark rose in the silence, and, like a
sinister appeal, reminded the emigrant that implacable and ferocious
enemies were on the watch around, although invisible. The purity of
the atmosphere was so great, that the slightest sound could be
heard for an immense distance, and it was easy to distinguish the
enormous blocks of granite that formed black dots on the ground.
"Do you know for certain that we shall be attacked this night?" the
American asked, in a low voice.
"I was present at the last council of the chiefs," the unknown replied
distinctly.
The emigrant bent on her a scrutinising glance, which she
recognised, and immediately understood; she shrugged her
shoulders disdainfully.
"Take care," she said to him, with a certain emphasis, "let not doubt
invade your mind; what interest should I have in deceiving you?"
"I know not," he replied dreamily "but I also ask myself what
interest you have in defending me?"
"None; since you place the matter on that footing, what do I care
whether your wealth is plundered, your wife, your daughter, and
yourself scalped? it is a matter of supreme indifference to me; but
must the affair be only regarded from that side? Do you imagine that
material interests have a great weight with me? If that is your
opinion, I shall withdraw, leaving you to get out of your present
position in the best way you can."
While uttering these words, she had thrown her rifle over her
shoulder, and prepared to climb over the palisade, but Black quickly
checked her.
"You do not understand me," he said; "any man in my place would
act as I do; my position is fearful, you allow it yourself; you entered
my camp, and it is impossible for me to guess how. Still, I have
hitherto put the utmost confidence in you, as you cannot deny; but I
do not know who you are, or what motive causes you to act. Your
words, far from explaining, plunge me, on the contrary, into greater
uncertainty; the safety of my entire family and all I possess is at
stake: reflect seriously on all this, and I defy you to disapprove of
my not putting utter confidence in you, although you are,
doubtlessly, deserving of it, so long as I do not know who you are."
"Yes," she answered, after a moment's reflection, "you are right, the
world is so, people must first of all give their name and quality;
egotism is so thoroughly the master over the whole surface of the
globe, that even to do a person a service, you require a certificate of
honesty, for no one will admit disinterestedness of heart,—that
aberration of generous minds, which practical people brand as
madness. Unfortunately, you must take me for what I appear, at the
risk of seeing me go away, and hence any confidence on my part
would be superfluous. You will judge me by my acts, the only proof I
can and will give you of the purity of my intentions; you are free to
accept or decline my assistance, and after all is over, you can thank
or curse me at your choice."
Black was more perplexed than ever; the stranger's explanations
only rendered the fog denser, instead of affording him light. Still, in
spite of himself, he felt himself attracted toward her. After a few
moments of serious reflection, he raised his head, struck his rifle
barrel smartly with his right hand, and looking his companion well in
the face, said in a firm voice,—
"Listen, I will no longer try to learn whether you come from God or
the devil; if you are a spy of our enemies, or our devoted friend—
events, as you said, will soon decide the question. But bear this in
mind, I will carefully watch your slightest gesture, your every word.
At the first suspicious word or movement, I will put a bullet through
your head, even if I am killed the moment after. Is that a bargain?"
The stranger began laughing.
"I accept," she said. "I recognise the Yankee in that proposition."
After this, the conversation ceased, and their entire attention was
concentrated on the prairie. The most profound calm still continued
to brood over the desert; apparently, all was in the same state as at
sunset. Still the stranger's piercing eyes distinguished on the river
bank several wild beasts flying precipitately, and others escaping
across the river, instead of continuing to drink. One of the truest
axioms in the desert is:—there can be no effect without a cause.
Everything has a reason in the prairie, all is analysed or commented
on; a leaf does not fall from a tree, a bird fly away, without the
observer knowing or guessing why it has happened.
After a few moments of profound examination, the stranger seized
the emigrant's arm, and bending down to his ear, said in a weak
voice, like the sighing of the breeze, one word which made him
tremble, as she stretched out her arm in the direction of the plain.
"Look!"
Black bent forward.
"Oh!" he said a minute after, "what is the meaning of this?"
The prairie, as we have already mentioned, was covered in several
places by blocks of granite and dead trees; singularly enough, these
black dots, at first a considerable distance from the camp, seemed
approaching insensibly, and now were only a short way from it. As it
was physically impossible for rocks and trees to move of their own
accord, there must be a cause for this, which the worthy emigrant,
whose mind was anything but subtle, cudgelled his brains in vain to
guess. This new Birnam Wood, which moved all alone, made him
excessively uncomfortable; his son and servants had also noticed the
same fact, though equally unable to account for it. Black remarked
specially that a tree he remembered perfectly well seeing that same
evening more than one hundred and fifty feet from the mound, had
suddenly come so close, that it was hardly thirty paces off. The
stranger, without evincing any emotion, whispered—
"They are the Indians!"
"The Indians?" he said, "impossible!"
She knelt behind the palisade, shouldered her rifle, and after taking
a careful aim, pulled the trigger. A flash traversed the darkness, and
at the same moment the pretended tree bounded like a deer. A
terrible yell was raised, and the Redskins appeared, rushing toward
the camp like a herd of wolves, brandishing their weapons, and
howling like demons. The Americans, very superstitious people,
reassured by seeing that they had only to deal with men, when they
feared some spell, received their enemies bravely with a rolling and
well-directed fire. Still, the Indians, probably knowing the small
number of white men, did not recoil, but pushed on boldly. The
Redskins were hardly a few yards off, and were preparing to carry
the barricades, when a shot, fired by the stranger, tolled over an
Indian ahead of the rest, at the instant he turned to his comrades to
encourage them to follow him.
The fall of this man produced an effect which the Americans, who
fancied themselves lost, were far from anticipating. As if by
enchantment, the Indians disappeared, the yells ceased, and the
deepest silence prevailed again. It might be supposed that all that
had passed was a dream. The Americans regarded each other with
amazement, not knowing to what they should attribute this sudden
retreat.
"That is incomprehensible," Black said, after assuring himself by a
hasty glance that none of his party were wounded; "can you explain
that, mistress, you, who seem to be our guardian angel, for it is to
your last shot we owe the rest we at present enjoy?"
"Ah!" she said, with a sarcastic smile, "you are beginning to do me
justice, then."
"Do not speak about that," the emigrant said, with an angry voice; "I
am a fool; pardon me, and forget my suspicions."
"I have forgotten them," she replied. "As for that which astounds
you, it is very simple. The man I killed, or, at any rate, wounded,
was an Indian chief of great reputation; on seeing him fall, his
warriors were discouraged, and they ran to carry him off the field,
lest his scalp should fall into your hands."
"Oh, oh!" Black said, with a gesture of disgust; "do these Pagans
fancy we are like themselves? No, no! I would kill them to the last
man, in self-defence, and no one could blame me for it; but as for
scalping, that is a different matter. I am an honest Virginian, without
a drop of red blood in my veins. My father's son does not commit
such infamy."
"I approve your remarks," the stranger said, in a sorrowful voice;
"scalping is a frightful torture; unfortunately, many white men on the
prairies do not think like you; they have adopted Indian fashions,
and scalp, without ceremony, the enemies they kill."
"They are wrong."
"Possibly; I am far from justifying them."
"So that," the emigrant joyfully exclaimed, "we are free from these
red devils."
"Do not rejoice yet; you will soon see them return."
"What, again?"
"They have only suspended their attack to carry off their killed and
wounded, and probably to invent some other plan, to get the better
of you."
"Oh, that will not be difficult; in spite of all our efforts, it will be
impossible for us to resist that flock of birds of prey, who rush on us
from all sides, as on a carcass. What can five rifles effect against
that legion of demons?"
"Much, if you do not despair."
"Oh, as for that, you may be easy, we will not yield an inch; we are
resolved to die at our posts."
"Your bravery pleases me," the stranger said, "perhaps all will end
better than you suppose."
"May Heaven hear you, my worthy woman."
"Let us lose no time; the Indians may return to the charge at any
moment, so let us try to be as successful this time as the first."
"I will."
"Good! Are you a man of resolution?"
"I fancy I have proved it."
"That is true. How many days' provisions have you here?"
"Four, at the least."
"That is to say, eight, if necessary."
"Pretty nearly."
"Good! Now, if you like, I will get rid of your enemies for a long
time."
"I ask nothing better."
Suddenly the war cry of the Redskins was again heard, but this time
more strident and unearthly than the first.
"It is too late!" the stranger said, sorrowfully, "All that is left is to die
bravely."
"Let us die, then; but first kill as many of these Pagans as we can,"
John Black answered. "Hurrah! my boys, for Uncle Sam!"
"Hurrah!" his comrades shouted, brandishing their weapons.
The Indians responded to this challenge by yells of rage, and the
combat recommenced, though this time it was more serious. After
rising to utter their formidable war cry, the Indians scattered, and
advanced slowly toward the camp, by crawling on the ground. When
they found in their road the stump of a tree or a bush capable of
offering them shelter, they stopped to fire an arrow or a bullet. The
new tactics adopted by their enemies disconcerted the Americans,
whose bullets were too often wasted; for, unluckily, the Indians were
almost invisible in the gloom, and, with that cunning so
characteristic of them, shook the grass so cleverly, that the deceived
emigrants did not know where to aim.
"We are lost," Black exclaimed despondingly.
"The position is indeed becoming critical; but we must not despair
yet," the stranger remarked; "one chance is left us; a very poor one,
I grant; but which I shall employ when the moment arrives. Try to
hold out in a hand-to-hand fight."
"Come," the emigrant said, shouldering his rifle, "there is one of the
devils who will not get any further."
A Blackfoot warrior, whose head rose at this moment above the
grass, had his skull fractured by the American's bullet. The Redskins
suddenly rose, and rushed, howling, on the barricade, where the
emigrants awaited them firmly. A point-blank discharge received the
Indians, and a hand-to-hand fight began. The Americans, standing
on the barricades and clubbing their rifles, dashed down every one
who came within their reach. Suddenly, at the moment when the
emigrants, overpowered by numbers, fell back a step, the stranger
rushed up the barricade, with a torch in her hand, and uttering such
a savage yell, that the combatants stopped, with a shudder. The
flame of the torch was reflected on the stranger's face, and imparted
to it a demoniac expression. She held her head high, and stretched
out her arm, with a magnificent gesture of authority.
"Back!" she shrieked. "Back, devils!"
At this extraordinary apparition, the Redskins remained for a
moment motionless, as if petrified, but then they rushed headlong
down the slope, flying, with the utmost terror. The Americans,
interested witnesses of this incomprehensible scene, gave a sigh of
relief. They were saved! Saved by a miracle! They then rushed
toward the stranger, to express their gratitude to her.
She had disappeared!
In vain did the Americans look for her everywhere; they could not
imagine whither she was gone: she seemed to have suddenly
become invisible. The torch she held in her hand, when addressing
the Indians, lay on the ground, where it still smoked; it was the only
trace she left of her presence in the emigrants' camp.
John Black and his companions lost themselves in conjectures on her
account, while dressing, as well as they could, the wounds they had
received in the engagement, when his wife and daughter suddenly
appeared in the camp. Black rushed toward them.
"How imprudent of you!" he exclaimed. "Why have you left your
hiding place, in spite of the warnings given you?"
His wife looked at him in amazement.
"We left it," she replied, "by the directions of the strange woman to
whom we are all so deeply indebted this night."
"What! have you seen her again?"
"Certainly; a few moments back she came to us; we were half dead
with terror, for the sounds of the fighting reached us, and we were
completely ignorant of what was occurring. After reassuring us, she
told us that all was over, that we had nothing more to fear, and that,
if we liked, we could rejoin you."
"But she—what did she do?"
"She led us to this spot; then, in spite of our entreaties, she went
away, saying that as we no longer needed her, her presence was
useless, while important reasons compelled her departure."
The emigrant then told the ladies all about the events of the night,
and the obligations they owed to this extraordinary female. They
listened to the narrative with the utmost attention, not knowing to
what they should attribute her strange conduct, and feeling their
curiosity aroused to the utmost pitch. Unfortunately, the peculiar
way in which the stranger had retired, did not appear to evince any
great desire on her part to establish more intimate relations with the
emigrants.
In the desert, however, there is but little time to be given to
reflections and comments; action is before all; men must live and
defend themselves. Hence Black, without losing further time in trying
to solve the riddle, occupied himself actively in repairing the
breaches made in his entrenchments, and fortifying his camp more
strongly, were that possible, by piling up on the barricades all the
articles within reach. When these first duties for the common safety
were accomplished, the emigrant thought of his cattle. He had
placed them at a spot where the bullets could not reach them, close
to the tent, into which his wife and daughter had again withdrawn,
and had surrounded them by a quantity of interlaced branches. On
entering this corral, Black uttered a cry of amazement, which was
soon changed into, a yell of fury. His son and the men ran up; the
horses and one-half the cattle had disappeared. During the fight the
Indians had carried them off, and the noise had prevented their
flight being heard. It seemed probable that the stranger's
interference, by striking the Indians with terror, had alone prevented
the robbery being completed, and the whole of the cattle carried off.
The loss was enormous to the emigrant; although all his cattle had
not disappeared, enough had been carried off to render further
progress impossible. His resolution was formed with that
promptitude so characteristic of the Northern Americans.
"Our beasts are stolen," he said; "I must have them back."
"Quite right," William answered; "at daybreak we will go on their
track."
"I, but not you, my son," the emigrant said. "Sam will go with me."
"What shall I do then?"
"Stay in the camp, to guard your mother and sister. I will leave
James with you."
The young man made no reply.
"I will not let the Pagans boast of having eaten my oxen," Black said,
wrathfully. "By my father's soul, I will get them back, or lose my
scalp!"
The night had passed away while the camp was being fortified. The
sun, though still invisible, was beginning to tinge the horizon with a
purple light.
"Ah, look!" Black continued, "here's day; let us lose no time, but set
off. I recommend your mother and sister to your care, Will, as well
as all that is here."
"You can go, father," the young man said. "I will keep good watch
during your absence; you may be easy."
The emigrant pressed his son's hand, threw his rifle, over his
shoulder, made a sign to Sam to follow him, and walked towards the
entrenchment.
"It is useless to wake your mother," he said, as he walked on; "when
she comes out of the tent, you will tell her what has occurred, and
what I have done; I am certain she will approve of it. So, good-bye,
my boy, and mind you are on the watch."
"And you, father—good luck!"
"May Heaven grant it, boy," the emigrant said, sorrowfully. "Such
splendid cattle!"
"Stay!" the young man exclaimed, holding his father back, at the
moment the latter was preparing to climb over the barricades. "What
is that I see down there?"
The emigrant turned quickly.
"Do you see anything, Will—-whereabouts?"
"Look, father, in that direction. But what is the meaning of it? It
must be our cattle."
The emigrant looked in the direction his son indicated.
"What!" he exclaimed joyfully; "why, those are our cattle. Where on
earth do they come from? And who is bringing them back?"
In fact, at a great distance on the prairie, the American's cattle were
visible, galloping rapidly in the direction of the camp, and raising a
cloud of dust behind them.

CHAPTER VII.

THE INDIAN CHIEF.


The Count de Beaulieu was far from suspecting, as he carelessly
prepared to light a cigar, that the lucifer match he employed would
at once render him so important in the sight of the Indians. But, so
soon as he recognized the power of the weapon chance placed in his
hands, he resolved to employ it, and turn to his own profit the
superstitious ignorance of the Redskins. Enjoying, in his heart, the
triumph he had obtained, the Count frowned, and employing the
language and emphatic gestures of the Indians, when he saw they
were sufficiently recovered to listen to him, he addressed them with
that commanding tone which always imposes on the masses.
"Let my brothers open their ears; the words my lips utter must be
heard and understood by all. My brothers are simple men, prone to
error; truth must enter their hearts like an iron wedge. My goodness
is great, because I am powerful; instead of chastising them when
they dared to lay hands on me, I am satisfied with displaying my
power before their eyes. I am a great physician of the pale faces; I
possess all the secrets of the most famous medicines. If I pleased,
the birds of the air and the fish of the river would come to do me
homage, because the Master of Life is within me, and has given me
his medicine rod. Listen to this, Redskins, and remember it: when
the first man was born, he walked on the banks of the Mecha-
Chebe; there he met the Master of Life: the Master of Life saluted
him, and said to him, 'Thou art my son.' 'No,' the first man made
answer, 'thou art my son, and I will prove it to thee, if thou dost not
believe me; we will sit down and plant in the earth the medicine rod
we hold in our hands; the one who rises first will be the younger,
and the son of the other.' They sat down then, and looked at each
other for a long time, until at length the Master of Life turned pale,
and the flesh left his bones; on which the first man exclaimed,
joyfully, 'At length thou art assuredly dead.' And they regarded each
other thus during ten times ten moons, and ten times more; and as
at the end of that time the bones of the Master of Life were
completely bleached, the first man rose and said, 'Yes, now there is
no more doubt; he is certainly dead.' He then took the medicine
stick of the Master of Life, and drew it from the earth. But then the
Master of Life rose, and taking the stick from him, said to him, 'Stop!
here I am; I am thy father, and thou art my son.' And the first man
recognized him as his father. But the Master of Life then added,
'Thou art my son, first man; thou can'st not die; take my medicine
staff; when I have to communicate with my Redskin sons, I will send
thee.' This is the medicine staff. Are you ready to execute my
orders?"
These words were uttered with so profound an accent of truth, the
legend related by the Count was so true and so well known by all,
that the Indians, whom the miracle of the match had already
disposed to credulity, put complete faith in it, and answered
respectfully—
"Let my father speak: what he wishes we wish. Are we not his
children?"
"Hence," the Count continued, "I wish to speak with you, chief,
alone."
Natah Otann had listened to the Count's discourse with the deepest
attention: at times, an observer might have noticed a flash of joy
cross his features, immediately followed, however, by a feeling of
pleasure, which lit up his intelligent eyes: he applauded, like his
warriors, perhaps more warmly than they, when the young man
ceased speaking; on hearing him say that he would speak with the
sachem alone, a smile played on his lips: he made the Indians a sign
to retire, and walked towards the Count with an ease and grace
which the other could not refrain from noticing. There was a native
nobility in this young chief, which pleased at the first glance, and
attracted sympathy.
After bowing respectfully, the Blackfeet warriors went down the hill,
and collected about one hundred yards from the camping place.
There were two men whom the Count's eloquence had surprised
quite as much as the Indian warriors. These were Bright-eye and
Ivon; neither of them understood a syllable, and the young man's
Indian science completely threw them out; they awaited in the
utmost anxiety the denouement of this scene, whose meaning they
could not decipher.
When left alone (for the hunter and Ivon soon also withdrew), the
Frenchman and the Indian examined each other with extreme
attention. But whatever efforts the white man made to read the
sentiments of the man he had before him, he was obliged to allow
that he had to deal with one of those superior natives, on whose
faces it is impossible to read anything, and who, under all
circumstances, are ever masters of their impressions; furthermore,
the fixity and metallic lustre of the Indian's eye caused him to feel a
secret uneasiness, which he hastened to remove by speaking, as if
that would break the charm.
"Chief," he said, "now that your warriors have retired—"
Natah Otann interrupted him by a sign, and bowed courteously.
"Pardon me, Monsieur le Comte," he said, with an accent which a
native of the banks of the Seine would have envied: "I think the
slight practice you have had in speaking our language is wearisome
to you; if you would please to express yourself in French, I fancy I
understand that language well enough to follow you."
"Eh?" the Count exclaimed, with a start of surprise, "what is that you
say?"
Had a thunderbolt fallen at the Count's feet he would not have been
more surprised and terrified than on hearing this savage, who wore
the complete costume of the Blackfeet, and whose face was painted
of four different colours, express himself so purely in French. Natah
Otann did not seem to notice his companion's agitation, but
continued coldly—
"Deign to pardon me, Monsieur le Comte, for employing terms which
must certainly have offended you by their triviality; but the few
occasions I have for speaking French in this desert must serve as an
excuse."
M. de Beaulieu was a prey to one of those surprises which grow
gradually greater. He no longer knew were he awake, or suffering
from a nightmare; what he heard seemed to him so incredible and
incomprehensible, that he could not find words to express his
feelings.
"Who on earth are you?" he exclaimed, when sufficiently master of
himself to speak.
"I!" Natah Otann remarked carelessly; "why, you see I am a poor
Indian, and nothing more."
"'Tis impossible," the young man said.
"I assure you, sir, that I have told you the exact truth. Hang it," he
added with charming frankness, "if you find me a little less—what
shall I say?—coarse, you must not consider it a crime; that results
from considerations entirely independent of my will, which I will tell
you some day, if you wish to hear them."
The Count, as we think we have said, was a man of great courage,
whom but few things could disturb; the first impression passed, he
bravely took his part; perfectly master of himself henceforth, he
frankly accepted the position which accident had so singularly made
for him.
"By Jove!" he said, with a laugh, "the meeting is a strange one, and
may reasonably surprise me; you will therefore pardon, my dear sir,
that astonishment—in extreme bad taste, I grant—which I at first
evidenced on hearing you address me as you did. I was so far from
expecting to meet, six hundred leagues from civilised countries, a
man so well bred as yourself, that I confess I at first hardly knew
what Saint to invoke."
"You flatter me, sir; believe me that I feel highly grateful for the
good opinion you are good enough to have of me; now, if you
permit, we will go back to our business."
"On my faith, I am so staggered by all that has happened, that I
really do not know what I am about."
"Nonsense, that is nothing; I will lead you back to the right track;
after the charming address you made us, you seem to desire speech
with me alone."
"Hum!" the Count said, with a smile, "I am afraid that I must have
appeared to you supremely ridiculous with my legend, especially my
remarks, but then I could not suspect that I had an auditor of your
stamp."
Natah Otann shook his head sadly; a melancholy expression for a
moment darkened his face.
"No," he said, "you acted as you were bound to do; but while you
were speaking, I was thinking of those poor Indians sunk so deeply
in error, and asking myself whether there was any hope of their
regeneration before the white men succeed in utterly destroying
them."
The chief uttered these words with such a marked accent of grief
and hatred, that the Count was moved by the thought how this man,
with a soul of fire, must suffer at the brutalization of his race.
"Courage!" he said, holding out his hand to him.
"Courage!" the Indian repeated, bitterly, though clasping the
proffered hand; "after each defeat I experienced in the struggle I
have undertaken, the man who has served as my father, and
unfortunately made me what I am, never ceases to say that to me."
There was a moment of silence; each was busied with his own
thoughts; at length Natah Otann proceeded:—
"Listen, Monsieur le Comte; between men of a certain stamp there is
a species of undefinable feeling, which attaches them to each other
in spite of themselves; for the six months your have been traversing
the desert in every direction, I have never once lost sight of you;
you would have been dead long ere this, but I spread a secret ægis
over you. Oh, do not thank me," he said, quickly, as the young man
made a sign, "I have acted rather in my own interest than yours.
What I say surprises you, I daresay, but it is so. Allow me to tell you,
that I have views with reference to yourself, whose secrets I will
unfold to you in a few days, when we know each other better; as for
the present, I will obey you in whatever you wish; in the eyes of my
countrymen, I will keep up that miraculous halo which surrounds
your brow. You wish these American emigrants to be left at peace,
very good; for your sake I pardon this race of vipers; but I ask you
one favour in return."
"Speak!"
"When you are certain the people you wish to save are in security,
accompany me to my village,—that is all I desire. That will not cost
you much, especially as my tribe is encamped not more than a day's
march from the spot where you now are."
"I accept your proposition, chief. I will accompany you wherever you
please, though not till I am certain that my protégés no longer
require my aid."
"That is agreed. Stay, one word more."
"Say it."
"It is well understood that I am only an Indian like the rest, even to
the two white men who accompany you!"
"You demand it?"
"For our common welfare: a word spoken thoughtlessly, any
indiscretion, how trifling soever, would destroy us both. Ah! you do
not know the Redskins yet," he added, with that melancholy smile
which had already given the Count so much subject for thought.
"Very good," he answered; "you may be easy; I am warned."
"Now, if you think proper, I will recall my warriors; a longer
conference between us might arouse their jealousy."
"Do so; I trust entirely to you."
"You will have no reason to repent it," Natah Otann replied,
graciously.
While the chief went to join his companions, the Count walked up to
the two white men.
"Well?" Bright-eye asked him, "have you obtained what you wanted
from that man?"
"Perfectly," he answered; "I only wished to say a few words to him."
The hunter looked at him cunningly.
"I did not think him so easy," he said.
"Why so, my friend?"
"His reputation is great in the desert; I have known him for a very
long period."
"Ah!" the young man said, not at all sorry to obtain some
information about the man who perplexed him so greatly; "what
reputation has he then?"
Bright-eye seemed to hesitate for a moment.
"Are you afraid to explain yourself clearly on that head?" the Count
asked.
"I have no reason for that; on the contrary, with the exception of
that day on which he wished to flay me alive—a slight mistake,
which I pardon with my whole heart,—our relations have always
been excellent."
"The more so," the Count said, with a laugh, "because you never
met again, to my knowledge, till this day."
"That is what I meant to say. Look you—Natah Otann, between
ourselves, is one of those Indians whom it is far more advantageous
not to see: he is like the owl—his presence always forebodes evil."
"The deuce! You trouble me greatly by speaking so, Bright-eye."
"Suppose I had said nothing, then," he answered, quickly; "for my
part, I should prefer to be silent."
"That is possible; but the little you have allowed to escape has, I
confess, so awakened my curiosity, that I should not be sorry to
learn more."
"Unfortunately, I know nothing."
"Still you spoke of his reputation—is that bad?"
"I did not say so," Bright-eye answered, with reserve. "You know, Mr.
Edward, that Indian manners are very different from ours: what is
bad to us is regarded very differently by Indians; and so—"
"So, I suppose," the Count interrupted, "Natah Otann has an
execrable reputation."
"No, I assure you; that depends upon the way in which you look at
matters."
"Good; and what is your personal opinion?"
"Oh, I, as you are aware, am only a poor fellow; still it seems to me
as if this demon of an Indian is more crafty than his whole tribe;
between ourselves, he is regarded as a sorcerer by his countrymen,
who are frightfully afraid of him."
"Is that all?"
"Nearly."
"After that," the Count said, lightly, "as he has asked me to
accompany him to his village, the few days we spend with him will
enable us to study him at our ease."
The hunter gave a start of surprise.
"You will not do so, I trust, Sir?"
"I do not see what can prevent me."
"Yourself, Sir; who, I hope, will not walk, with your eyes open, into
the lion's jaws."
"Will you explain—yes, or no?" the Count exclaimed with rising
impatience.
"Oh, what is the use of explaining?—will what I say stop you? No, I
am persuaded of that. You see, therefore, it is useless for me to say
more; besides, it is too late—the chief is returning."
The Count made a movement of ill-humour, at once suppressed; but
this movement did not escape Natah Otann, who at this moment
appeared on the plateau. The young man walked toward him.
"Well?" he asked eagerly.
"My young men consent to do what our Paleface father desires; if he
will mount his horse and follow us, he can convince himself that our
intentions are loyal."
"I follow you, chief," the Count replied, making Ivon a sign to bring
up his horse.
The Blackfeet welcomed the three hunters with unequivocal signs of
joy.
"Forward!" the young man said.
Natah Otann raised his arm. At this signal the warriors drove in their
knees, and the horses started like a hurricane. No one, who has not
witnessed it, can form an idea of an Indian chase: nothing stops the
Redskins—no obstacle is powerful enough to make them deviate
from their course; they go in a straight line, rolling like a human
whirlwind across the prairie crossing gulleys, ravines, and rocks, with
dizzy rapidity. Natah Otann, the Count, and his two companions,
were at the head of the cavalcade, closely followed by the warriors.
All at once the chief checked his horse, shouting at the top of his
voice—
"Halt!"
All obeyed, as if by enchantment: the horses stopped dead, and
remained motionless, as if their feet were planted in the ground.
"Why stop?" the Count asked; "we had better push on."
"It is useless," the chief said, calmly; "let my Pale brother look
before him."
The Count bent on his horse's neck.
"I can see nothing," he said.
"That is true," the Indian said; "I forgot that my brother has the
eyes of the Palefaces; in a few minutes he will see."
The Blackfeet anxiously collected round their chief, whom they
questioned with their glances. The latter, apparently impassive,
looked straight ahead, distinguishing in the darkness objects invisible
to all but himself. The Indians, however, had not long to wait, for
some horsemen soon came up at full speed. When they arrived near
Natah Otann's party, they stopped.
"What has happened?" the chief asked, sternly; "why are my sons
running away thus? They are not warriors I see, but timid women."
The Indians bowed their heads with humility at this reproach, but
made no answer. The chief continued—"Will no one inform us of
what has happened—why my chosen warriors are flying like
scattered antelopes—where is Long Horn?"
A warrior emerged from the ranks.
"Long Horn is dead," he said, sorrowfully.
"He was a wise and renowned warrior; he has gone to the happy
hunting grounds to hunt with the upright warriors. As he is dead,
why did not the Blackbird take the totem in his hand in his place?"
"Because the Blackbird is dead," the warrior answered, in the same
tone.
Natah Otann frowned, and his brow was contracted by the effort he
made to suppress his passion.
"Oh!" he said, bitterly, "the greathearts of the east have fought well;
their rifles carry truly. The two best chiefs of the nation have fallen,
but the Red Wolf still remained—why did he not avenge his
brothers?"
"Because he has also fallen," the warrior said, in a mournful voice.
A shudder of anger ran through the ranks.
"Wah!" Natah Otann exclaimed, with grief, "what is he also dead?"
"No; but he is dangerously wounded."
After these words there was a silence. The chief looked around him,
and then said—
"So; four Palefaces have held at bay two hundred Blackfeet warriors;
killed and wounded their bravest chiefs, and those warriors have not
taken their revenge. Ah! ah! what will the White Buffalo say when he
hears that? He will give petticoats to my sons, and make them
prepare food for the more courageous warriors, instead of sending
them on the warpath."
"The camp of the Long Knives was in our power," the Indian replied,
who had hitherto spoken for his comrades, "we already had them
down with our knees on their chests, a portion of their cattle was
carried off, and the scalps of the Palefaces were about to be
attached to our girdles, when the Evil Genius suddenly appeared in
their midst, and, by her mere appearance, changed the face of the
combat."
The chief's face became still severer at this news, which his warriors
received with unequivocal marks of terror.
"The 'Evil Genius!'" he said; "of whom is my brother speaking?"
"Of whom else can I speak to my father, save the Lying She-wolf of
the Prairies??" the Indian said, in a low voice.
"Oh! oh!" Natah Otann answered, "did my brother see the She-
wolf?"
"Yes; we assure our father," the Blackfeet shouted altogether, happy
to clear themselves from the accusation of cowardice that weighed
on them.
Natah Otann seemed to reflect for a moment.
"At what place are the cattle my brothers carried off from the Long
Knives?" he asked.
"We have brought them with us," a warrior answered, "they are
here."
"Good," Natah Otann continued, "let my brothers open their ears to
hear the words the Great Spirit breathes unto me:—the Long Knives
are protected by the She-wolf: our efforts would be useless, and my
sons would not succeed in conquering them; I will make a great
medicine to break the charm of the She-wolf when we return to our
village, but till then we must be very cunning to deceive the She-
wolf, and prevent her being on her guard. Will my sons follow the
advice of an experienced chief?"
"Let my father utter his thoughts," a warrior answered, in the name
of all, "he is very wise: we will do what he wishes: he will deceive
the She-wolf better than we can."
"Good; my sons have spoken well. This is what we will do:—We will
return to the camp of the Palefaces, and will restore them their
beasts; the Palefaces, deceived by this friendly conduct, will no
longer suspect us; when we have made the great medicine, we will
then seize their camp and all it contains, and the Lying She-wolf will
be unable to defend them. I have spoken; what do my sons think?"
"My father is very crafty," the warrior replied; "what he has said is
very good, his sons will perform it."
Natah Otann cast a glance of triumph at the Count de Beaulieu, who
admired the skill with which the chief, while appearing to reprimand
the Indians for the ill success of their enterprise, and evincing the
greatest wrath against the Americans, had succeeded in a few
minutes in inducing them to carry out his secret wishes.
"Oh! oh!" the Count murmured, aside, "this Indian is no common
man, he deserves studying."
Still, a moment of tumult had followed the chief's words. The
Blackfeet, recovered from the panic and terror which had made
them fly with the feet of gazelles, to escape speedily from the ruined
camp, where they had experienced so rude a defeat, had got off
their horses, and were engaged, some in laying on their wounds
chewed leaves of the oregano, others in collecting the cattle and
horses which they had stolen from the Palefaces, and which were
scattered about.
"Who is this Lying She-wolf of the Prairies, who inspires such horror
in these men?" the Count asked Bright-eye.
"No one knows her," the hunter answered, in a low voice, "she is a
woman whose mysterious life has hitherto foiled the most careful
attempts at investigation: she does no harm to any but the Indians,
whose implacable foe she appears to be: the Redskins affirm that
she is invulnerable, that bullets and arrows rebound from her
without doing her any injury. I have often seen her, though I have
had no opportunity of speaking with her. I believe her to be mad, for
I have seen her perform some of the wildest freaks at some
moments, though at others she appears in full possession of her
senses: in a word, she is an incomprehensible being, who leads an
extraordinary life in the heart of the prairies."
"Is she alone?"
"Always."
"You excite my curiosity to the highest degree," the Count said; "no
one, I suppose, could give me any information about this woman?"
"One person could do so, if he cared to speak."
"Who's that?"
"Natah Otann," the hunter said, in a low voice.
"That is strange," the Count muttered; "what can there be in
common between him and this woman?"
Bright-eye only answered by a significant glance.
The conversation was broken off, and at the chief's order the
Blackfeet remounted their horses.
"Forwards!" Natah Otann said, taking the head of the column again
with the Count and his companions.
The whole troop set out at a gallop in the direction of the American
camp, taking the cattle in their midst.

CHAPTER VIII.

THE EXILE.
We are compelled, for the proper comprehension of the facts that
will follow, to break off our story for a moment, in order to describe
a strange adventure which happened on the Western Prairies some
thirty odd years before our story opens.
The Indians, whom people insist so wrongly, in our opinion, in
regarding as savages, have certain customs which display a
thorough knowledge of the human heart. The Comanches, who
appear to remember that in old times they enjoyed a far advanced
civilization, have retained the largest amount of those customs which
are, certainly, stamped with originality.
One day in the month of February, which they call the Moon of the
Arriving Eagles, and in the year 1795 or 1796, a village of the Red
Cow tribe was in a state of extraordinary agitation. The hachesto, or
public speaker, mounted on the roof of a lodge, summoned the
warriors for the seventh hour of the day to the village square, near
the ark of the first man, where a grand council would be held. The
warriors asked each other in vain the purport of this unforeseen
meeting, but no one could tell them: the hachesto himself was
ignorant, and they were obliged to await the hour of assembling,
although the comments and suppositions still went on to a great
extent.
The Redskins, whom badly-informed authors represent to us as cold,
silent men, are, on the contrary, very gay, and remarkable gossips
when together. What has caused the contrary supposition is, that in
their relations with white men the Indians are, in the first place,
checked by the difficulties of the language—equally insurmountable,
by the way, for both parties—and next by the distrust which every
American native feels towards Europeans, whoever they may be,
owing to the inveterate hatred that separates the two races.
During our lengthened residence among Indian tribes we often had
opportunities for noticing what mistakes are made with respect to
the Redskins. During their long evening gossips in the villages, or
the hunting expeditions, there was a rolling fire of jokes and
witticisms, often lasting whole hours, to the great delight of the
audience, who laughed that hearty Indian laugh, without care or
afterthought, which cleaves the mouth to the ears, and draws tears
of delight,—a laugh which, for metallic resonance, can only be
compared with that of negroes, though the former is far more
spiritual than the latter, whose notes have ever something bestial
about them.
Toward the decline of day, the hour selected for the meeting, the
village square presented a most animated appearance. The warriors,
women, children, and dogs, those inseparable guests of the
Redskins, pressed round a large circle left empty in the centre for
the council fire, near which the principal chiefs of the nation
crouched ceremoniously. At a sign from an old sachem whose hair,
white as silver, fell in a cloud on his shoulders, the pipe bearer
brought in the great calumet, the stem of which he presented to
each chief in turn, while holding the bowl in the palm of his hand.
When all the chiefs had smoked, the pipe bearer turned the calumet
to the four cardinal points, while murmuring mysterious words which
no one heard; then he emptied the ash into the fire, saying aloud,—
"Chiefs, warriors, women, and children of the Red Cow, your
sachems are assembled to judge a very grave question; pray to the
Master of Life to inspire them with wise words."
Then the pipe bearer, after bowing respectfully to the chiefs,
withdrew, taking the calumet with him. The council began, and, at a
sign from the aged sachem, a chief rose, and bowing, took the
word:—
"Venerated sachems, chiefs, and warriors of my nation," he said, in a
loud voice, "the mission with which I am entrusted is painful to my
heart: listen to me indulgently, be not governed by passion; but let
justice alone preside over the severe decree which you will, perhaps,
be compelled to pronounce. The mission which I am entrusted with
is painful, I repeat; it fills my heart with sadness: I am compelled to
accuse before you two renowned chiefs belonging to two illustrious
families, who have, with equal claims, deserved well of the nation on
many occasions by rendering it signal services; these chiefs, as I
must name them before you, are the Bounding Panther, and the
Sparrow Hawk."
Welcome to our website – the perfect destination for book lovers and
knowledge seekers. We believe that every book holds a new world,
offering opportunities for learning, discovery, and personal growth.
That’s why we are dedicated to bringing you a diverse collection of
books, ranging from classic literature and specialized publications to
self-development guides and children's books.

More than just a book-buying platform, we strive to be a bridge


connecting you with timeless cultural and intellectual values. With an
elegant, user-friendly interface and a smart search system, you can
quickly find the books that best suit your interests. Additionally,
our special promotions and home delivery services help you save time
and fully enjoy the joy of reading.

Join us on a journey of knowledge exploration, passion nurturing, and


personal growth every day!

ebookbell.com

You might also like