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

refact: minor cleanup

parent 644cc5e5
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,7 @@ function ResData = resultsanalysis(matFiles)
PLOT_RES = false;
FORCE_RELOAD = false;
OFFSET_VALUES = 0;
if (isempty(matFiles_) || ~strcmp(matFiles_, matFiles)) && ~FORCE_RELOAD
......@@ -43,10 +44,10 @@ function ResData = resultsanalysis(matFiles)
for j = 1:size(ResData, 2)
fprintf('\nFinding phase for element (%d,%d): %0.2fm, %0.2fHz, %0.1fm/s\n', ...
i, j, ResData(i, j).dx, ResData(i, j).freq, ResData(i, j).airspeed);
offsetVals = [0, 30, 60, 90, 180];
for k = 1:length(offsetVals)
ResData(i, j).Phase(k).phaseVal = offsetVals(k);
ResData(i, j).Phase(k).idx = findwingphase(ResData(i, j), offsetVals(k));
for k = 1:length(OFFSET_VALUES)
ResData(i, j).Phase(k).phaseVal = OFFSET_VALUES(k);
ResData(i, j).Phase(k).idx = findwingphase(ResData(i, j), OFFSET_VALUES(k));
end
end
end
......
......@@ -21,12 +21,7 @@ function peakRanges = findwingphase(ResData, phaseDeg)
period = 1 ./ [trueFreq(1), trueFreq(1)]; % Signal perdio, [s]
nPeriodIdx = period * sampling; % Number of indexes in a period
printColor = 1;
if any(abs(trueFreq - ResData.freq) > 0.25 * ResData.freq)
printColor = 2;
end
fprintf(printColor, ' TrueFreq = %0.2f/%0.2fHz, theory = %0.2fHz\n', ...
fprintf(' TrueFreq = %0.2f/%0.2fHz, theory = %0.2fHz\n', ...
trueFreq(1), trueFreq(2), ResData.freq);
% Determine the ranges when the two angles have the proper phase difference
......
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