comparison util/AMT_analysis.m @ 107:dab78a3598b6

changes to comments for couple of scripts
author Ivan Damnjanovic lnx <ivan.damnjanovic@eecs.qmul.ac.uk>
date Wed, 18 May 2011 11:50:12 +0100
parents fc395272d53e
children
comparison
equal deleted inserted replaced
85:fd1c32cda22c 107:dab78a3598b6
1 function AMT_res = AMT_analysis(Problem, solver) 1 function AMT_res = AMT_analysis(Problem, solver)
2 %%% Automatic Music Transcription results analysis 2 %%% Automatic Music Transcription results analysis
3 %
4 % Centre for Digital Music, Queen Mary, University of London.
5 % This file copyright 2009 Ivan Damnjanovic.
6 %
7 % This program is free software; you can redistribute it and/or
8 % modify it under the terms of the GNU General Public License as
9 % published by the Free Software Foundation; either version 2 of the
10 % License, or (at your option) any later version. See the file
11 % COPYING included with this distribution for more information.
12 % 3 %
13 % If wav file that is transcribed is generated from midi file (i.e. if 4 % If wav file that is transcribed is generated from midi file (i.e. if
14 % groundtruth exists) transcription is comapred to the original notes and 5 % groundtruth exists) transcription is comapred to the original notes and
15 % AMT_res structure is generated. It contains following fields: 6 % AMT_res structure is generated. It contains following fields:
16 % - tp_notes - true positive notes (notes corectly transcribed) 7 % - tp_notes - true positive notes (notes corectly transcribed)
19 % (notes that were not detected) 10 % (notes that were not detected)
20 % - fp_notes_wo_oe - false positive notes without octave erors 11 % - fp_notes_wo_oe - false positive notes without octave erors
21 % - TP - number of true positives 12 % - TP - number of true positives
22 % - FN - number of false negatives 13 % - FN - number of false negatives
23 % - FP - number of false positives 14 % - FP - number of false positives
15
16 %
17 % Centre for Digital Music, Queen Mary, University of London.
18 % This file copyright 2009 Ivan Damnjanovic.
19 %
20 % This program is free software; you can redistribute it and/or
21 % modify it under the terms of the GNU General Public License as
22 % published by the Free Software Foundation; either version 2 of the
23 % License, or (at your option) any later version. See the file
24 % COPYING included with this distribution for more information.
25 %%
24 26
25 timeOr=Problem.notesOriginal(:,5); 27 timeOr=Problem.notesOriginal(:,5);
26 noteOr=Problem.notesOriginal(:,3); 28 noteOr=Problem.notesOriginal(:,3);
27 timeTr=solver.reconstructed.notes(:,5); 29 timeTr=solver.reconstructed.notes(:,5);
28 noteTr=solver.reconstructed.notes(:,3); 30 noteTr=solver.reconstructed.notes(:,3);
46 if ~isempty(OctErr) OE=[OE; i , OctErr]; end 48 if ~isempty(OctErr) OE=[OE; i , OctErr]; end
47 end 49 end
48 end 50 end
49 51
50 AMT_res.tp_notes = [Problem.notesOriginal(Hits(:,1),[3 5]) solver.reconstructed.notes(Hits(:,2),[3 5])]; 52 AMT_res.tp_notes = [Problem.notesOriginal(Hits(:,1),[3 5]) solver.reconstructed.notes(Hits(:,2),[3 5])];
51 AMT_res.oe_notes = [Problem.notesOriginal(OE(:,1),[3 5]) solver.reconstructed.notes(OE(:,2),[3 5])]; 53 if ~isempty(OE)
54 AMT_res.oe_notes = [Problem.notesOriginal(OE(:,1),[3 5]) solver.reconstructed.notes(OE(:,2),[3 5])];
55 end
56 if isempty(OE)
57 OE=[0 0];
58 end
52 AMT_res.fn_notes_wo_oe = Problem.notesOriginal(setdiff([1:n],union(Hits(:,1),OE(:,1))),[3 5]); 59 AMT_res.fn_notes_wo_oe = Problem.notesOriginal(setdiff([1:n],union(Hits(:,1),OE(:,1))),[3 5]);
53 AMT_res.fp_notes_wo_oe = solver.reconstructed.notes(setdiff([1:m],union(Hits(:,2),OE(:,2))),[3 5]); 60 AMT_res.fp_notes_wo_oe = solver.reconstructed.notes(setdiff([1:m],union(Hits(:,2),OE(:,2))),[3 5]);
54 AMT_res.TP=size(Hits,1); 61 AMT_res.TP=size(Hits,1);
55 AMT_res.FN=n-AMT_res.TP; 62 AMT_res.FN=n-AMT_res.TP;
56 AMT_res.FP=m-AMT_res.TP; 63 AMT_res.FP=m-AMT_res.TP;