-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakePeakPlot.m
More file actions
32 lines (21 loc) · 801 Bytes
/
makePeakPlot.m
File metadata and controls
32 lines (21 loc) · 801 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
26
27
28
29
30
31
32
function makePeakPlot(data,peakIdxGroup,toPlot)
%makes peak plot (data, with lines, colored differently for different
%templates)
%Inputs:
%data -> 1-D sounds trace
%peakIdxGroup -> L x 1 cell array of peak values outputted from
% createTemplates.m
%toPlot -> 1-D array of the templates to plot (i.e. [1 3 4 5])
cs = 'r--k--g--m--c--r-.k-.g-.m-.c-.r-*k-*g-*m--c-*r-^k-^g-^m-^c-^';
highVal = ceil(max(data)*2)/2;
lowVal = floor(min(data)*2)/2;
L = length(toPlot);
plot(data,'b-');
hold on
for i=1:L
j = toPlot(i);
for k=1:length(peakIdxGroup{j})
plot([peakIdxGroup{j}(k) peakIdxGroup{j}(k)],[lowVal highVal],cs(3*i-2:3*i))
end
end
hold off