-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.m
29 lines (23 loc) · 774 Bytes
/
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
% main script used to generate key estimation results on an entire dataset
% for a folder with many pieces, it runs for a while
clear; close;
% specify the path to dataset
% can directly test on the test_audio folder
Path = './test_audio/';
% get all file names and paths
File = dir(fullfile(Path,'*.wav'));
FileNames = {File.name}';
% write results into a text file
fileID = fopen('result_test.txt','w');
for n=1:length(FileNames)
disp(n);
f = strcat(Path, FileNames{n});
[estm, tn] = estm_key(f);
fn = split(f, "/"); fn = fn(end);
fn = split(fn, "."); fn = fn(end-1);
fn = char(fn);
gt = split(fn, "_"); gt = gt(end); % ground truth
gt = char(gt);
fprintf(fileID,'%80s %4s %4s %8f\n',fn, gt, estm, tn);
end
fclose(fileID);