At which stage should filtering be applied to the sensors data?

Shall I filter (kalman/lowpass) after getting the raw values from a sensor or after converting the raw values to a usable data? Does it matter? If so, why?

Example: Filter after getting raw values from IMU or filter after converting raw values to a usable data eg. flight dynamics parameters.

The KF estimates the robot pose based on all sensor inputs and the sensor correlation. If you do an EKF on the compass data, you'd really need the robot pose to determine how likely a given compass reading is. Without that, you are just low-pass filtering (not using a probabilistic filter like the KF).

If you filter before you put everything in the same frame, then I don't know what information you'd have to do filtering on. Since I don't know exactly what you mean by "usable" I assume you have converted all sensor data into the coordinate frame of the robot. In that case, filtering is very easy since you can put all the sensor readings directly into one EKF. In fact, this is the "normal" way to do filtering, that I'm familiar with.

Example: Let's say your IMU is attached to a robot. The IMU will be used in estimating the pose of the robot. It doesn't matter what units you use as long as the IMU is telling you something about how the robot is moving. Then you can use the corellation of the IMU to other things that measure movement, such as the compass or odometers. That is what the KF is for. The KF is not a sensor filter like a bandpass filter or something.

There is a very relevant answer here.

• I have a hard time understanding your answer. Lets say I have to convert the raw values from an IMU to Euler's Angle. So I should filter the raw data before I convert? right?
– user697
Commented Mar 22, 2013 at 18:39
• Let's say your IMU is attached to a robot. the IMU will be estimating the pose of the robot. It doesn't matter what units you use as long as the IMU is telling you something about how the robot is moving. Then you can use the corellation of the IMU to other things that measure movement, such as the compass or odometers. That is what the KF is for. The KF is not a sensor filter like a bandpass filter or something. Commented Mar 22, 2013 at 22:46
• Ahhhh! Great answer Josh! :) I got it now. Thank you!
– user697
Commented Mar 22, 2013 at 22:58

Filter the raw data.

Filtering weeds out (hopefully) most noise and errors. Raw data usually is not so useful.

Gyros drift, compasses has a lot of noise. Kalman can remove both.

• Kalman conditions the senor readings on the robot pose, then updates the robot pose. You can't filter just sensor data without knowing robot pose. Otherwise you are just smoothing the data. While smoothing is filtering, Kalman filtering is not smoothing. Commented Mar 22, 2013 at 15:01