diff --git a/matlab/identif_analyze_all.m b/matlab/identif_analyze_all.m index 51f7159..ca258ff 100644 --- a/matlab/identif_analyze_all.m +++ b/matlab/identif_analyze_all.m @@ -9,42 +9,52 @@ addpath('./src/'); % Test with one APA %% Load measurement data for APA number 1 -meas_data = {}; +meas_data_lf = {}; for i = 1:6 - meas_data(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_lf(i) = {load(sprintf('mat/frf_data_exc_strut_%i_noise_lf.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 %% -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; win = hanning(ceil(1*Fs)); % Hannning Windows %% 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 - 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 %% 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 - 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 %% +i_lf = f < 250; +i_hf = f > 250; + figure; tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); ax1 = nexttile([2,1]); hold on; 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 hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); @@ -54,7 +64,10 @@ hold off; ax2 = nexttile; hold on; 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 hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); @@ -63,7 +76,7 @@ hold off; yticks(-360:90:360); linkaxes([ax1,ax2],'x'); -xlim([5, 5e3]); +xlim([20, 2e3]); %% figure; @@ -72,7 +85,10 @@ tiledlayout(3, 1, 'TileSpacing', 'None', 'Padding', 'None'); ax1 = nexttile([2,1]); hold on; 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 hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'log'); @@ -82,7 +98,10 @@ hold off; ax2 = nexttile; hold on; 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 hold off; set(gca, 'XScale', 'log'); set(gca, 'YScale', 'lin'); @@ -91,4 +110,4 @@ hold off; yticks(-360:90:360); linkaxes([ax1,ax2],'x'); -xlim([5, 5e3]); \ No newline at end of file +xlim([20, 2e3]); \ No newline at end of file diff --git a/matlab/identif_measure.slx b/matlab/identif_measure.slx index 525c71e..39d36e3 100644 Binary files a/matlab/identif_measure.slx and b/matlab/identif_measure.slx differ