H-Infinity synthesis of complementary filters

Imports Necessary Python Modules

1
2
3
4
5
6
7
8
9
  import os
  from math import pi, sqrt

  import numpy as np

  import matplotlib as mpl
  import matplotlib.pyplot as plt

  from control import *
1
2
  # mpl.use('TKAgg')
  mpl.use('Agg')
1
2
  # mpl.style.use('ggplot')
  mpl.style.use('seaborn-colorblind')

Design of Weighting Function

1
2
3
4
5
  A1 = 1e-2;
  M1 = 10;
  w1 = 1*2*pi;

  W1 = tf([1, 2*w1*sqrt(A1), (w1**2)*A1], [1/M1, 2*w1/sqrt(M1), w1**2]);
1
2
3
4
5
  A2 = 1e-1;
  M2 = 100;
  w2 = 2*2*pi;

  W2 = tf([1/M2, 2*w2/sqrt(M2), w2**2], [1, 2*w2*sqrt(A2), (w2**2)*A2]);
1
2
3
4
5
  fig=plt.figure()
  bode_plot(W1, Hz=True, omega_limits=[0.01, 100.0], Plot=True, label='${W_1}^{-1}$', color='tab:blue')
  bode_plot(W2, Hz=True, omega_limits=[0.01, 100.0], Plot=True, label='${W_2}^{-1}$', color='tab:red')
  plt.legend(loc='upper right')
  plt.show(block=False)

Figure 1: Weights \(W_1\) and \(W_2\) on the complementary filters

Figure 1: Weights \(W_1\) and \(W_2\) on the complementary filters

H-Infinity Synthesis

1
2
3
4
5
6
  P = tf([[W1.den[0][0], -W1.den[0][0]],
          [[0],           W2.den[0][0]],
          [[1],           [0]]],
         [[W1.num[0][0],  W1.num[0][0]],
          [[1],           W2.num[0][0]],
          [[1],           [1]]])
1
  H2, CL, gam, rcond = hinfsyn(tf2ss(P), 1, 1)
1
0.9676461123885229
1
  H1 = 1 - H2

Obtained Complementary Filters

1
2
3
4
5
6
7
  fig=plt.figure()
  bode_plot(W1, Hz=True, omega_limits=[0.01, 100.0], Plot=True, label='${W_1}^{-1}$', color='tab:blue')
  bode_plot(W2, Hz=True, omega_limits=[0.01, 100.0], Plot=True, label='${W_2}^{-1}$', color='tab:red')
  bode_plot(H1, Hz=True, omega_limits=[0.01, 100.0], Plot=True, label='$H_1$', color='tab:blue', linestyle='--')
  bode_plot(H2, Hz=True, omega_limits=[0.01, 100.0], Plot=True, label='$H_2$', color='tab:red', linestyle='--')
  plt.legend(loc='upper right')
  plt.show(block=False)

Figure 2: Obtained complementary filters using \(\mathcal{H}_\infty\) synthesis

Figure 2: Obtained complementary filters using \(\mathcal{H}_\infty\) synthesis