From 616652f67ab4e1c97bbc959dfe72a2bac0bb9663 Mon Sep 17 00:00:00 2001 From: Thomas Dehaeze Date: Wed, 1 Sep 2021 16:50:18 +0200 Subject: [PATCH] Update matlab scripts --- .../1_synthesis_complementary_filters.m | 7 ++---- matlab/matlab/2_ligo_complementary_filters.m | 3 --- .../3_closed_loop_complementary_filters.m | 7 ++---- matlab/matlab/4_three_complementary_filters.m | 23 ++++--------------- matlab/matlab/{src => }/generateCF.m | 0 matlab/matlab/{src => }/generateWF.m | 0 matlab/ref.bib | 3 ++- 7 files changed, 11 insertions(+), 32 deletions(-) rename matlab/matlab/{src => }/generateCF.m (100%) rename matlab/matlab/{src => }/generateWF.m (100%) diff --git a/matlab/matlab/1_synthesis_complementary_filters.m b/matlab/matlab/1_synthesis_complementary_filters.m index e5cd655..f901319 100644 --- a/matlab/matlab/1_synthesis_complementary_filters.m +++ b/matlab/matlab/1_synthesis_complementary_filters.m @@ -7,9 +7,6 @@ s = zpk('s'); %% Initialize Frequency Vector freqs = logspace(-1, 3, 1000); -%% Add functions to path -addpath('./src'); - %% Weighting Function Design % Parameters 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]); %% Design of the Weighting Functions -W1 = generateWF('n', 3, 'w0', 2*pi*10, 'G0', 1000, 'G1', 1/10, 'Gc', 0.45); -W2 = generateWF('n', 2, 'w0', 2*pi*10, 'G0', 1/10, 'G1', 1000, '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, 'Ginf', 1000, 'Gc', 0.45); %% Plot of the Weighting function magnitude figure; diff --git a/matlab/matlab/2_ligo_complementary_filters.m b/matlab/matlab/2_ligo_complementary_filters.m index 69ed8df..2033cd1 100644 --- a/matlab/matlab/2_ligo_complementary_filters.m +++ b/matlab/matlab/2_ligo_complementary_filters.m @@ -7,9 +7,6 @@ s = zpk('s'); %% Initialize Frequency Vector freqs = logspace(-3, 0, 1000); -%% Add functions to path -addpath('./src'); - %% Upper bounds for the complementary filters figure; hold on; diff --git a/matlab/matlab/3_closed_loop_complementary_filters.m b/matlab/matlab/3_closed_loop_complementary_filters.m index a176fd6..dc9cf29 100644 --- a/matlab/matlab/3_closed_loop_complementary_filters.m +++ b/matlab/matlab/3_closed_loop_complementary_filters.m @@ -7,12 +7,9 @@ s = zpk('s'); %% Initialize Frequency Vector freqs = logspace(-1, 3, 1000); -%% Add functions to path -addpath('./src'); - %% Design of the Weighting Functions -W1 = generateWF('n', 3, 'w0', 2*pi*10, 'G0', 1000, 'G1', 1/10, 'Gc', 0.45); -W2 = generateWF('n', 2, 'w0', 2*pi*10, 'G0', 1/10, 'G1', 1000, '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, 'Ginf', 1000, 'Gc', 0.45); %% Generalized plant for "closed-loop" complementary filter synthesis P = [ W1 0 1; diff --git a/matlab/matlab/4_three_complementary_filters.m b/matlab/matlab/4_three_complementary_filters.m index 813db63..04b10d4 100644 --- a/matlab/matlab/4_three_complementary_filters.m +++ b/matlab/matlab/4_three_complementary_filters.m @@ -6,15 +6,10 @@ s = zpk('s'); freqs = logspace(-2, 3, 1000); -addpath('./src'); - -% Weights -% First we define the weights. - %% 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; -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 figure; @@ -32,28 +27,20 @@ xlim([freqs(1), freqs(end)]); ylim([2e-4, 1.3e1]) leg = legend('location', 'northeast', 'FontSize', 8); leg.ItemTokenSize(1) = 18; -% H-Infinity Synthesis -% Then we create the generalized plant =P=. - %% Generalized plant for the synthesis of 3 complementary filters P = [W1 -W1 -W1; 0 W2 0 ; 0 0 W3; 1 0 0]; - - -% And we do the $\mathcal{H}_\infty$ synthesis. - %% Standard H-Infinity Synthesis [H, ~, gamma, ~] = hinfsyn(P, 1, 2,'TOLGAM', 0.001, 'METHOD', 'ric', 'DISPLAY', 'on'); -% Obtained Complementary Filters -% The obtained filters are: - -%% +%% Synthesized H2 and H3 filters H2 = tf(H(1)); H3 = tf(H(2)); + +%% H1 is defined as the complementary filter of H2 and H3 H1 = 1 - H2 - H3; %% Bode plot of the obtained complementary filters diff --git a/matlab/matlab/src/generateCF.m b/matlab/matlab/generateCF.m similarity index 100% rename from matlab/matlab/src/generateCF.m rename to matlab/matlab/generateCF.m diff --git a/matlab/matlab/src/generateWF.m b/matlab/matlab/generateWF.m similarity index 100% rename from matlab/matlab/src/generateWF.m rename to matlab/matlab/generateWF.m diff --git a/matlab/ref.bib b/matlab/ref.bib index 94845e7..a6f3147 100644 --- a/matlab/ref.bib +++ b/matlab/ref.bib @@ -14,7 +14,8 @@ @inproceedings{dehaeze21_new_method_desig_compl_filter, 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}, year = 2004, volume = 5500,