-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.m
66 lines (45 loc) · 1.39 KB
/
main.m
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
clc; close all;
fileList = dir('data/*.json');
numFiles = length(fileList);
filePaths = cell(numFiles, 1);
for i = 1:numFiles
filePaths{i} = fullfile(fileList(i).folder, fileList(i).name);
end
data = loadChartData(filePaths);
%---------chart settings----------
linewidth = 2;
labelsize = 8;
xlimits = [0, 50];
ylimits = [0, 50];
colorDistance = 0.2;
%--------------------------------
numLines = length(data);
legendCell = cell(numLines, 1);
figure
for i = 1:numLines
lineData = data{i};
numWords = lineData.n_spot_words;
labels = string(lineData.df(:, 1));
faVec = lineData.df(:, 3);
mdVec = lineData.df(:, 4);
x = 100 * faVec / numWords;
y = 100 * mdVec / numWords;
color = [0 0 0]+colorDistance*i; % grayscale
%loglog(x,y, 'linewidth', linewidth,'Color',color); % logarithmic scale
plot(x, y, 'linewidth', linewidth,'Color',color); % linear scale
text(x,y,labels,'VerticalAlignment','top','HorizontalAlignment','right', "FontSize", labelsize)
name = lineData.name;
eer = ceil(lineData.eer);
eerTh = round(lineData.eer_spot_threshold);
legendCell{i} = sprintf('%s (#w=%d) EER=%d%% at th=%d', name, numWords, eer, eerTh);
hold on
end
plot([0, 70],[0, 70],'--k')
xlim(xlimits);
ylim(ylimits);
title('KWS DET');
ylabel('MISSED DETECTIONS [%]');
xlabel('FALSE ALARMS [%]');
legend(legendCell);
grid on
hold off