Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MechaRaptor - Data Processing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aerospace and Mechanical Engineering
tlambert
MechaRaptor - Data Processing
Commits
b5cba1ed
Verified
Commit
b5cba1ed
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
feat(analysis): start result analysis
parent
070f736e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
resultsanalysis.m
+44
-0
44 additions, 0 deletions
resultsanalysis.m
utils/analysis/findwingphase.m
+60
-0
60 additions, 0 deletions
utils/analysis/findwingphase.m
with
104 additions
and
0 deletions
resultsanalysis.m
0 → 100644
+
44
−
0
View file @
b5cba1ed
function
ResData
=
resultsanalysis
(
matFiles
)
% RESULTSANALYSIS Analysis of the different results obtained
% Todo
% ----------------------------------------------------------------------------------------------
% (c) Copyright 2022 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
close
all
;
clc
;
addpath
(
genpath
(
'.'
));
% Defaults and constants
persistent
matFiles_
persistent
ResData_
PLOT_RES
=
false
;
FORCE_RELOAD
=
false
;
if
(
isempty
(
matFiles_
)
||
~
strcmp
(
matFiles_
,
matFiles
))
&&
~
FORCE_RELOAD
% Load data
allFiles
=
dir
(
matFiles
);
for
iFile
=
1
:
numel
(
allFiles
)
resFile
=
fullfile
(
allFiles
(
iFile
)
.
folder
,
allFiles
(
iFile
)
.
name
);
tmp
=
load
(
resFile
);
ResData
(
iFile
,
:)
=
tmp
.
ExpData
;
end
ResData
=
rmfield
(
ResData
,
{
'arduStart'
,
'tunnelStart'
});
% Cache values to prevent excessive reloads
matFiles_
=
matFiles
;
ResData_
=
ResData
;
else
ResData
=
ResData_
;
end
idx
=
findwingphase
(
ResData
(
1
,
1
),
0
);
end
This diff is collapsed.
Click to expand it.
utils/analysis/findwingphase.m
0 → 100644
+
60
−
0
View file @
b5cba1ed
function
idx
=
findwingphase
(
ResData
,
phase
)
% FINDWINDPHASE Return the indexes where the wings are at a certain phase
% Todo
% ----------------------------------------------------------------------------------------------
% (c) Copyright 2022 University of Liege
% Author: Thomas Lambert <t.lambert@uliege.be>
% ULiege - Aeroelasticity and Experimental Aerodynamics
% MIT License
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Find flapping frequencies and period from data
trueFreq
(
1
)
=
getmainfrequency
(
ResData
.
front
.
arduShort
(:,
1
),
ResData
.
front
.
arduShort
(:,
2
));
trueFreq
(
2
)
=
getmainfrequency
(
ResData
.
aft
.
arduShort
(:,
1
),
ResData
.
aft
.
arduShort
(:,
2
));
% Determine period offset that match phase
% Find peaks in the wing angles
% Find indexes with proper phase difference
idx
=
0
;
% FIXME, proper return
end
function
trueFreq
=
getmainfrequency
(
time
,
signal
)
% GETFREQUENCIES Return the main signal frequencies
% Constants and defaults
DEBUG
=
false
;
% Signal parameters
dt
=
diff
(
time
);
sampling
=
1
/
dt
(
1
);
if
mod
(
length
(
signal
),
2
)
~=
0
signal
=
signal
(
1
:
end
-
1
);
end
nts
=
length
(
signal
);
% Fourier transform
transform
=
fft
(
signal
);
fT2
=
abs
(
transform
/
nts
);
% Two-sided spectrum
fT1
=
fT2
(
1
:
nts
/
2
+
1
);
% Single-sided spectrum
fT1
(
2
:
end
-
1
)
=
2
*
fT1
(
2
:
end
-
1
);
freq
=
sampling
*
(
0
:(
nts
/
2
))
/
nts
;
% Frequency domain
% Get main frequency
[
~
,
trueFreqIdx
]
=
max
(
fT1
);
trueFreq
=
freq
(
trueFreqIdx
);
if
DEBUG
figure
;
plot
(
freq
,
fT1
);
title
(
"Single-Sided Amplitude Spectrum of S(t)"
);
xlabel
(
"f (Hz)"
);
ylabel
(
"|P1(f)|"
);
end
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment