close all; clear all; addpath d:/users/jang/matlab/toolbox/utility addpath d:/users/jang/matlab/toolbox/sap %% load transparentWings.mat % Load pv, notePredicted, noteGt %% opt=pv2note('defaultOpt'); opt.method='simple'; opt.gtNote=noteGt; figure; notePredicted=pv2note(pv, opt, 1); %% a=note.start(:)'; m=length(a); b=noteGt.start(:)'; n=length(b); distMat=distPairwise(a, b); simMat=distMat<=0.05; [p, q]=find(simMat); if any(diff(p)==0), error('Something wrong!'); end if any(diff(q)==0), error('Something wrong!'); end %note01=noteConvert(note); %note02=noteConvert(noteGt); for i=1:length(p) % sim(i)=noteSim(note01(p(i)), note02(q(i))); sim(i)=noteSim([note.start(p(i)) note.pitch(p(i)) note.duration(p(i))], [noteGt.start(q(i)) noteGt.pitch(q(i)) noteGt.duration(q(i))]); end f1=2*sum(sim)/(m+n); fprintf('F-measure=%g\n', f1); %% The following is based on DP, which might not be necessary note=noteConvert(note); noteGt=noteConvert(noteGt); figure; [similarity, dpPath, lcsStr, dpTable]=noteVecSim(note, noteGt, [], 1);