-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprofileMeasure.m
More file actions
25 lines (18 loc) · 1019 Bytes
/
Copy pathprofileMeasure.m
File metadata and controls
25 lines (18 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
function [meanHeights,stdHeights,nHeights,w] = profileMeasure(aProfile,clUmRot,maxPeriod,minFreqRatioAllow,minPeak)
%profileMeasure gets stats about the profile measurement
% maxPeriod should be adjusted to filter out low frequency features
%
% Anthony McDougal, Sungsam Kang, Zahid Yaqoob, Peter So, and Mathias Kolle, 2021
%% identify dominant frequency (according to thresholds)
[frqs1,pks1,fsampleP,fs, df] = getProfileFreq(aProfile,clUmRot,maxPeriod);
w = 1/frqs1;
%% measure peaks
%Identify peaks (according to thresholds)
%The expected spacing is the calculated period,
%with some tolerance for variability in spacing (e.g. 0.5 but adjustable), which is recorded in each data set
%and some minimum height requirement for a "peak"
minspacing = w*fs*minFreqRatioAllow;
[peakInd,troughInd] = peakMinFinder(aProfile,minspacing,minPeak);
% Calculate peak height mean and standard deviation
[meanHeights,stdHeights,nHeights] = getHeights(clUmRot,aProfile,peakInd,troughInd);
end