# LMIs in Control/pages/H2-Optimal Filter

H2-Optimal Filter

The goal of optimal filtering is to design a filter that acts on the output ${\displaystyle {\mathbf {z}}}$of the generalized plant and optimizes the transfer matrix from ${\displaystyle {\mathbf {w}}}$to the filtered output.

## The System

Consider the continuous-time generalized LTI plant, with minimal state-space representation

${\displaystyle {\mathbf {\dot {x}}}={\mathbf {Ax}}+{\mathbf {B}}_{1}{\mathbf {w}},}$

${\displaystyle {\mathbf {z}}={\mathbf {C}}_{1}{\mathbf {x}}+{\mathbf {D}}_{11}{\mathbf {w}},}$

${\displaystyle {\mathbf {y}}={\mathbf {C}}_{2}{\mathbf {x}}+{\mathbf {D}}_{21}{\mathbf {w}},}$

where it is assumed that ${\displaystyle {\mathbf {A}}}$ is Hurwitz. A continuous-time dynamic LTI filter with state-space representation

${\displaystyle {\mathbf {\dot {x}}}_{f}={\mathbf {A}}_{f}{\mathbf {x}}_{f}+{\mathbf {B}}_{f}{\mathbf {y}},}$

${\displaystyle {\mathbf {\hat {z}}}={\mathbf {C}}_{f}{\mathbf {x}}_{f}+{\mathbf {D}}_{f}{\mathbf {y}},}$

is designed to optimize the transfer function from ${\displaystyle {\mathbf {w}}}$ to ${\displaystyle {\mathbf {\tilde {z}}}={\mathbf {z}}-{\mathbf {\hat {z}}}}$ , which is given by

${\displaystyle {\tilde {\mathbf {P}}}(s)={\tilde {\mathbf {C}}}_{1}(s{\mathbf {I}}-{\tilde {\mathbf {A}}})^{-1}{\tilde {\mathbf {B}}}_{1}+{\tilde {\mathbf {D}}}_{11},}$

where

${\displaystyle {\tilde {\mathbf {A}}}={\begin{bmatrix}{\mathbf {A}}&{\mathbf {0}}\\{\mathbf {B}}_{f}{\mathbf {C}}_{2}&{\mathbf {A}}_{f}\end{bmatrix}},}$

${\displaystyle {\tilde {\mathbf {B}}}_{1}={\begin{bmatrix}{\mathbf {B}}_{1}\\{\mathbf {B}}_{f}{\mathbf {D}}_{21}\end{bmatrix}},}$

${\displaystyle {\tilde {\mathbf {C}}}_{1}={\begin{bmatrix}{\mathbf {C}}_{1}-{\mathbf {D}}_{f}{\mathbf {C}}_{2}&-{\mathbf {C}}_{f}\end{bmatrix}},}$

${\displaystyle {\tilde {\mathbf {D}}}_{11}={\mathbf {D}}_{11}-{\mathbf {D}}_{f}{\mathbf {D}}_{21}.}$

Optimal Filtering seeks to minimize the given norm of the transfer function ${\displaystyle {\tilde {\mathbf {P}}}(s).}$ There are two methods of synthesizing the H2-optimal filter.

## Synthesis 1

Solve for ${\displaystyle {\mathbf {A}}_{n}\in \mathbb {R} ^{n_{x}\times n_{x}},{\mathbf {B}}_{n}\in \mathbb {R} ^{n_{x}\times n_{y}},{\mathbf {C}}_{f}\in \mathbb {R} ^{n_{z}\times n_{x}},{\mathbf {D}}_{f}\in \mathbb {R} ^{n_{z}\times n_{y}},{\mathbf {X,Y}}\in \S ^{n_{x}},{\mathbf {Z}}\in \S ^{n_{z}},}$ and ${\displaystyle \nu \in \mathbb {R} _{>0}}$  that minimize the objective function ${\displaystyle J(\nu )=\nu }$ , subject to

${\displaystyle {\mathbf {X,Y,Z}}>0,}$

${\displaystyle {\mathbf {Y}}-{\mathbf {X}}>0,}$

${\displaystyle tr({\mathbf {Z}})<\nu ,}$

${\displaystyle {\mathbf {D}}_{11}-{\mathbf {D}}_{f}{\mathbf {D}}_{21}={\mathbf {0}},}$

