update analysis script

This commit is contained in:
Thomas Dehaeze 2021-06-08 17:37:28 +02:00
parent 409efbdbc7
commit 36a2ab8f9a
2 changed files with 35 additions and 16 deletions

View File

@ -9,42 +9,52 @@ addpath('./src/');
% Test with one APA % Test with one APA
%% Load measurement data for APA number 1 %% Load measurement data for APA number 1
meas_data = {}; meas_data_lf = {};
for i = 1:6 for i = 1:6
meas_data(i) = {load(sprintf('mat/frf_data_exc_strut_%i_noise_lf.mat', i), 't', 'Va', 'Vs', 'de')}; meas_data_lf(i) = {load(sprintf('mat/frf_data_exc_strut_%i_noise_lf.mat', i), 't', 'Va', 'Vs', 'de')};
% load(sprintf('mat/frf_data_exc_strut_%i_noise_hf.mat', i), 't', 'Va', 'Vs', 'de'); meas_data_hf(i) = {load(sprintf('mat/frf_data_exc_strut_%i_noise_hf.mat', i), 't', 'Va', 'Vs', 'de')};
end end
%% %%
Ts = (meas_data{1}.t(end) - (meas_data{1}.t(1)))/(length(meas_data{1}.t)-1); Ts = (meas_data_lf{1}.t(end) - (meas_data_lf{1}.t(1)))/(length(meas_data_lf{1}.t)-1);
Fs = 1/Ts; Fs = 1/Ts;
win = hanning(ceil(1*Fs)); % Hannning Windows win = hanning(ceil(1*Fs)); % Hannning Windows
%% DVF %% DVF
[~, f] = tfestimate(meas_data{1}.Va, meas_data{1}.de, win, [], [], 1/Ts); [~, f] = tfestimate(meas_data_lf{1}.Va, meas_data_lf{1}.de, win, [], [], 1/Ts);
G_dvf = zeros(length(f), 6, 6); G_dvf_lf = zeros(length(f), 6, 6);
G_dvf_hf = zeros(length(f), 6, 6);
for i = 1:6 for i = 1:6
G_dvf(:, :, i) = tfestimate(meas_data{i}.Va, meas_data{i}.de, win, [], [], 1/Ts); G_dvf_lf(:, :, i) = tfestimate(meas_data_lf{i}.Va, meas_data_lf{i}.de, win, [], [], 1/Ts);
G_dvf_hf(:, :, i) = tfestimate(meas_data_hf{i}.Va, meas_data_hf{i}.de, win, [], [], 1/Ts);
end end
%% IFF %% IFF
[~, f] = tfestimate(meas_data{1}.Va, meas_data{1}.de, win, [], [], 1/Ts); [~, f] = tfestimate(meas_data_lf{1}.Va, meas_data_lf{1}.de, win, [], [], 1/Ts);
G_iff = zeros(length(f), 6, 6); G_iff_lf = zeros(length(f), 6, 6);
G_iff_hf = zeros(length(f), 6, 6);
for i = 1:6 for i = 1:6
G_iff(:, :, i) = tfestimate(meas_data{i}.Va, meas_data{i}.Vs, win, [], [], 1/Ts); G_iff_lf(:, :, i) = tfestimate(meas_data_lf{i}.Va, meas_data_lf{i}.Vs, win, [], [], 1/Ts);
G_iff_hf(:, :, i) = tfestimate(meas_data_hf{i}.Va, meas_data_hf{i}.Vs, win, [], [], 1/Ts);
end end
%% %%
i_lf = f < 250;
i_hf = f > 250;
figure; figure;
tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None');
ax1 = nexttile([2,1]); ax1 = nexttile([2,1]);
hold on; hold on;
for i =1:6 for i =1:6
plot(f, abs(G_dvf(:,i, i))); set(gca,'ColorOrderIndex',i)
plot(f(i_lf), abs(G_dvf_lf(i_lf,i, i)));
set(gca,'ColorOrderIndex',i)
plot(f(i_hf), abs(G_dvf_hf(i_hf,i, i)));
end end
hold off; hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
@ -54,7 +64,10 @@ hold off;
ax2 = nexttile; ax2 = nexttile;
hold on; hold on;
for i =1:6 for i =1:6
plot(f, 180/pi*angle(G_dvf(:,i, i))); set(gca,'ColorOrderIndex',i)
plot(f(i_lf), 180/pi*angle(G_dvf_lf(i_lf,i, i)));
set(gca,'ColorOrderIndex',i)
plot(f(i_hf), 180/pi*angle(G_dvf_hf(i_hf,i, i)));
end end
hold off; hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
@ -63,7 +76,7 @@ hold off;
yticks(-360:90:360); yticks(-360:90:360);
linkaxes([ax1,ax2],'x'); linkaxes([ax1,ax2],'x');
xlim([5, 5e3]); xlim([20, 2e3]);
%% %%
figure; figure;
@ -72,7 +85,10 @@ tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None');
ax1 = nexttile([2,1]); ax1 = nexttile([2,1]);
hold on; hold on;
for i =1:6 for i =1:6
plot(f, abs(G_iff(:,i, i))); set(gca,'ColorOrderIndex',i)
plot(f(i_lf), abs(G_iff_lf(i_lf,i, i)));
set(gca,'ColorOrderIndex',i)
plot(f(i_hf), abs(G_iff_hf(i_hf,i, i)));
end end
hold off; hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log');
@ -82,7 +98,10 @@ hold off;
ax2 = nexttile; ax2 = nexttile;
hold on; hold on;
for i =1:6 for i =1:6
plot(f, 180/pi*angle(G_iff(:,i, i))); set(gca,'ColorOrderIndex',i)
plot(f(i_lf), 180/pi*angle(G_iff_lf(i_lf,i, i)));
set(gca,'ColorOrderIndex',i)
plot(f(i_hf), 180/pi*angle(G_iff_hf(i_hf,i, i)));
end end
hold off; hold off;
set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin');
@ -91,4 +110,4 @@ hold off;
yticks(-360:90:360); yticks(-360:90:360);
linkaxes([ax1,ax2],'x'); linkaxes([ax1,ax2],'x');
xlim([5, 5e3]); xlim([20, 2e3]);

Binary file not shown.