Você está na página 1de 25

KALMAN FILTERING OF SENSOR DATA

- Nilofer Mehta

INTRODUCTION

Why do we need sensors in UbiComp?


Because we need to understand context Humans interacting with humans have a complex contextual understanding On the other hand when computers interact with humans, the complex context needs to be understood by the computer for taking accurate actions Sensors are used for this purpose

INTRODUCTION
Measured sensor data usually consists of noise which reduces accuracy In order to get accurate estimates of the true value, the sensor data needs to be filtered

FILTERING
A good filtering algorithm can eliminate noise from the data and retain useful information Various types of filters are used in UbiComp

Example: Kalman Filter Hidden Markov Model

KALMAN FILTER
It is an optimal recursive data processing algorithm Optimal depends on the criteria chosen to evaluate the performance Recursive since it does not require storage of all previous data. It also does not require the previous data to be reprocessed

KALMAN FILTER BASICS


The underlying concept of Kalman filter is a discrete time linear dynamic system This system depends on the following two equations:

Xk is the state of the system at time k. It is based on the state of the system at time k-1. Xk is simply defined by its position, velocity and acceleration.

A is in the form of a matrix. It is an operation used to calculate the current state of the system from the previous state with assumption of constant acceleration.

Zk is the measured value of the system and it relates to the calculated value Xk. In a perfect world, Zk = Xk and B is an identity matrix. But in real life applications there is always a noise factor called the Gaussian noise (vk and wk).

Kalman filter has two phases:


PREDICT Predicts the state estimate of the current time using the state estimate of the previous time. The current measured values are not considered. UPDATE Update phase combines the current time state estimate with the current measured values and updates the current state estimate.

SIMPLE EXAMPLE
Suppose we want to measure the temperature in this room. We think it is about 22 degrees 2. We also have a thermometer that gives a result within the range of 5 degrees of the true temperature. The thermometer reading shows that it is 25 degrees. What is the best estimate of the true temperature? Kalman filters use a weighted average to pick a point between our guess and the thermometers reading i.e. between 22 and 25 degrees.

CALCULATION GIVEN: Temperature variance tempvar = 22 = 4 Thermometer variance thermvar = 52 = 25 Guess G = 22 Measured M = 25

FIND: Optimal Estimate E?

CALCULATION

To calculate the optimal estimate we first calculate the weight w: w = tempvar/ (tempvar + thermvar) = 4/ (4+25) = 0.14 This means we trust our guess more than we trust the thermometer reading. w 1 means thermometer measurement is more trustworthy. w 0 means our guess is more trustworthy.

CALCULATION Now calculate the estimate: E = G + W(M G) = 22 + 0.14(25-22) = 22.42 The estimate is pretty close to our guess because we put more trust on our guess as opposed to the thermometer reading. How confident are we about our estimate? For this we need to calculate the estimate variance evar?

CALCULATION
evar = (tempvar x thermvar)/(tempvar + thermvar) = (4 x 25) / (4+25) = 3.44 The deviation in this case is 1.86

Hence, our current guess is 22.42 1.86. i.e. G = 22.42, tempvar = 1.862 In a Kalman filter, we predict and update and repeat the process as required. In this case we may take a new measurement M = 21 degrees and update our estimate.

CALCULATION BY CLASS - EQUATIONS YOU


NEED

Calculate the new weight, new estimate and new estimate variance.
w = tempvar/ (tempvar + thermvar) E = G + W(M G) evar = (tempvar x thermvar)/(tempvar + thermvar)

ANSWERS w = 3.44/ (3.44 + 25) = 0.12 E = 22.42 + 0.12(21 22.42) = 22.25 evar = (3.44 x 25)/(3.44 + 25) = 3.02

Hence, after the second measurement we update the estimate to be 22.25 1.74 degrees.

Predict

Update

APPLICATIONS OF KALMAN FILTER It was initially developed for the specific problem of spacecraft navigation for the Apollo space program Currently Kalman filter is used in many applications such as tracking object, navigation, missile tracking, healthcare, etc.

EXAMPLE

FLYPER

FLYPER Flying Performing Robot Research conducted by Dr Benjamin N. Passow at De Montfort University. It uses an Inertial Measurement Unit to maneuver the helicopter IMU consists of gyroscopes and accelerometers to report on the helicopters orientation, velocity and gravity. The data from the IMU is filtered and fused using Kalman filter

EXAMPLE- FLYPER

CONCLUSION Kalman Filter combines measured data as well as previous knowledge about the system and measuring devices to produce an optimal estimate of the desired variables. Compared to other filters Kalman filter minimizes the error significantly

QUESTIONS?

QUIZ

QUIZ RESULTS
1. 2. 3. 4.

5. 6.

Context Filtered Eliminate, Retain It requires no prior data storage except previous state estimate and current observed measurement Predict Update

Annotated Bibliography
Antoniou, Constantinos, Moshe Ben-Akiva and Haris N. Koutsopoulos. "Kalman Filter Applications for Traffic Management." n.d. July 2012. <http://cdn.intechopen.com/pdfs/10898/InTechKalman_filter_applications_for_traffic_management.pdf>. This is a very interesting research paper. It deals with real time estimation and prediction of traffic conditions. The real time traffic management model is non-linear. Since the basic assumptions of Kalman filter are derived for a linear model, this paper shows how the Kalman filter can be modified for a non-linear system. The paper discusses Extended Kalman Filter (EKF), Limiting EKF and Unscented Kalman filter all of which have various advantages for non-linear systems. Bletsas, Aggelos. "Evaluation of Kalman Filtering for Network Time Keeping." IEEE Transactions on Ultrasonics, Ferroelectrics, and Frequency Control 52.9 (2005): 1452-1460. This research paper proposes a novel Kalman Filtering algorithm for time tracking between a client computer and a server computer by sending messages as packets over the network. It evaluates this algorithm by comparing it with two other algorithms namely Linear Programming and Averaged Time Differences. It concludes that Linear Programming is better than both other filtering techniques. Kalman filter only works well when the number of packets is increased. This paper helped me understand the inapplicability of Kalman filter for certain situations. Funk, Nathan. A Study of the Kalman Filter applied to Visual Tracking. Edmonton, 7 December 2003. This project report analyzes Kalman Filter as a probabilistic prediction method for visual tracking. The author conducts a detailed literature survey to identify problems associated with Kalman Filter. The relationship between Hidden Markov Model and Kalman Filter is also described. This helps in establishing Kalman Filter as a probabilistic model. Overall, this was a well written project report. Martnez, Brbara Valenciano. Speech Enhancement using Kalman Filtering. November 2008. This project report evaluates Kalman filtering technique applied to enhance speech on a telephonic conversation. The experiments are first performed using white noise as well as colored noise. The report describes the basics of Kalman filtering and how it applies to speech filtering for both kinds of noise. It also discusses the advantages and disadvantages of the Kalman filter. This was useful for my understanding. In particular, the distinguished advantage of Kalman filter is that it optimally predicts the state of a dynamic system. One of the disadvantages of Kalman filter is that it is necessary to have previous knowledge about the system and measuring devices. The report finally concludes that using Kalman filter helps in minimizing noise overall.

Maybeck, Peter S. "Stochastic Models, Estimation, and Control, Volume 1." New York: Academic Press, 1979. 1-23. The first chapter in this book helped in understanding the basic principles of Kalman filtering. It was essential to understand how Kalman filtering works before researching its applications. This book explains Kalman filtering using an example about estimating ones location using a reference point. Passow, Benjamin N. Flyper - An Autonomous Helicopter for Intelligent Acoustic Sensing Research. n.d. July 2012. <http://www.cse.dmu.ac.uk/~benpassow/research.html>. This research describes the development of an autonomous flying robot called as FLYPER. The research shows the improvement in stability of the robot after application of the Kalman filter. The research includes a video that demonstrates the difference between the outputs from an unfiltered reading versus Kalman filtered reading for an Inertial Measurement Unit. This was useful for my seminar demonstration. Plessis, Roger Du. Poor Man's Explanation of Kalman Filtering: or How I Stopped Worrying & Learned to Love Matrix Inversion. California: North American Rockwell Electronics Group, 1967. This paper has been written with the intent of providing the most simple and intuitive explanation of the Kalman Filter. In the writers opinion, all attempts at explaining Kalman filter have gotten complicated to a certain extent. This paper helped clarify many uncertainties. The paper takes an example of estimating the resistance of a resistor. The example used in my seminar is derived from the example given in this paper with some modifications. This paper also gives a second, more complicated example later in the text. Schumitsch, Brad, et al. The Identity Management Kalman Filter. Stanford, n.d. July 2012. This paper presents a new Kalman Filter, called the Identity Management Kalman Filter (IMKF), for the purpose of tracking of multiple objects. It compares the IMKF to the multi-hypothesis Kalman filter that has been used for tracking multiple objects. Apart from the standard statistics used in the basic Kalman Filter, the IMKF maintains only an additional statistic. The paper concludes that this is much more efficient than the multi-hypothesis Kalman Filter. This was a noteworthy paper and the findings were valuable for understanding the vast scope of application of the Kalman filter.

Você também pode gostar