Home

ComplementaryFilter

A complementary filter is a simple sensor fusion method used to combine measurements from two sensors with complementary frequency characteristics to estimate a quantity such as orientation or angle. It leverages the strengths of each sensor: one provides accurate low-frequency information, while the other supplies high-frequency information, producing a more robust estimate than either sensor alone.

In attitude estimation for inertial measurement units, a common use is to fuse gyroscope data with accelerometer

Variants may implement the filter in Euler angles or quaternions, and can be extended to 2D or

data.
The
standard
form
for
a
one-dimensional
angle
estimate
is:
angle_hat_k
=
alpha
*
(angle_hat_{k-1}
+
gyro_rate_k
*
dt)
+
(1
-
alpha)
*
angle_accel_k.
Here
angle_accel_k
is
derived
from
accelerometer
measurements
(for
example,
pitch
or
roll
from
arctan
relationships),
gyro_rate_k
is
the
angular
rate
from
the
gyroscope,
dt
is
the
time
step,
and
alpha
(0
<
alpha
<
1)
weights
the
contribution
of
the
integrated
gyro
signal
versus
the
accelerometer
measurement.
A
high
alpha
favors
the
gyro
(good
for
fast
motion
but
prone
to
drift),
while
a
low
alpha
favors
the
accelerometer
(stable
orientation
reference
but
noisy
during
dynamics).
3D
but
retain
the
same
principle
of
combining
a
high-pass
(gyroscope)
and
a
low-pass
(accelerometer)
term.
Complementary
filters
are
valued
for
their
simplicity
and
low
computational
cost
but
can
be
sensitive
to
non-gravitational
accelerations
and
require
careful
tuning
of
alpha.