Update matlab scripts

This commit is contained in:
Thomas Dehaeze 2021-09-01 16:50:18 +02:00
parent 946ae5f977
commit 616652f67a
7 changed files with 11 additions and 32 deletions

View File

@ -7,9 +7,6 @@ s = zpk('s');
%% Initialize Frequency Vector %% Initialize Frequency Vector
freqs = logspace(-1, 3, 1000); freqs = logspace(-1, 3, 1000);
%% Add functions to path
addpath('./src');
%% Weighting Function Design %% Weighting Function Design
% Parameters % Parameters
n = 3; w0 = 2*pi*10; G0 = 1e-3; G1 = 1e1; Gc = 2; n = 3; w0 = 2*pi*10; G0 = 1e-3; G1 = 1e1; Gc = 2;
@ -45,8 +42,8 @@ ylim([5e-4, 20]);
yticks([1e-4, 1e-3, 1e-2, 1e-1, 1, 1e1]); yticks([1e-4, 1e-3, 1e-2, 1e-1, 1, 1e1]);
%% Design of the Weighting Functions %% Design of the Weighting Functions
W1 = generateWF('n', 3, 'w0', 2*pi*10, 'G0', 1000, 'G1', 1/10, 'Gc', 0.45); W1 = generateWF('n', 3, 'w0', 2*pi*10, 'G0', 1000, 'Ginf', 1/10, 'Gc', 0.45);
W2 = generateWF('n', 2, 'w0', 2*pi*10, 'G0', 1/10, 'G1', 1000, 'Gc', 0.45); W2 = generateWF('n', 2, 'w0', 2*pi*10, 'G0', 1/10, 'Ginf', 1000, 'Gc', 0.45);
%% Plot of the Weighting function magnitude %% Plot of the Weighting function magnitude
figure; figure;

View File

@ -7,9 +7,6 @@ s = zpk('s');
%% Initialize Frequency Vector %% Initialize Frequency Vector
freqs = logspace(-3, 0, 1000); freqs = logspace(-3, 0, 1000);
%% Add functions to path
addpath('./src');
%% Upper bounds for the complementary filters %% Upper bounds for the complementary filters
figure; figure;
hold on; hold on;

View File

@ -7,12 +7,9 @@ s = zpk('s');
%% Initialize Frequency Vector %% Initialize Frequency Vector
freqs = logspace(-1, 3, 1000); freqs = logspace(-1, 3, 1000);
%% Add functions to path
addpath('./src');
%% Design of the Weighting Functions %% Design of the Weighting Functions
W1 = generateWF('n', 3, 'w0', 2*pi*10, 'G0', 1000, 'G1', 1/10, 'Gc', 0.45); W1 = generateWF('n', 3, 'w0', 2*pi*10, 'G0', 1000, 'Ginf', 1/10, 'Gc', 0.45);
W2 = generateWF('n', 2, 'w0', 2*pi*10, 'G0', 1/10, 'G1', 1000, 'Gc', 0.45); W2 = generateWF('n', 2, 'w0', 2*pi*10, 'G0', 1/10, 'Ginf', 1000, 'Gc', 0.45);
%% Generalized plant for "closed-loop" complementary filter synthesis %% Generalized plant for "closed-loop" complementary filter synthesis
P = [ W1 0 1; P = [ W1 0 1;

View File

@ -6,15 +6,10 @@ s = zpk('s');
freqs = logspace(-2, 3, 1000); freqs = logspace(-2, 3, 1000);
addpath('./src');
% Weights
% First we define the weights.
%% Design of the Weighting Functions %% Design of the Weighting Functions
W1 = generateWF('n', 2, 'w0', 2*pi*1, 'G0', 1/10, 'G1', 1000, 'Gc', 0.5); W1 = generateWF('n', 2, 'w0', 2*pi*1, 'G0', 1/10, 'Ginf', 1000, 'Gc', 0.5);
W2 = 0.22*(1 + s/2/pi/1)^2/(sqrt(1e-4) + s/2/pi/1)^2*(1 + s/2/pi/10)^2/(1 + s/2/pi/1000)^2; W2 = 0.22*(1 + s/2/pi/1)^2/(sqrt(1e-4) + s/2/pi/1)^2*(1 + s/2/pi/10)^2/(1 + s/2/pi/1000)^2;
W3 = generateWF('n', 3, 'w0', 2*pi*10, 'G0', 1000, 'G1', 1/10, 'Gc', 0.5); W3 = generateWF('n', 3, 'w0', 2*pi*10, 'G0', 1000, 'Ginf', 1/10, 'Gc', 0.5);
%% Inverse magnitude of the weighting functions %% Inverse magnitude of the weighting functions
figure; figure;
@ -32,28 +27,20 @@ xlim([freqs(1), freqs(end)]); ylim([2e-4, 1.3e1])
leg = legend('location', 'northeast', 'FontSize', 8); leg = legend('location', 'northeast', 'FontSize', 8);
leg.ItemTokenSize(1) = 18; leg.ItemTokenSize(1) = 18;
% H-Infinity Synthesis
% Then we create the generalized plant =P=.
%% Generalized plant for the synthesis of 3 complementary filters %% Generalized plant for the synthesis of 3 complementary filters
P = [W1 -W1 -W1; P = [W1 -W1 -W1;
0 W2 0 ; 0 W2 0 ;
0 0 W3; 0 0 W3;
1 0 0]; 1 0 0];
% And we do the $\mathcal{H}_\infty$ synthesis.
%% Standard H-Infinity Synthesis %% Standard H-Infinity Synthesis
[H, ~, gamma, ~] = hinfsyn(P, 1, 2,'TOLGAM', 0.001, 'METHOD', 'ric', 'DISPLAY', 'on'); [H, ~, gamma, ~] = hinfsyn(P, 1, 2,'TOLGAM', 0.001, 'METHOD', 'ric', 'DISPLAY', 'on');
% Obtained Complementary Filters %% Synthesized H2 and H3 filters
% The obtained filters are:
%%
H2 = tf(H(1)); H2 = tf(H(1));
H3 = tf(H(2)); H3 = tf(H(2));
%% H1 is defined as the complementary filter of H2 and H3
H1 = 1 - H2 - H3; H1 = 1 - H2 - H3;
%% Bode plot of the obtained complementary filters %% Bode plot of the obtained complementary filters

View File

@ -14,7 +14,8 @@
@inproceedings{dehaeze21_new_method_desig_compl_filter, @inproceedings{dehaeze21_new_method_desig_compl_filter,
author = {Dehaeze, Thomas and Vermat, Mohit and Collette, Christophe}, author = {Dehaeze, Thomas and Vermat, Mohit and Collette, Christophe},
title = {A New Method of Designing Complementary Fil}, title = {A New Method of Designing Complementary Filters for Sensor
Fusion Using the $\mathcal{H}_\infty$ Synthesis},
booktitle = {Gravitational Wave and Particle Astrophysics Detectors}, booktitle = {Gravitational Wave and Particle Astrophysics Detectors},
year = 2004, year = 2004,
volume = 5500, volume = 5500,