# Kalman filter with non-white noise

Started by May 20, 2010
```Hi,

Is it possible to make the Kalman filter work with non-white measurement
noise? I have measurements which have non-zero mean, uncorrelated error.
I read about pre-whitening filters. But could not understand how to use
them in combination with Kalman Filter and the given measurements.

Thanks.

```
```On 20 Mai, 18:11, "electrical_storm"
<gauripatil24@n_o_s_p_a_m.gmail.com> wrote:
> Hi,
>
> Is it possible to make the Kalman filter work with non-white measurement
> noise?

As I understand it, the noise covariance matrix is one of
the variables to be estimated by the filter. The innovation
covariance matrix, on the other hand, seems to be diagonal
by assumption.

Rune
```
```electrical_storm wrote:
> Hi,
>
> Is it possible to make the Kalman filter work with non-white measurement
> noise? I have measurements which have non-zero mean, uncorrelated error.
> I read about pre-whitening filters. But could not understand how to use
> them in combination with Kalman Filter and the given measurements.

Basically, you model the noise process as a white noise process that
feeds a system, and you estimate the states of the system.

When you say "non-zero mean, uncorrelated error" do you mean that the
noise can be modeled as the mean, with white noise added?  If so, then
model the noise as a system with pure integrators, enough to account for
all the offsets (i.e. one if the input is only one channel), with white

Damn that sounds confusing.  Let me try again:

Say you've got a system, SISO, and the measurement noise is a constant
plus white noise.  The system model, sans noise, looks like this:

dx
-- = A * x + B * u, y_s = C * x + D * u.
dt

You want to make a Kalman filter, but your actual measured value is y =
y_s + not_white_noise, with the noise as described above.

dx   [ A 0 ]       [B]
-- = [     ] * x + [ ] * [u 0], y = [C 1] * x + white_noise + D * u
dt   [ 0 0 ]       [0]

Let me know if it's _still_ confusing.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
```
```>Basically, you model the noise process as a white noise process that
>feeds a system, and you estimate the states of the system.

>When you say "non-zero mean, uncorrelated error" do you mean that the
>noise can be modeled as the mean, with white noise added?

Exactly, the noise is gaussian with non-zero mean.

>If so, then model the noise as a system with pure integrators, enough to
account for
>all the offsets (i.e. one if the input is only one channel), with white
>
>Damn that sounds confusing.  Let me try again:
>
>Say you've got a system, SISO, and the measurement noise is a constant
>plus white noise.  The system model, sans noise, looks like this:
>
>dx
>-- = A * x + B * u, y_s = C * x + D * u.
>dt
>
>You want to make a Kalman filter, but your actual measured value is y =
>y_s + not_white_noise, with the noise as described above.
>
>
>dx   [ A 0 ]       [B]
>-- = [     ] * x + [ ] * [u 0], y = [C 1] * x + white_noise + D * u
>dt   [ 0 0 ]       [0]
>
>Let me know if it's _still_ confusing.
>

Thank you! This sounds good. I dont quite understand how the process noise
covariance matrix,say Q, should be augmented in the above scenario.
Having Q_augmented  =[Q 0]
[   ]
[0 0] wont help, if I understand correctly?

```
```electrical_storm wrote:
>> Basically, you model the noise process as a white noise process that
>> feeds a system, and you estimate the states of the system.
>
>> When you say "non-zero mean, uncorrelated error" do you mean that the
>> noise can be modeled as the mean, with white noise added?
>
> Exactly, the noise is gaussian with non-zero mean.
>
>> If so, then model the noise as a system with pure integrators, enough to
> account for
>> all the offsets (i.e. one if the input is only one channel), with white
>> noise added to the output.
>>
>> Damn that sounds confusing.  Let me try again:
>>
>> Say you've got a system, SISO, and the measurement noise is a constant
>> plus white noise.  The system model, sans noise, looks like this:
>>
>> dx
>> -- = A * x + B * u, y_s = C * x + D * u.
>> dt
>>
>> You want to make a Kalman filter, but your actual measured value is y =
>> y_s + not_white_noise, with the noise as described above.
>>
>>
>> dx   [ A 0 ]       [B]
>> -- = [     ] * x + [ ] * [u 0], y = [C 1] * x + white_noise + D * u
>> dt   [ 0 0 ]       [0]
>>
>> Let me know if it's _still_ confusing.
>>
>
> Thank you! This sounds good. I dont quite understand how the process noise
> covariance matrix,say Q, should be augmented in the above scenario.
> Having Q_augmented  =[Q 0]
>                      [   ]
>                      [0 0] wont help, if I understand correctly?
>

If the offset is absolutely, positively fixed, and if you've got all the
rest of the filter just dead nuts on, then having a zero in the lower
right corner is entirely appropriate.  If the offset evolves over time
then that zero needs to be something else; if the model that the Kalman
filter embodies doesn't match the reality perfectly (and when do the
ever?) then you need a nonzero value there, too.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
```
```So after thinking and reading a bit more, I see that the process noise
covariance matrix should have nothing to do with the bias in my measurement
noise.
So, I guess Q should be augmented similar to A.
Now as you said, if I have to model the noise as a system with pure
integrators, so should the measurement matrix, C_augmented, be [c dt] ?

Please correct me where I am wrong.

```
```electrical_storm wrote:
> So after thinking and reading a bit more, I see that the process noise
> covariance matrix should have nothing to do with the bias in my measurement
> noise.
> So, I guess Q should be augmented similar to A.
> Now as you said, if I have to model the noise as a system with pure
> integrators, so should the measurement matrix, C_augmented, be [c dt] ?
>
> Please correct me where I am wrong.

That depends...

I think it's appropriate that C_augmented = [C 1]; that gives you the
'exact' value of the offset as your state.  I can't see why one would
want to do it differently, unless one had some really peculiar purpose
in mind.

--
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
```