Skip to content
Snippets Groups Projects
Verified Commit 1e157e25 authored by Thomas Lambert's avatar Thomas Lambert :helicopter:
Browse files

feat(analysis): add comare frequencies function

parent efc03536
No related branches found
No related tags found
No related merge requests found
......@@ -4,6 +4,7 @@
*.eps
# Folders to ignore
figures/
data/wtFiles/*/*
data/arduinoFiles/*
data/ORIGINAL_RAW_DATA
......
function [allRelDiff, meanDiff, stdDiff] = comparefrequencies(ResData)
% COMAPREFREQUENCIES Compare the frequencies of the two sets (should be identical)
% Todo
% ----------------------------------------------------------------------------------------------
% (c) Copyright 2022 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
allRelDiff = zeros(size(ResData));
for i = 1:size(ResData, 1)
for j = 1:size(ResData, 2)
allFreqF(i, j) = ResData(i, j).Front.trueFreq;
allFreqA(i, j) = ResData(i, j).Aft.trueFreq;
allRelDiff(i, j) = abs(ResData(i, j).Front.trueFreq - ResData(i, j).Aft.trueFreq) / ...
ResData(i, j).Front.trueFreq;
end
end
allRelDiff = abs(allFreqF - allFreqA) ./ allFreqF;
meanDiff = mean(mean(allRelDiff));
stdDiff = mean(std(allRelDiff));
figure('Name', 'Frequency differences');
hold on;
plot(allFreqF, allFreqA, 'ok', 'MarkerFaceColor', 'k');
xlim([1.5, 3.5]);
ylim(xlim);
plot(xlim, xlim, '--');
hold off;
grid on;
xlabel('f_{aft} [Hz]');
ylabel('f_{front} [Hz]');
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment