From 0cd995a1de29cce711b6d89852c0000d3169ebaf Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Fri, 17 Feb 2006 15:59:22 +0000 Subject: [PATCH] change rocloc to return list and abs list of differences change rocloc to return list and abs list of differences --- python/aubio/onsetcompare.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python/aubio/onsetcompare.py b/python/aubio/onsetcompare.py index 7428b4ff..1cfe2af4 100644 --- a/python/aubio/onsetcompare.py +++ b/python/aubio/onsetcompare.py @@ -79,6 +79,7 @@ def onset_rocloc(ltru, lexp, eps): """ orig, expc = len(ltru), len(lexp) l = [] + labs = [] mean = 0 # if lexp is empty if expc == 0 : return orig,orig,0,0,0,0,l,mean @@ -97,11 +98,12 @@ def onset_rocloc(ltru, lexp, eps): if abs(x-y) <= eps: correspond += 1 l.append(y-x) + labs.append(abs(y-x)) if correspond == 0: bad += 1 elif correspond > 1: merged += correspond - 1 # check consistancy of the results assert ( orig - missed - merged == expc - bad - doubled) - return orig, missed, merged, expc, bad, doubled, l, sum(l)/float(max(len(l),1)) + return orig, missed, merged, expc, bad, doubled, l, labs def notes_roc (la, lb, eps): from numarray import transpose, add, resize -- 2.26.2