In this document, the design of complementary filters is studied.
One use of complementary filter is described below:
The basic idea of a complementary filter involves taking two or more sensors, filtering out unreliable frequencies for each sensor, and combining the filtered outputs to get a better estimate throughout the entire bandwidth of the system.
To achieve this, the sensors included in the filter should complement one another by performing better over specific parts of the system bandwidth.
in section Generating 3 complementary filters, a method using the \(\mathcal{H}_\infty\) synthesis is proposed to shape three of more complementary filters
Add the Matlab code use to obtain the results presented in the paper are accessible here and presented below.
H-Infinity synthesis of complementary filters
The Matlab file corresponding to this section is accessible here.
Synthesis Architecture
We here synthesize two complementary filters using the \(\mathcal{H}_\infty\) synthesis.
The goal is to specify upper bounds on the norms of the two complementary filters \(H_1(s)\) and \(H_2(s)\) while ensuring their complementary property (\(H_1(s) + H_2(s) = 1\)).
In order to do so, we use the generalized plant shown on Figure 1 where \(W_1(s)\) and \(W_2(s)\) are weighting transfer functions that will be used to shape \(H_1(s)\) and \(H_2(s)\) respectively.
Figure 1: \(\mathcal{H}_\infty\) synthesis of the complementary filters
The \(\mathcal{H}_\infty\) synthesis applied on this generalized plant will give a transfer function \(H_2\) (Figure 1) such that the \(\mathcal{H}_\infty\) norm of the transfer function from \(w\) to \([z_1,\ z_2]\) is less than one:
\[ \left\| \begin{array}{c} (1 - H_2(s)) W_1(s) \\ H_2(s) W_2(s) \end{array} \right\|_\infty < 1 \]
Thus, if the above condition is verified, we can define \(H_1(s) = 1 - H_2(s)\) and we have that:
\[ \left\| \begin{array}{c} H_1(s) W_1(s) \\ H_2(s) W_2(s) \end{array} \right\|_\infty < 1 \]
Which is almost (with an maximum error of \(\sqrt{2}\)) equivalent to:
We then see that \(W_1(s)\) and \(W_2(s)\) can be used to shape both \(H_1(s)\) and \(H_2(s)\) while ensuring their complementary property by the definition of \(H_1(s) = 1 - H_2(s)\).
Design of Weighting Function
A formula is proposed to help the design of the weighting functions:
[H, ~, gamma, ~] = hinfsyn(P, 1, 2,'TOLGAM', 0.001, 'METHOD', 'ric', 'DISPLAY', 'on');
Resetting value of Gamma min based on D_11, D_12, D_21 terms
Test bounds: 0.1000 < gamma <= 1050.0000
gamma hamx_eig xinf_eig hamy_eig yinf_eig nrho_xy p/f
1.050e+03 3.2e+00 4.5e-13 6.3e-02 -1.2e-11 0.0000 p
525.050 3.2e+00 1.3e-13 6.3e-02 0.0e+00 0.0000 p
262.575 3.2e+00 2.1e-12 6.3e-02 -1.5e-13 0.0000 p
131.337 3.2e+00 1.1e-12 6.3e-02 -7.2e-29 0.0000 p
65.719 3.2e+00 2.0e-12 6.3e-02 0.0e+00 0.0000 p
32.909 3.2e+00 7.4e-13 6.3e-02 -5.9e-13 0.0000 p
16.505 3.2e+00 1.4e-12 6.3e-02 0.0e+00 0.0000 p
8.302 3.2e+00 1.6e-12 6.3e-02 0.0e+00 0.0000 p
4.201 3.2e+00 1.6e-12 6.3e-02 0.0e+00 0.0000 p
2.151 3.2e+00 1.6e-12 6.3e-02 0.0e+00 0.0000 p
1.125 3.2e+00 2.8e-12 6.3e-02 0.0e+00 0.0000 p
0.613 3.0e+00 -2.5e+03# 6.3e-02 0.0e+00 0.0000 f
0.869 3.1e+00 -2.9e+01# 6.3e-02 0.0e+00 0.0000 f
0.997 3.2e+00 1.9e-12 6.3e-02 0.0e+00 0.0000 p
0.933 3.1e+00 -6.9e+02# 6.3e-02 0.0e+00 0.0000 f
0.965 3.1e+00 -3.0e+03# 6.3e-02 0.0e+00 0.0000 f
0.981 3.1e+00 -8.6e+03# 6.3e-02 0.0e+00 0.0000 f
0.989 3.2e+00 -2.7e+04# 6.3e-02 0.0e+00 0.0000 f
0.993 3.2e+00 -5.7e+05# 6.3e-02 0.0e+00 0.0000 f
0.995 3.2e+00 2.2e-12 6.3e-02 0.0e+00 0.0000 p
0.994 3.2e+00 1.6e-12 6.3e-02 0.0e+00 0.0000 p
0.994 3.2e+00 1.0e-12 6.3e-02 0.0e+00 0.0000 p
Gamma value achieved: 0.9936
Obtained Complementary Filters
The obtained filters are:
1
2
3
H2=tf(H(1));H3=tf(H(2));H1=1-H2-H3;
Figure 7: The three complementary filters obtained after \(\mathcal{H}_\infty\) synthesis
Try to implement complementary filters for LIGO
The Matlab file corresponding to this section is accessible here.
Let’s try to design complementary filters that are corresponding to the complementary filters design for the LIGO and described in (Hua 2005).
The FIR complementary filters designed in (Hua 2005) are of order 512.
Specifications
The specifications for the filters are:
From \(0\) to \(0.008\text{ Hz}\),the magnitude of the filter’s transfer function should be less than or equal to \(8 \times 10^{-3}\)
From \(0.008\text{ Hz}\) to \(0.04\text{ Hz}\), it attenuates the input signal proportional to frequency cubed
Between \(0.04\text{ Hz}\) and \(0.1\text{ Hz}\), the magnitude of the transfer function should be less than 3
Above \(0.1\text{ Hz}\), the maximum of the magnitude of the complement filter should be as close to zero as possible. In our system, we would like to have the magnitude of the complementary filter to be less than \(0.1\). As the filters obtained in (Hua 2005) have a magnitude of \(0.045\), we will set that as our requirement
The specifications are translated in upper bounds of the complementary filters are shown on Figure 8.
Figure 8: Specification for the LIGO complementary filters
FIR Filter
We here try to implement the FIR complementary filter synthesis as explained in (Hua 2005).
For that, we use the CVX matlab Toolbox.
We setup the CVX toolbox and use the SeDuMi solver.
1
2
cvx_startup;cvx_solversedumi;
We define the frequency vectors on which we will constrain the norm of the FIR filter.
Finally, we compute the filter response over the frequency vector defined and the result is shown on Figure 9 which is very close to the filters obtain in (Hua 2005).
Figure 9: FIR Complementary filters obtain after convex optimization
Weights
We design weights that will be used for the \(\mathcal{H}_\infty\) synthesis of the complementary filters.
These weights will determine the order of the obtained filters.
Here are the requirements on the filters:
reasonable order
to be as close as possible to the specified upper bounds
stable minimum phase
The bode plot of the weights is shown on Figure 10.
Figure 10: Weights for the \(\mathcal{H}_\infty\) synthesis
H-Infinity Synthesis
We define the generalized plant as shown on Figure 1.
1
2
3
P=[0wL;wH-wH;10];
And we do the \(\mathcal{H}_\infty\) synthesis using the hinfsyn command.