simSequence

Similarity between 2 sequences (e.g., for beat tracking)

Contents

Syntax

Description

This function is often used to evaluate the similarity between two time sequences, for instance, beat positions generated from beat tracking of audio music.

f=simSequence(computed, gt, tolerance) returns the F-measure of two sequences (computed, gt) with the given tolerance.

f=simSequence(computed, gt, tolerance, 1) also plots the sequences for visualization.

[f, p, r, accuracy, tpCount, fpCount, fnCount]=simSequence(...) returns more info:

Example

gt=[1 2 3 4 5];
computed=[0.5 1.86 2.1 3.1 4.5 5 6];
tolerance=0.15;
[f, p, r, accuracy, tp, fp, fn]=simSequence(computed, gt, tolerance, 1);
fprintf('Precision = tp/(tp+fp)=%d/(%d+%d) = %f\n', tp, tp, fp, p);
fprintf('Recall = tp/(tp+fn)=%d/(%d+%d) = %f\n', tp, tp, fn, r);
fprintf('F-measure = tp/(tp+(fn+fp)/2)=%d/(%d+(%d+%d)/2) = %f\n', tp, tp, fn, fp, f);
fprintf('Accuracy = tp/(tp+fn+fp)=%d/(%d+%d+%d) = %f\n', tp, tp, fn, fp, accuracy);
Precision = tp/(tp+fp)=3/(3+4) = 0.428571
Recall = tp/(tp+fn)=3/(3+2) = 0.600000
F-measure = tp/(tp+(fn+fp)/2)=3/(3+(2+4)/2) = 0.500000
Accuracy = tp/(tp+fn+fp)=3/(3+2+4) = 0.333333

Top page   Next: simCos.m   Prev:srcEval.m