${\displaystyle {\begin{bmatrix}-{\mathbf {Z}}&{\mathbf {C}}_{1}-{\mathbf {D}}_{f}{\mathbf {C}}_{2}&-{\mathbf {C}}_{f}\\*&-{\mathbf {Y}}&-{\mathbf {X}}\\*&*&-{\mathbf {X}}\end{bmatrix}}<0,}$

${\displaystyle {\begin{bmatrix}{\mathbf {YA}}+{\mathbf {A}}^{T}{\mathbf {Y}}+{\mathbf {B}}_{n}{\mathbf {C}}_{2}+{\mathbf {C}}_{2}^{T}{\mathbf {B}}_{n}^{T}&{\mathbf {A}}_{n}+{\mathbf {C}}_{2}^{T}{\mathbf {B}}_{n}^{T}+{\mathbf {A}}^{T}{\mathbf {X}}&{\mathbf {YB}}_{1}+{\mathbf {B}}_{n}{\mathbf {D}}_{21}\\*&{\mathbf {A}}_{n}+{\mathbf {A}}_{n}^{T}&{\mathbf {XB}}_{1}+{\mathbf {B}}_{n}{\mathbf {D}}_{21}\\*&*&-{\mathbf {I}}\end{bmatrix}}<0.}$

## Synthesis 2

Synthesis 2 is identical to Synthesis 1, with the exception of the final two matrix inequality constraints:

${\displaystyle {\begin{bmatrix}-{\mathbf {Z}}&{\mathbf {B}}_{1}^{T}{\mathbf {Y}}^{T}+{\mathbf {D}}_{21}^{T}{\mathbf {B}}_{n}^{T}&{\mathbf {B}}_{1}^{T}{\mathbf {X}}^{T}+{\mathbf {D}}_{21}^{T}{\mathbf {B}}_{n}^{T}\\*&-{\mathbf {Y}}&-{\mathbf {X}}\\*&*&-{\mathbf {X}}\end{bmatrix}}<0,}$

${\displaystyle {\begin{bmatrix}{\mathbf {YA}}+{\mathbf {A}}^{T}{\mathbf {Y}}+{\mathbf {B}}_{n}{\mathbf {C}}_{2}+{\mathbf {C}}_{2}^{T}{\mathbf {B}}_{n}^{T}&{\mathbf {A}}_{n}+{\mathbf {C}}_{2}^{T}{\mathbf {B}}_{n}^{T}+{\mathbf {A}}^{T}{\mathbf {X}}&{\mathbf {C}}_{1}^{T}-{\mathbf {C}}_{2}^{T}{\mathbf {D}}_{f}^{T}\\*&{\mathbf {A}}_{n}+{\mathbf {A}}_{n}^{T}&-{\mathbf {C}}_{f}^{T}\\*&*&-{\mathbf {I}}\end{bmatrix}}<0.}$

## Remark

In both cases, if ${\displaystyle {\mathbf {D}}_{11}=0}$ and ${\displaystyle {\mathbf {D}}_{21}\neq 0,}$ then it is often simplest to choose ${\displaystyle {\mathbf {D}}_{f}=0}$ in order to satisfy the equality constraint (above).

## Conclusion

In both cases, the optimal H2 filter is recovered by the state-space matrices ${\displaystyle {\mathbf {A}}_{f}={\mathbf {X}}^{-1}{\mathbf {A}}_{n},{\mathbf {B}}_{f}={\mathbf {X}}^{-1}{\mathbf {B}}_{n},{\mathbf {C}}_{f},}$ and ${\displaystyle {\mathbf {D}}_{f}.}$

## Remark

The problem of optimal filtering can alternatively be formulated as a special case of synthesizing a dynamic output "feedback" controller for the generalized plant given by

${\displaystyle {\mathbf {\dot {x}}}={\mathbf {Ax}}+{\mathbf {B}}_{1}{\mathbf {w}},}$

${\displaystyle {\mathbf {z}}={\mathbf {C}}_{1}{\mathbf {x}}+{\mathbf {D}}_{11}{\mathbf {w}}-{\mathbf {u}},}$

${\displaystyle {\mathbf {y}}={\mathbf {C}}_{2}{\mathbf {x}}+{\mathbf {D}}_{21}{\mathbf {w}}.}$

The synthesis methods presented in this page take advantage of the fact that the controller in this case is not a true feedback controller, as it only appears as a feedthrough term in the performance channel.