├── doc
└── html
│ ├── bc_s.png
│ ├── bdwn.png
│ ├── open.png
│ ├── closed.png
│ ├── doxygen.png
│ ├── ftv2cl.png
│ ├── ftv2doc.png
│ ├── ftv2mo.png
│ ├── ftv2ns.png
│ ├── nav_f.png
│ ├── nav_g.png
│ ├── nav_h.png
│ ├── sync_on.png
│ ├── tab_a.png
│ ├── tab_b.png
│ ├── tab_h.png
│ ├── tab_s.png
│ ├── ftv2blank.png
│ ├── ftv2link.png
│ ├── ftv2mnode.png
│ ├── ftv2node.png
│ ├── ftv2pnode.png
│ ├── sync_off.png
│ ├── ftv2lastnode.png
│ ├── ftv2splitbar.png
│ ├── ftv2vertline.png
│ ├── search
│ ├── close.png
│ ├── mag_sel.png
│ ├── search_l.png
│ ├── search_m.png
│ ├── search_r.png
│ ├── namespaces_62.js
│ ├── all_61.js
│ ├── functions_61.js
│ ├── functions_67.js
│ ├── functions_70.js
│ ├── all_6d.js
│ ├── variables_6d.js
│ ├── variables_70.js
│ ├── functions_69.js
│ ├── variables_66.js
│ ├── variables_64.js
│ ├── variables_69.js
│ ├── pages_62.js
│ ├── all_65.js
│ ├── all_70.js
│ ├── functions_65.js
│ ├── functions_62.js
│ ├── functions_64.js
│ ├── all_69.js
│ ├── functions_66.js
│ ├── all_64.js
│ ├── nomatches.html
│ ├── all_66.js
│ ├── functions_63.js
│ ├── all_62.js
│ ├── variables_63.js
│ ├── all_61.html
│ ├── all_62.html
│ ├── all_63.html
│ ├── all_64.html
│ ├── all_65.html
│ ├── all_66.html
│ ├── all_67.html
│ ├── all_69.html
│ ├── all_6d.html
│ ├── all_70.html
│ ├── pages_62.html
│ ├── functions_61.html
│ ├── functions_62.html
│ ├── functions_63.html
│ ├── functions_64.html
│ ├── functions_65.html
│ ├── functions_66.html
│ ├── functions_67.html
│ ├── functions_69.html
│ ├── functions_70.html
│ ├── namespaces_62.html
│ ├── variables_63.html
│ ├── variables_64.html
│ ├── variables_66.html
│ ├── variables_67.html
│ ├── variables_69.html
│ ├── variables_6d.html
│ ├── variables_70.html
│ ├── variables_67.js
│ ├── all_67.js
│ ├── all_63.js
│ ├── search.css
│ └── search.js
│ ├── ftv2folderopen.png
│ ├── ftv2mlastnode.png
│ ├── ftv2plastnode.png
│ ├── ftv2folderclosed.png
│ ├── tabs.css
│ ├── dynsections.js
│ ├── pages.html
│ ├── namespaces.html
│ ├── md__r_e_a_d_m_e.html
│ ├── index.html
│ ├── namespacemembers_func.html
│ ├── namespacemembers_vars.html
│ └── namespacemembers.html
├── tests
├── main.cpp
├── CMakeLists.txt
├── TestSignals.h
├── TestHelpers.h
├── TestSignals.cpp
├── Test_PScore.cpp
├── Test_Continuity.cpp
├── Test_FMeasure.cpp
└── Test_CemgilAccuracy.cpp
├── python-module
├── example.py
├── INSTALL.md
├── setup.py
└── beat_tracking_evaluation_toolbox_python_module.cpp
├── src
├── CMakeLists.txt
└── BeatTrackingEvaluationToolbox.h
├── .gitignore
├── CMakeLists.txt
├── LICENSE.txt
└── README.md
/doc/html/bc_s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/bc_s.png
--------------------------------------------------------------------------------
/doc/html/bdwn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/bdwn.png
--------------------------------------------------------------------------------
/doc/html/open.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/open.png
--------------------------------------------------------------------------------
/doc/html/closed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/closed.png
--------------------------------------------------------------------------------
/doc/html/doxygen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/doxygen.png
--------------------------------------------------------------------------------
/doc/html/ftv2cl.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2cl.png
--------------------------------------------------------------------------------
/doc/html/ftv2doc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2doc.png
--------------------------------------------------------------------------------
/doc/html/ftv2mo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2mo.png
--------------------------------------------------------------------------------
/doc/html/ftv2ns.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2ns.png
--------------------------------------------------------------------------------
/doc/html/nav_f.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/nav_f.png
--------------------------------------------------------------------------------
/doc/html/nav_g.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/nav_g.png
--------------------------------------------------------------------------------
/doc/html/nav_h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/nav_h.png
--------------------------------------------------------------------------------
/doc/html/sync_on.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/sync_on.png
--------------------------------------------------------------------------------
/doc/html/tab_a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/tab_a.png
--------------------------------------------------------------------------------
/doc/html/tab_b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/tab_b.png
--------------------------------------------------------------------------------
/doc/html/tab_h.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/tab_h.png
--------------------------------------------------------------------------------
/doc/html/tab_s.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/tab_s.png
--------------------------------------------------------------------------------
/doc/html/ftv2blank.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2blank.png
--------------------------------------------------------------------------------
/doc/html/ftv2link.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2link.png
--------------------------------------------------------------------------------
/doc/html/ftv2mnode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2mnode.png
--------------------------------------------------------------------------------
/doc/html/ftv2node.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2node.png
--------------------------------------------------------------------------------
/doc/html/ftv2pnode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2pnode.png
--------------------------------------------------------------------------------
/doc/html/sync_off.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/sync_off.png
--------------------------------------------------------------------------------
/doc/html/ftv2lastnode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2lastnode.png
--------------------------------------------------------------------------------
/doc/html/ftv2splitbar.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2splitbar.png
--------------------------------------------------------------------------------
/doc/html/ftv2vertline.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2vertline.png
--------------------------------------------------------------------------------
/doc/html/search/close.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/search/close.png
--------------------------------------------------------------------------------
/tests/main.cpp:
--------------------------------------------------------------------------------
1 | #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN
2 | #define DOCTEST_CONFIG_COLORS_NONE
3 | #include "doctest.h"
4 |
--------------------------------------------------------------------------------
/doc/html/ftv2folderopen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2folderopen.png
--------------------------------------------------------------------------------
/doc/html/ftv2mlastnode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2mlastnode.png
--------------------------------------------------------------------------------
/doc/html/ftv2plastnode.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2plastnode.png
--------------------------------------------------------------------------------
/doc/html/search/mag_sel.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/search/mag_sel.png
--------------------------------------------------------------------------------
/doc/html/ftv2folderclosed.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/ftv2folderclosed.png
--------------------------------------------------------------------------------
/doc/html/search/search_l.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/search/search_l.png
--------------------------------------------------------------------------------
/doc/html/search/search_m.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/search/search_m.png
--------------------------------------------------------------------------------
/doc/html/search/search_r.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/adamstark/Beat-Tracking-Evaluation-Toolbox/HEAD/doc/html/search/search_r.png
--------------------------------------------------------------------------------
/python-module/example.py:
--------------------------------------------------------------------------------
1 | import beat_tracking_evaluation_toolbox as beatEval
2 |
3 | print beatEval.evaluate ([5.,6.,7.,8.],[5.5,6.,6.5,7.,7.5,8.1])
--------------------------------------------------------------------------------
/doc/html/search/namespaces_62.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['beat_5fevaluation_5ftoolbox',['beat_evaluation_toolbox',['../namespacebeat__evaluation__toolbox.html',1,'']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/all_61.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['amlcem',['amlCem',['../namespacebeat__evaluation__toolbox.html#ad11ed1fc11e026683cbe91de13f42b3a',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/functions_61.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['amlcem',['amlCem',['../namespacebeat__evaluation__toolbox.html#ad11ed1fc11e026683cbe91de13f42b3a',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/functions_67.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['gotoacc',['gotoAcc',['../namespacebeat__evaluation__toolbox.html#ab1c7bd9dd450597d4de9cb53d3ce6755',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/functions_70.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['pscore',['pScore',['../namespacebeat__evaluation__toolbox.html#ad69de4734b98bb8f25389d6101581333',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/all_6d.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['minbeattime',['minBeatTime',['../namespacebeat__evaluation__toolbox.html#a98669f7f6779e5c6b477502393f7de30',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/variables_6d.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['minbeattime',['minBeatTime',['../namespacebeat__evaluation__toolbox.html#a98669f7f6779e5c6b477502393f7de30',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/variables_70.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['pscore_5fthresh',['pScore_thresh',['../namespacebeat__evaluation__toolbox.html#acde48c22a1b57aa8d4fba909d0878c03',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/functions_69.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['informationgain',['informationGain',['../namespacebeat__evaluation__toolbox.html#a283f04b67830f51e73293bd980a1581c',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/variables_66.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['fmeasure_5fthresh',['fMeasure_thresh',['../namespacebeat__evaluation__toolbox.html#ab29af3c095896a2918c9aa76c2735e4c',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/variables_64.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['downbeat_5fnumbeatsperbar',['downbeat_numBeatsPerBar',['../namespacebeat__evaluation__toolbox.html#a2f48bf404199beb866a9e734ecbbf315',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/doc/html/search/variables_69.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['informationgain_5fnumbins',['informationGain_numBins',['../namespacebeat__evaluation__toolbox.html#a001d1acc54066d54be22bb7c6569a8ff',1,'beat_evaluation_toolbox']]]
4 | ];
5 |
--------------------------------------------------------------------------------
/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories (${CMAKE_CURRENT_SOURCE_DIR}/src)
2 |
3 | add_library (
4 | BeatTrackingEvaluationToolbox STATIC
5 | BeatTrackingEvaluationToolbox.cpp
6 | BeatTrackingEvaluationToolbox.h
7 | )
8 |
9 | source_group (Source src)
--------------------------------------------------------------------------------
/doc/html/search/pages_62.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['beat_20tracking_20evaluation_20toolbox_20_2d_20python',['Beat Tracking Evaluation Toolbox - Python',['../index.html',1,'']]],
4 | ['beat_20tracking_20evaluation_20toolbox',['Beat Tracking Evaluation Toolbox',['../md__r_e_a_d_m_e.html',1,'']]]
5 | ];
6 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | build
2 | build/
3 | DerivedData/
4 |
5 | ## Various settings
6 | *.pbxuser
7 | !default.pbxuser
8 | *.mode1v3
9 | !default.mode1v3
10 | *.mode2v3
11 | !default.mode2v3
12 | *.perspectivev3
13 | !default.perspectivev3
14 | xcuserdata/
15 |
16 | ## Other
17 | *.moved-aside
18 | *.xccheckout
19 | *.xcscmblueprint
--------------------------------------------------------------------------------
/doc/html/search/all_65.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['evaluate',['evaluate',['../namespacebeat__evaluation__toolbox.html#a0e32b72e0ec682b023f47d4998db3ba3',1,'beat_evaluation_toolbox']]],
4 | ['evaluate_5fdb',['evaluate_db',['../namespacebeat__evaluation__toolbox.html#a982cbc142264506861d24bb2502f2a24',1,'beat_evaluation_toolbox']]]
5 | ];
6 |
--------------------------------------------------------------------------------
/doc/html/search/all_70.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['pscore',['pScore',['../namespacebeat__evaluation__toolbox.html#ad69de4734b98bb8f25389d6101581333',1,'beat_evaluation_toolbox']]],
4 | ['pscore_5fthresh',['pScore_thresh',['../namespacebeat__evaluation__toolbox.html#acde48c22a1b57aa8d4fba909d0878c03',1,'beat_evaluation_toolbox']]]
5 | ];
6 |
--------------------------------------------------------------------------------
/doc/html/search/functions_65.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['evaluate',['evaluate',['../namespacebeat__evaluation__toolbox.html#a0e32b72e0ec682b023f47d4998db3ba3',1,'beat_evaluation_toolbox']]],
4 | ['evaluate_5fdb',['evaluate_db',['../namespacebeat__evaluation__toolbox.html#a982cbc142264506861d24bb2502f2a24',1,'beat_evaluation_toolbox']]]
5 | ];
6 |
--------------------------------------------------------------------------------
/doc/html/search/functions_62.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['be_5fxcorr',['be_xcorr',['../namespacebeat__evaluation__toolbox.html#a852ddd9753fab0473a50977ff672113c',1,'beat_evaluation_toolbox']]],
4 | ['beats_5fto_5ftext_5ffile',['beats_to_text_file',['../namespacebeat__evaluation__toolbox.html#a206438bca1e60312594549e2c39108a5',1,'beat_evaluation_toolbox']]]
5 | ];
6 |
--------------------------------------------------------------------------------
/doc/html/search/functions_64.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['downbeateval',['downbeatEval',['../namespacebeat__evaluation__toolbox.html#a0d154323210ada5b4ac9d2bbc0d6e2ff',1,'beat_evaluation_toolbox']]],
4 | ['downbeatevaluate_5fdb',['downbeatEvaluate_db',['../namespacebeat__evaluation__toolbox.html#abb6026a4b611a2f69b5142a46b39f2b7',1,'beat_evaluation_toolbox']]]
5 | ];
6 |
--------------------------------------------------------------------------------
/doc/html/search/all_69.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['informationgain',['informationGain',['../namespacebeat__evaluation__toolbox.html#a283f04b67830f51e73293bd980a1581c',1,'beat_evaluation_toolbox']]],
4 | ['informationgain_5fnumbins',['informationGain_numBins',['../namespacebeat__evaluation__toolbox.html#a001d1acc54066d54be22bb7c6569a8ff',1,'beat_evaluation_toolbox']]]
5 | ];
6 |
--------------------------------------------------------------------------------
/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required (VERSION 3.12)
2 | project (BeatTrackingEvaluationToolbox VERSION 1.0.0)
3 |
4 | set (CMAKE_CXX_STANDARD 11)
5 |
6 | #option (BUILD_TESTS "Build tests" OFF)
7 |
8 | add_subdirectory (src)
9 | enable_testing()
10 | add_subdirectory (tests)
11 |
12 | # if (BUILD_TESTS)
13 | # enable_testing()
14 | # add_subdirectory (tests)
15 | # endif (BUILD_TESTS)
16 |
17 | set (CMAKE_SUPPRESS_REGENERATION true)
18 |
19 |
--------------------------------------------------------------------------------
/tests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | include_directories (doctest)
2 | include_directories (${BeatTrackingEvaluationToolbox_SOURCE_DIR}/src)
3 |
4 | add_executable (Tests
5 | main.cpp
6 | TestSignals.cpp
7 | Test_FMeasure.cpp
8 | Test_CemgilAccuracy.cpp
9 | Test_PScore.cpp
10 | Test_Continuity.cpp
11 | )
12 |
13 | target_link_libraries (Tests BeatTrackingEvaluationToolbox)
14 | target_compile_features (Tests PRIVATE cxx_std_17)
15 | add_test (NAME Tests COMMAND Tests)
--------------------------------------------------------------------------------
/doc/html/search/functions_66.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['findbeaterror_5fnor2',['FindBeatError_nor2',['../namespacebeat__evaluation__toolbox.html#a07bfc877b0f02c49462eb8112ac84e6f',1,'beat_evaluation_toolbox']]],
4 | ['findentropy',['FindEntropy',['../namespacebeat__evaluation__toolbox.html#a69fbfc38aeaf903f4814315d536d8c7c',1,'beat_evaluation_toolbox']]],
5 | ['fmeasure',['fMeasure',['../namespacebeat__evaluation__toolbox.html#a3ad1c62e6329ba3834812d34f65e4e79',1,'beat_evaluation_toolbox']]]
6 | ];
7 |
--------------------------------------------------------------------------------
/doc/html/search/all_64.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['downbeat_5fnumbeatsperbar',['downbeat_numBeatsPerBar',['../namespacebeat__evaluation__toolbox.html#a2f48bf404199beb866a9e734ecbbf315',1,'beat_evaluation_toolbox']]],
4 | ['downbeateval',['downbeatEval',['../namespacebeat__evaluation__toolbox.html#a0d154323210ada5b4ac9d2bbc0d6e2ff',1,'beat_evaluation_toolbox']]],
5 | ['downbeatevaluate_5fdb',['downbeatEvaluate_db',['../namespacebeat__evaluation__toolbox.html#abb6026a4b611a2f69b5142a46b39f2b7',1,'beat_evaluation_toolbox']]]
6 | ];
7 |
--------------------------------------------------------------------------------
/doc/html/search/nomatches.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/tests/TestSignals.h:
--------------------------------------------------------------------------------
1 | //
2 | // TestSignals.h
3 | // Tests
4 | //
5 | // Created by Adam Stark on 03/11/2020.
6 | //
7 |
8 | #ifndef TestSignals_h
9 | #define TestSignals_h
10 |
11 | #include
12 | #include
13 |
14 | namespace examples
15 | {
16 | // H-1
17 | extern std::vector beats1;
18 | extern std::vector annotations1;
19 |
20 | // H-13
21 | extern std::vector beats2;
22 | extern std::vector annotations2;
23 | }
24 |
25 | #endif /* TestSignals_hpp */
26 |
--------------------------------------------------------------------------------
/python-module/INSTALL.md:
--------------------------------------------------------------------------------
1 | Beat Tracking Evaluation Toolbox - Python Module
2 | =================================
3 |
4 | See the main README for other information including usage and license information.
5 |
6 | Installation
7 | ------------
8 |
9 | On the command line, type:
10 |
11 | python setup.py build
12 |
13 | and then:
14 |
15 | python setup.py install
16 |
17 | You may need to prefix the second command with 'sudo', depending upon your system configuration.
18 |
19 |
20 | Usage
21 | -----
22 |
23 | See the example.py script for basic usage of the Python module.
--------------------------------------------------------------------------------
/doc/html/search/all_66.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['findbeaterror_5fnor2',['FindBeatError_nor2',['../namespacebeat__evaluation__toolbox.html#a07bfc877b0f02c49462eb8112ac84e6f',1,'beat_evaluation_toolbox']]],
4 | ['findentropy',['FindEntropy',['../namespacebeat__evaluation__toolbox.html#a69fbfc38aeaf903f4814315d536d8c7c',1,'beat_evaluation_toolbox']]],
5 | ['fmeasure',['fMeasure',['../namespacebeat__evaluation__toolbox.html#a3ad1c62e6329ba3834812d34f65e4e79',1,'beat_evaluation_toolbox']]],
6 | ['fmeasure_5fthresh',['fMeasure_thresh',['../namespacebeat__evaluation__toolbox.html#ab29af3c095896a2918c9aa76c2735e4c',1,'beat_evaluation_toolbox']]]
7 | ];
8 |
--------------------------------------------------------------------------------
/doc/html/search/functions_63.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['cemgilacc',['cemgilAcc',['../namespacebeat__evaluation__toolbox.html#a6731bf6596cec6004f11108393d5ed0e',1,'beat_evaluation_toolbox']]],
4 | ['confidenceintervals',['confidenceIntervals',['../namespacebeat__evaluation__toolbox.html#a55fb4607b15595e9ddf6e7f772335736',1,'beat_evaluation_toolbox']]],
5 | ['continuitybased',['continuityBased',['../namespacebeat__evaluation__toolbox.html#a7c7211c637ac46b4d95386bc39bdce60',1,'beat_evaluation_toolbox']]],
6 | ['continuityeval',['ContinuityEval',['../namespacebeat__evaluation__toolbox.html#a70d61c77dd005c220df97fbf6d57ad75',1,'beat_evaluation_toolbox']]]
7 | ];
8 |
--------------------------------------------------------------------------------
/python-module/setup.py:
--------------------------------------------------------------------------------
1 | # setup.py
2 | # build command : python setup.py build build_ext --inplace
3 | from numpy.distutils.core import setup, Extension
4 | import os, numpy
5 |
6 | name = 'beat_tracking_evaluation_toolbox'
7 | sources = ['beat_tracking_evaluation_toolbox_python_module.cpp','../src/BeatTrackingEvaluationToolbox.cpp']
8 |
9 | include_dirs = [
10 | numpy.get_include(),'/usr/local/include'
11 | ]
12 |
13 | setup( name = 'BeatTrackingEvaluationToolbox',
14 | include_dirs = include_dirs,
15 | ext_modules = [Extension(name, sources, extra_compile_args = ["-std=c++14"], libraries = [],library_dirs = ['/usr/local/lib'])]
16 | )
--------------------------------------------------------------------------------
/doc/html/search/all_62.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['be_5fxcorr',['be_xcorr',['../namespacebeat__evaluation__toolbox.html#a852ddd9753fab0473a50977ff672113c',1,'beat_evaluation_toolbox']]],
4 | ['beat_5fevaluation_5ftoolbox',['beat_evaluation_toolbox',['../namespacebeat__evaluation__toolbox.html',1,'']]],
5 | ['beats_5fto_5ftext_5ffile',['beats_to_text_file',['../namespacebeat__evaluation__toolbox.html#a206438bca1e60312594549e2c39108a5',1,'beat_evaluation_toolbox']]],
6 | ['beat_20tracking_20evaluation_20toolbox_20_2d_20python',['Beat Tracking Evaluation Toolbox - Python',['../index.html',1,'']]],
7 | ['beat_20tracking_20evaluation_20toolbox',['Beat Tracking Evaluation Toolbox',['../md__r_e_a_d_m_e.html',1,'']]]
8 | ];
9 |
--------------------------------------------------------------------------------
/tests/TestHelpers.h:
--------------------------------------------------------------------------------
1 |
2 | #ifndef TEST_HELPERS
3 | #define TEST_HELPERS
4 |
5 | #include
6 |
7 | //------------------------------------------------------------
8 | inline double randomSign()
9 | {
10 | int r = rand() % 2;
11 | return r == 0 ? 1. : -1.;
12 | }
13 |
14 | //------------------------------------------------------------
15 | inline double randomPositiveOrNegativeOffset (double minValue, double maxValue)
16 | {
17 | // generate random number in the range [0, 1]
18 | double r = (static_cast (rand() % 1000) / 1000.);
19 | double range = maxValue - minValue;
20 | double value = minValue + r * range;
21 |
22 | // return value with random sign (+/-)
23 | return value * randomSign();
24 | }
25 |
26 | #endif
27 |
--------------------------------------------------------------------------------
/doc/html/search/variables_63.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['cemgilacc_5fsigma',['cemgilAcc_sigma',['../namespacebeat__evaluation__toolbox.html#a4b5809a8d3d3ee5dc11d50c8699eeee3',1,'beat_evaluation_toolbox']]],
4 | ['confidenceinterval_5finterval',['confidenceInterval_interval',['../namespacebeat__evaluation__toolbox.html#a71b619a327f7c710c9c85835f31efd62',1,'beat_evaluation_toolbox']]],
5 | ['confidenceinterval_5fnumsamples',['confidenceInterval_numSamples',['../namespacebeat__evaluation__toolbox.html#a5269b930a2c8083c4e9da3fce3fc6ca9',1,'beat_evaluation_toolbox']]],
6 | ['continuitybased_5fperiodthresh',['continuityBased_periodThresh',['../namespacebeat__evaluation__toolbox.html#aa9b0d8f96cab4e3afea099db5d299499',1,'beat_evaluation_toolbox']]],
7 | ['continuitybased_5fphasethresh',['continuityBased_phaseThresh',['../namespacebeat__evaluation__toolbox.html#a05b9ad524a7a697db8e72b786c424e6e',1,'beat_evaluation_toolbox']]]
8 | ];
9 |
--------------------------------------------------------------------------------
/doc/html/search/all_61.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/all_62.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/all_63.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/all_64.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/all_65.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/all_66.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/all_67.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/all_69.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/all_6d.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/all_70.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/pages_62.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/LICENSE.txt:
--------------------------------------------------------------------------------
1 | The MIT License (MIT)
2 |
3 | Copyright (c) 2012-2016 Adam Stark
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6 |
7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8 |
9 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
/doc/html/search/functions_61.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/functions_62.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/functions_63.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/functions_64.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/functions_65.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/functions_66.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/functions_67.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/functions_69.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/functions_70.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/namespaces_62.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/variables_63.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/variables_64.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/variables_66.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/variables_67.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/variables_69.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/variables_6d.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/variables_70.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
Loading...
11 |
12 |
15 |
Searching...
16 |
No Matches
17 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/doc/html/search/variables_67.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['generateresults_5fnummethods',['generateResults_numMethods',['../namespacebeat__evaluation__toolbox.html#aeb859e2394cb783a8bf2e1a2c40c3f4f',1,'beat_evaluation_toolbox']]],
4 | ['generateresults_5foffsetrange',['generateResults_offsetRange',['../namespacebeat__evaluation__toolbox.html#a2cf5d45a371001cc8f7b4b1a1edeb052',1,'beat_evaluation_toolbox']]],
5 | ['generateresults_5fplotting',['generateResults_plotting',['../namespacebeat__evaluation__toolbox.html#add60131129f2abfcbf141b038cfba846',1,'beat_evaluation_toolbox']]],
6 | ['generateresults_5ftruncate',['generateResults_truncate',['../namespacebeat__evaluation__toolbox.html#a48c2b1ae0126d55374e41a9b10e25d23',1,'beat_evaluation_toolbox']]],
7 | ['gotoacc_5fmu',['gotoAcc_mu',['../namespacebeat__evaluation__toolbox.html#ad43f546bce8fb597162eb4b3987dc165',1,'beat_evaluation_toolbox']]],
8 | ['gotoacc_5fsigma',['gotoAcc_sigma',['../namespacebeat__evaluation__toolbox.html#a2f3ec3cc65319c46fe5e94e89762a08c',1,'beat_evaluation_toolbox']]],
9 | ['gotoacc_5fthresh',['gotoAcc_thresh',['../namespacebeat__evaluation__toolbox.html#afdaebeee67cf1398c02bad2ca66ebb06',1,'beat_evaluation_toolbox']]]
10 | ];
11 |
--------------------------------------------------------------------------------
/doc/html/search/all_67.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['generateresults_5fnummethods',['generateResults_numMethods',['../namespacebeat__evaluation__toolbox.html#aeb859e2394cb783a8bf2e1a2c40c3f4f',1,'beat_evaluation_toolbox']]],
4 | ['generateresults_5foffsetrange',['generateResults_offsetRange',['../namespacebeat__evaluation__toolbox.html#a2cf5d45a371001cc8f7b4b1a1edeb052',1,'beat_evaluation_toolbox']]],
5 | ['generateresults_5fplotting',['generateResults_plotting',['../namespacebeat__evaluation__toolbox.html#add60131129f2abfcbf141b038cfba846',1,'beat_evaluation_toolbox']]],
6 | ['generateresults_5ftruncate',['generateResults_truncate',['../namespacebeat__evaluation__toolbox.html#a48c2b1ae0126d55374e41a9b10e25d23',1,'beat_evaluation_toolbox']]],
7 | ['gotoacc',['gotoAcc',['../namespacebeat__evaluation__toolbox.html#ab1c7bd9dd450597d4de9cb53d3ce6755',1,'beat_evaluation_toolbox']]],
8 | ['gotoacc_5fmu',['gotoAcc_mu',['../namespacebeat__evaluation__toolbox.html#ad43f546bce8fb597162eb4b3987dc165',1,'beat_evaluation_toolbox']]],
9 | ['gotoacc_5fsigma',['gotoAcc_sigma',['../namespacebeat__evaluation__toolbox.html#a2f3ec3cc65319c46fe5e94e89762a08c',1,'beat_evaluation_toolbox']]],
10 | ['gotoacc_5fthresh',['gotoAcc_thresh',['../namespacebeat__evaluation__toolbox.html#afdaebeee67cf1398c02bad2ca66ebb06',1,'beat_evaluation_toolbox']]]
11 | ];
12 |
--------------------------------------------------------------------------------
/doc/html/tabs.css:
--------------------------------------------------------------------------------
1 | .tabs, .tabs2, .tabs3 {
2 | background-image: url('tab_b.png');
3 | width: 100%;
4 | z-index: 101;
5 | font-size: 13px;
6 | font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;
7 | }
8 |
9 | .tabs2 {
10 | font-size: 10px;
11 | }
12 | .tabs3 {
13 | font-size: 9px;
14 | }
15 |
16 | .tablist {
17 | margin: 0;
18 | padding: 0;
19 | display: table;
20 | }
21 |
22 | .tablist li {
23 | float: left;
24 | display: table-cell;
25 | background-image: url('tab_b.png');
26 | line-height: 36px;
27 | list-style: none;
28 | }
29 |
30 | .tablist a {
31 | display: block;
32 | padding: 0 20px;
33 | font-weight: bold;
34 | background-image:url('tab_s.png');
35 | background-repeat:no-repeat;
36 | background-position:right;
37 | color: #283A5D;
38 | text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9);
39 | text-decoration: none;
40 | outline: none;
41 | }
42 |
43 | .tabs3 .tablist a {
44 | padding: 0 10px;
45 | }
46 |
47 | .tablist a:hover {
48 | background-image: url('tab_h.png');
49 | background-repeat:repeat-x;
50 | color: #fff;
51 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
52 | text-decoration: none;
53 | }
54 |
55 | .tablist li.current a {
56 | background-image: url('tab_a.png');
57 | background-repeat:repeat-x;
58 | color: #fff;
59 | text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0);
60 | }
61 |
--------------------------------------------------------------------------------
/doc/html/search/all_63.js:
--------------------------------------------------------------------------------
1 | var searchData=
2 | [
3 | ['cemgilacc',['cemgilAcc',['../namespacebeat__evaluation__toolbox.html#a6731bf6596cec6004f11108393d5ed0e',1,'beat_evaluation_toolbox']]],
4 | ['cemgilacc_5fsigma',['cemgilAcc_sigma',['../namespacebeat__evaluation__toolbox.html#a4b5809a8d3d3ee5dc11d50c8699eeee3',1,'beat_evaluation_toolbox']]],
5 | ['confidenceinterval_5finterval',['confidenceInterval_interval',['../namespacebeat__evaluation__toolbox.html#a71b619a327f7c710c9c85835f31efd62',1,'beat_evaluation_toolbox']]],
6 | ['confidenceinterval_5fnumsamples',['confidenceInterval_numSamples',['../namespacebeat__evaluation__toolbox.html#a5269b930a2c8083c4e9da3fce3fc6ca9',1,'beat_evaluation_toolbox']]],
7 | ['confidenceintervals',['confidenceIntervals',['../namespacebeat__evaluation__toolbox.html#a55fb4607b15595e9ddf6e7f772335736',1,'beat_evaluation_toolbox']]],
8 | ['continuitybased',['continuityBased',['../namespacebeat__evaluation__toolbox.html#a7c7211c637ac46b4d95386bc39bdce60',1,'beat_evaluation_toolbox']]],
9 | ['continuitybased_5fperiodthresh',['continuityBased_periodThresh',['../namespacebeat__evaluation__toolbox.html#aa9b0d8f96cab4e3afea099db5d299499',1,'beat_evaluation_toolbox']]],
10 | ['continuitybased_5fphasethresh',['continuityBased_phaseThresh',['../namespacebeat__evaluation__toolbox.html#a05b9ad524a7a697db8e72b786c424e6e',1,'beat_evaluation_toolbox']]],
11 | ['continuityeval',['ContinuityEval',['../namespacebeat__evaluation__toolbox.html#a70d61c77dd005c220df97fbf6d57ad75',1,'beat_evaluation_toolbox']]]
12 | ];
13 |
--------------------------------------------------------------------------------
/doc/html/dynsections.js:
--------------------------------------------------------------------------------
1 | function toggleVisibility(linkObj)
2 | {
3 | var base = $(linkObj).attr('id');
4 | var summary = $('#'+base+'-summary');
5 | var content = $('#'+base+'-content');
6 | var trigger = $('#'+base+'-trigger');
7 | var src=$(trigger).attr('src');
8 | if (content.is(':visible')===true) {
9 | content.hide();
10 | summary.show();
11 | $(linkObj).addClass('closed').removeClass('opened');
12 | $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
13 | } else {
14 | content.show();
15 | summary.hide();
16 | $(linkObj).removeClass('closed').addClass('opened');
17 | $(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
18 | }
19 | return false;
20 | }
21 |
22 | function updateStripes()
23 | {
24 | $('table.directory tr').
25 | removeClass('even').filter(':visible:even').addClass('even');
26 | }
27 | function toggleLevel(level)
28 | {
29 | $('table.directory tr').each(function(){
30 | var l = this.id.split('_').length-1;
31 | var i = $('#img'+this.id.substring(3));
32 | var a = $('#arr'+this.id.substring(3));
33 | if (l
2 | #include
3 | #include
4 | #include "../src/BeatTrackingEvaluationToolbox.h"
5 |
6 | //=======================================================================
7 | static PyObject * evaluate(PyObject *dummy, PyObject *args)
8 | {
9 | PyObject *arg1=NULL;
10 | PyObject *arr1=NULL;
11 | PyObject *arg2=NULL;
12 | PyObject *arr2=NULL;
13 |
14 | if (!PyArg_ParseTuple(args, "OO", &arg1,&arg2))
15 | {
16 | return NULL;
17 | }
18 |
19 | arr1 = PyArray_FROM_OTF(arg1, NPY_DOUBLE, NPY_IN_ARRAY);
20 | if (arr1 == NULL)
21 | {
22 | return NULL;
23 | }
24 |
25 | arr2 = PyArray_FROM_OTF(arg2, NPY_DOUBLE, NPY_IN_ARRAY);
26 | if (arr2 == NULL)
27 | {
28 | return NULL;
29 | }
30 |
31 | ////////// GET INPUT DATA ///////////////////
32 |
33 | // get data as array
34 | double* beatData = (double*) PyArray_DATA(arr1);
35 | double* annotationData = (double*) PyArray_DATA(arr2);
36 |
37 | // get array size
38 | long numBeats = PyArray_Size((PyObject*)arr1);
39 | long numAnnotations = PyArray_Size((PyObject*)arr2);
40 |
41 | std::vector beats;
42 | std::vector annotations;
43 |
44 | for (int i = 0; i < numBeats;i++)
45 | {
46 | beats.push_back (beatData[i]);
47 | }
48 |
49 | for (int i = 0; i < numAnnotations;i++)
50 | {
51 | annotations.push_back (annotationData[i]);
52 | }
53 |
54 | std::vector result = BeatTrackingEvaluationToolbox::evaluate (beats,annotations);
55 |
56 | // double results[result.size()];
57 | //
58 | // for (int i = 0;i < result.size();i++)
59 | // {
60 | // results[i] = result[i];
61 | // }
62 |
63 |
64 | ////////// CREATE ARRAY AND RETURN IT ///////////////////
65 | int nd=1;
66 | npy_intp m= result.size();
67 |
68 |
69 | PyObject* c=PyArray_SimpleNew(nd, &m, NPY_DOUBLE);
70 |
71 | void *arr_data = PyArray_DATA((PyArrayObject*)c);
72 |
73 | memcpy(arr_data, &result[0], PyArray_ITEMSIZE((PyArrayObject*) c) * m);
74 |
75 |
76 | Py_DECREF(arr1);
77 | Py_INCREF(Py_None);
78 |
79 | return (PyObject *)c;
80 | }
81 |
82 | //=======================================================================
83 | static PyMethodDef beat_tracking_evaluation_toolbox_methods[] = {
84 | { "evaluate", evaluate, METH_VARARGS,"Evaluate a given beat sequence and annotation sequence"},
85 | {NULL, NULL, 0, NULL} /* Sentinel */
86 | };
87 |
88 | //=======================================================================
89 | static struct PyModuleDef beat_tracking_evaluation_toolbox_definition = {
90 | PyModuleDef_HEAD_INIT,
91 | "beat_tracking_evaluation_toolbox",
92 | "A toolbox of beat tracking evaluation methods",
93 | -1,
94 | beat_tracking_evaluation_toolbox_methods
95 | };
96 |
97 | //=======================================================================
98 | PyMODINIT_FUNC PyInit_beat_tracking_evaluation_toolbox(void)
99 | {
100 | import_array();
101 | return PyModule_Create(&beat_tracking_evaluation_toolbox_definition);
102 | }
103 |
104 | //=======================================================================
105 | int main(int argc, char *argv[])
106 | {
107 | wchar_t* program = Py_DecodeLocale (argv[0], NULL);
108 | Py_SetProgramName (program);
109 |
110 | /* Initialize the Python interpreter. Required. */
111 | Py_Initialize();
112 |
113 | /* Add a static module */
114 | PyInit_beat_tracking_evaluation_toolbox();
115 | }
116 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Beat Tracking Evaluation Toolbox
2 | ================================
3 |
4 | This repository implements a number of beat tracking evaluation methods, described in a summary paper:
5 |
6 | * Evaluation Methods for Musical Audio Beat Tracking Algorithms, Matthew E. P. Davies, Norberto Degara and Mark D. Plumbley, Technical Report C4DM-TR-09-06, 2009
7 |
8 | The toolbox can be used in one of three ways
9 | * Python implementation
10 | * C++ implementation
11 | * Python module that wraps the C++ implementation
12 |
13 | Python software implementation by Matthew Davies and Adam Stark.
14 | C++ implementation and Python module by Adam Stark
15 |
16 | Running the code (Python)
17 | ----------------
18 |
19 | First, import the library:
20 |
21 | import beat_evaluation_toolbox as be
22 |
23 | Then, evaluate beat estimations on database of beat annotaions as follows:
24 |
25 | R = be.evaluate_db(annotations,beats,measures,doCI)
26 |
27 | where the arguments are as follows:
28 |
29 | * 'annotations' is a list of numpy arrays containing the beat annotations for the database
30 | * 'beats' is a list of numpy arrays containing the beat estimations for the database
31 | * 'measures' is a list of strings indicating which evaluation measures to use. Setting measures='all' calculates all measures. Specific measures can be chosen by setting measures = ['fMeasure','cemgilAcc','gotoAcc','pScore','continuity','infoGain','amlCem'] or a subset thereof.
32 | * 'doCI' is a boolean indicating whether or not to calculate confidence intervals
33 |
34 | and the returned value is:
35 |
36 | * 'R' is a dictionary containing all results
37 |
38 | All results will be printed to the terminal once the evaluation is complete.
39 |
40 | Running the code (Python module)
41 | ----------------
42 |
43 | Go to the `python-module` directory and build the module:
44 |
45 | ```
46 | python setup.py build
47 | sudo python setup.py install
48 | ```
49 | Then in your Python script, import the module:
50 |
51 | ```
52 | import beat_tracking_evaluation_toolbox as be
53 | ```
54 |
55 | Next, ensure your beats and annotations are in `numpy` arrays and get evaluation scores by:
56 |
57 | ```
58 | results = be.evaluate (beats, annotations)
59 | ```
60 |
61 | You might want to loop over a number of files, so if you had the beats and annotations each in a list of numpy arrays (`allBeats` and `allAnnotations` in the below example), you might choose to do the following:
62 |
63 | ```
64 | for i in range(len(allBeats)):
65 | print("Evaluating file " + str(i + 1))
66 | if (results.size == 0):
67 | results = be.evaluate (allBeats[i], allAnnotations[i])
68 | else:
69 | results = np.vstack( (results, be.evaluate (allBeats[i], allAnnotations[i])) )
70 |
71 | meanResults = results.mean(0)
72 |
73 | print (" ")
74 | print ("--------------- Results ------------------")
75 | print ("fMeasure: %.2f" % meanResults[2])
76 | print ("cemgilAcc: %.2f" % meanResults[0])
77 | print ("gotoAcc: %.2f" % meanResults[4])
78 | print ("pScore: %.2f" % meanResults[3])
79 |
80 | # print out continuity based measures
81 | r_cmlC = meanResults[6]
82 | r_cmlT = meanResults[7]
83 | r_amlC = meanResults[8]
84 | r_amlT = meanResults[9]
85 | print ("cmlC: %.2f cmlT: %.2f amlC: %.2f amlT: %.2f" % (r_cmlC, r_cmlT, r_amlC, r_amlT))
86 |
87 | print ("infoGain: %.2f" % meanResults[5])
88 | print ("amlCem: %.2f" % meanResults[1])
89 | print ("------------------------------------------")
90 | print (" ")
91 | ```
92 |
93 |
94 |
95 | License
96 | -------
97 |
98 | The MIT License (MIT)
99 |
100 | Copyright (c) 2012 Matthew Davies and Adam Stark
101 |
102 | Permission is hereby granted, free of charge, to any person obtaining a copy
103 | of this software and associated documentation files (the "Software"), to deal
104 | in the Software without restriction, including without limitation the rights
105 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
106 | copies of the Software, and to permit persons to whom the Software is
107 | furnished to do so, subject to the following conditions:
108 |
109 | The above copyright notice and this permission notice shall be included in
110 | all copies or substantial portions of the Software.
111 |
112 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
113 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
114 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
115 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
116 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
117 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
118 | THE SOFTWARE.
--------------------------------------------------------------------------------
/doc/html/pages.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Beat Tracking Evaluation Toolbox: Related Pages
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Beat Tracking Evaluation Toolbox
25 | v1.0
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
60 |
61 |
62 |
67 |
68 |
69 |
70 |
73 |
74 |
75 |
79 |
80 |
Here is a list of all related documentation pages:
85 |
86 |
87 |
92 |
93 |
94 |
--------------------------------------------------------------------------------
/doc/html/search/search.css:
--------------------------------------------------------------------------------
1 | /*---------------- Search Box */
2 |
3 | #FSearchBox {
4 | float: left;
5 | }
6 |
7 | #MSearchBox {
8 | white-space : nowrap;
9 | position: absolute;
10 | float: none;
11 | display: inline;
12 | margin-top: 8px;
13 | right: 0px;
14 | width: 170px;
15 | z-index: 102;
16 | background-color: white;
17 | }
18 |
19 | #MSearchBox .left
20 | {
21 | display:block;
22 | position:absolute;
23 | left:10px;
24 | width:20px;
25 | height:19px;
26 | background:url('search_l.png') no-repeat;
27 | background-position:right;
28 | }
29 |
30 | #MSearchSelect {
31 | display:block;
32 | position:absolute;
33 | width:20px;
34 | height:19px;
35 | }
36 |
37 | .left #MSearchSelect {
38 | left:4px;
39 | }
40 |
41 | .right #MSearchSelect {
42 | right:5px;
43 | }
44 |
45 | #MSearchField {
46 | display:block;
47 | position:absolute;
48 | height:19px;
49 | background:url('search_m.png') repeat-x;
50 | border:none;
51 | width:116px;
52 | margin-left:20px;
53 | padding-left:4px;
54 | color: #909090;
55 | outline: none;
56 | font: 9pt Arial, Verdana, sans-serif;
57 | }
58 |
59 | #FSearchBox #MSearchField {
60 | margin-left:15px;
61 | }
62 |
63 | #MSearchBox .right {
64 | display:block;
65 | position:absolute;
66 | right:10px;
67 | top:0px;
68 | width:20px;
69 | height:19px;
70 | background:url('search_r.png') no-repeat;
71 | background-position:left;
72 | }
73 |
74 | #MSearchClose {
75 | display: none;
76 | position: absolute;
77 | top: 4px;
78 | background : none;
79 | border: none;
80 | margin: 0px 4px 0px 0px;
81 | padding: 0px 0px;
82 | outline: none;
83 | }
84 |
85 | .left #MSearchClose {
86 | left: 6px;
87 | }
88 |
89 | .right #MSearchClose {
90 | right: 2px;
91 | }
92 |
93 | .MSearchBoxActive #MSearchField {
94 | color: #000000;
95 | }
96 |
97 | /*---------------- Search filter selection */
98 |
99 | #MSearchSelectWindow {
100 | display: none;
101 | position: absolute;
102 | left: 0; top: 0;
103 | border: 1px solid #90A5CE;
104 | background-color: #F9FAFC;
105 | z-index: 1;
106 | padding-top: 4px;
107 | padding-bottom: 4px;
108 | -moz-border-radius: 4px;
109 | -webkit-border-top-left-radius: 4px;
110 | -webkit-border-top-right-radius: 4px;
111 | -webkit-border-bottom-left-radius: 4px;
112 | -webkit-border-bottom-right-radius: 4px;
113 | -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
114 | }
115 |
116 | .SelectItem {
117 | font: 8pt Arial, Verdana, sans-serif;
118 | padding-left: 2px;
119 | padding-right: 12px;
120 | border: 0px;
121 | }
122 |
123 | span.SelectionMark {
124 | margin-right: 4px;
125 | font-family: monospace;
126 | outline-style: none;
127 | text-decoration: none;
128 | }
129 |
130 | a.SelectItem {
131 | display: block;
132 | outline-style: none;
133 | color: #000000;
134 | text-decoration: none;
135 | padding-left: 6px;
136 | padding-right: 12px;
137 | }
138 |
139 | a.SelectItem:focus,
140 | a.SelectItem:active {
141 | color: #000000;
142 | outline-style: none;
143 | text-decoration: none;
144 | }
145 |
146 | a.SelectItem:hover {
147 | color: #FFFFFF;
148 | background-color: #3D578C;
149 | outline-style: none;
150 | text-decoration: none;
151 | cursor: pointer;
152 | display: block;
153 | }
154 |
155 | /*---------------- Search results window */
156 |
157 | iframe#MSearchResults {
158 | width: 60ex;
159 | height: 15em;
160 | }
161 |
162 | #MSearchResultsWindow {
163 | display: none;
164 | position: absolute;
165 | left: 0; top: 0;
166 | border: 1px solid #000;
167 | background-color: #EEF1F7;
168 | }
169 |
170 | /* ----------------------------------- */
171 |
172 |
173 | #SRIndex {
174 | clear:both;
175 | padding-bottom: 15px;
176 | }
177 |
178 | .SREntry {
179 | font-size: 10pt;
180 | padding-left: 1ex;
181 | }
182 |
183 | .SRPage .SREntry {
184 | font-size: 8pt;
185 | padding: 1px 5px;
186 | }
187 |
188 | body.SRPage {
189 | margin: 5px 2px;
190 | }
191 |
192 | .SRChildren {
193 | padding-left: 3ex; padding-bottom: .5em
194 | }
195 |
196 | .SRPage .SRChildren {
197 | display: none;
198 | }
199 |
200 | .SRSymbol {
201 | font-weight: bold;
202 | color: #425E97;
203 | font-family: Arial, Verdana, sans-serif;
204 | text-decoration: none;
205 | outline: none;
206 | }
207 |
208 | a.SRScope {
209 | display: block;
210 | color: #425E97;
211 | font-family: Arial, Verdana, sans-serif;
212 | text-decoration: none;
213 | outline: none;
214 | }
215 |
216 | a.SRSymbol:focus, a.SRSymbol:active,
217 | a.SRScope:focus, a.SRScope:active {
218 | text-decoration: underline;
219 | }
220 |
221 | span.SRScope {
222 | padding-left: 4px;
223 | }
224 |
225 | .SRPage .SRStatus {
226 | padding: 2px 5px;
227 | font-size: 8pt;
228 | font-style: italic;
229 | }
230 |
231 | .SRResult {
232 | display: none;
233 | }
234 |
235 | DIV.searchresults {
236 | margin-left: 10px;
237 | margin-right: 10px;
238 | }
239 |
--------------------------------------------------------------------------------
/doc/html/namespaces.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Beat Tracking Evaluation Toolbox: Namespace List
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Beat Tracking Evaluation Toolbox
25 | v1.0
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
60 |
66 |
67 |
68 |
73 |
74 |
75 |
76 |
79 |
80 |
81 |
85 |
86 |
Here is a list of all documented namespaces with brief descriptions:
91 |
92 |
93 |
98 |
99 |
100 |
--------------------------------------------------------------------------------
/tests/TestSignals.cpp:
--------------------------------------------------------------------------------
1 | //
2 | // TestSignals.cpp
3 | // Tests
4 | //
5 | // Created by Adam Stark on 03/11/2020.
6 | //
7 |
8 | #include "TestSignals.h"
9 |
10 | namespace examples
11 | {
12 | std::vector beats1 = {0.47600907, 0.91718821, 1.4860771, 2.20589569, 2.79800454, 3.42494331,
13 | 4.04027211, 4.65560091, 5.25931973, 5.85142857, 6.45514739, 7.05886621,
14 | 7.65097506, 8.26630385, 8.87002268, 9.46213152, 10.06585034, 10.66956916,
15 | 11.27328798, 11.8770068, 12.4923356, 13.08444444, 13.68816327, 14.31510204,
16 | 14.93043084, 15.51092971, 16.07981859, 16.70675737, 17.29886621, 17.90258503,
17 | 18.50630385, 19.11002268, 19.69052154, 20.30585034, 20.90956916, 21.51328798,
18 | 22.10539683, 22.69750567, 23.28961451, 23.87011338, 24.46222222, 25.07755102,
19 | 25.69287982, 26.28498866, 26.90031746, 27.4924263, 28.09614512, 28.67664399,
20 | 29.28036281, 29.89569161, 30.48780045, 31.0799093, 31.6952381, 32.28734694,
21 | 32.89106576, 33.47156463, 34.06367347, 34.65578231, 35.27111111, 35.87482993,
22 | 36.47854875, 37.08226757, 37.68598639, 38.26648526, 38.87020408, 39.49714286,
23 | 40.10086168, 40.69297052, 41.30829932, 41.90040816, 42.50412698, 43.08462585,
24 | 43.67673469, 44.29206349, 44.90739229, 45.51111111, 46.10321995, 46.70693878,
25 | 47.32226757, 47.90276644, 48.51809524, 49.13342404, 49.74875283, 50.34086168,
26 | 50.9445805, 51.5599093, 52.16362812, 52.77895692, 53.32462585, 53.89351474,
27 | 54.50884354, 55.10095238, 55.7046712, 56.32};
28 |
29 | std::vector annotations1 = {0.45496599, 1.04421769, 1.61614512, 2.21405896, 2.82716553, 3.44712018,
30 | 4.05657596, 4.64040816, 5.25564626, 5.85358277, 6.44283447, 7.04941043,
31 | 7.6646712, 8.2799093, 8.86049887, 9.44108844, 10.05895692, 10.63086168,
32 | 11.28501134, 11.88736961, 12.47662132, 13.06587302, 13.68113379, 14.27038549,
33 | 14.89430839, 15.49222222, 16.09879819, 16.69673469, 17.30331066, 17.90124717,
34 | 18.50782313, 19.10573696, 19.68893424, 20.2955102, 20.89344671, 21.50002268,
35 | 22.07195011, 22.68718821, 23.25045351, 23.84836735, 24.46362812, 25.08755102,
36 | 25.67680272, 26.27471655, 26.88997732, 27.49580499, 28.08861678, 28.67036281,
37 | 29.28408163, 29.88217687, 30.47142857, 31.08666667, 31.67594104, 32.25653061,
38 | 32.85444444, 33.44369615, 34.05027211, 34.67419501, 35.26344671, 35.88736961,
39 | 36.47662132, 37.07453515, 37.64646259, 38.26648526, 38.88823129, 39.47811791,
40 | 40.06278912, 40.6646712, 41.2885941, 41.89517007, 42.46709751, 43.07367347,
41 | 43.68893424, 44.28684807, 44.8847619, 45.49136054, 46.09793651, 46.72185941,
42 | 47.29378685, 47.87437642, 48.50378685, 49.13521542, 49.74569161, 50.32578231,
43 | 50.9399093, 51.5385034, 52.12151927, 52.68902494, 53.28759637, 53.8861678,
44 | 54.46920635, 55.09111111};
45 |
46 |
47 | std::vector beats2 = {0.5456689342403628, 0.9984580498866213, 1.4628571428571429, 1.9272562358276644, 2.380045351473923, 2.8444444444444446, 3.1927437641723357, 3.599092970521542, 4.028662131519274, 4.46984126984127, 4.911020408163266, 5.340589569160998, 5.7817687074829935, 6.211337868480726, 6.640907029478458, 7.082086167800454, 7.5232653061224495, 7.964444444444444, 8.40562358276644, 8.846802721088435, 9.276371882086169, 9.729160997732427, 10.147120181405896, 10.599909297052154, 11.029478458049887, 11.470657596371883, 11.911836734693878, 12.353015873015874, 12.782585034013605, 13.223764172335601, 13.664943310657597, 14.09451247165533, 14.524081632653061, 14.965260770975057, 15.418049886621315, 15.870839002267575, 16.300408163265306, 16.72997732426304, 17.147936507936507, 17.589115646258502, 18.041904761904764, 18.471473922902494, 18.91265306122449, 19.353832199546485, 19.783401360544218, 20.224580498866214, 20.654149659863947, 21.095328798185943, 21.536507936507938, 21.977687074829934, 22.41886621315193, 22.860045351473925, 23.301224489795917, 23.73079365079365, 24.160362811791384, 24.589931972789117, 25.042721088435375};
48 |
49 |
50 | std::vector annotations2 = {0.06458049886621316, 0.5213832199546485, 0.9483900226757369, 1.3753968253968254, 1.8222675736961451, 2.269138321995465, 2.6862131519274377, 3.113219954648526, 3.579954648526077, 3.9970521541950115, 4.443922902494331, 4.87092970521542, 5.33766439909297, 5.7746031746031745, 6.171814058956916, 6.618684807256236, 7.085419501133787, 7.502494331065759, 7.959297052154195, 8.386326530612244, 8.813333333333333, 9.260204081632653, 9.657414965986394, 10.100816326530612, 10.567551020408164, 10.984625850340136, 11.451360544217687, 11.88829931972789, 12.33517006802721, 12.762176870748299, 13.209070294784581, 13.626145124716553, 14.073015873015873, 14.490090702947846, 14.936961451247166, 15.420408163265305, 15.84063492063492, 16.267641723356007, 16.69467120181406, 17.111746031746033, 17.568548752834467, 18.00548752834467, 18.460521541950115, 18.915555555555557, 19.316303854875283, 19.755714285714287, 20.172448979591838, 20.626485260770973, 21.080521541950112, 21.50968253968254, 21.951292517006802, 22.399115646258505, 22.83448979591837, 23.263650793650793, 23.692834467120182, 24.14063492063492, 24.56981859410431};
51 | }
52 |
--------------------------------------------------------------------------------
/tests/Test_PScore.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "doctest.h"
3 | #include "TestHelpers.h"
4 | #include
5 |
6 | //=============================================================
7 | TEST_SUITE ("PScore")
8 | {
9 | //------------------------------------------------------------
10 | TEST_CASE ("Both Empty Sequences")
11 | {
12 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsPScore (std::vector(), std::vector());
13 | CHECK_EQ (result, 0.);
14 | }
15 |
16 | //------------------------------------------------------------
17 | TEST_CASE ("Empty Beat Sequence")
18 | {
19 | std::vector annotations;
20 |
21 | for (int i = 1; i <= 360; i++)
22 | annotations.push_back (i / 2.);
23 |
24 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsPScore (std::vector(), annotations);
25 | CHECK_EQ (result, 0.);
26 | }
27 |
28 |
29 | //------------------------------------------------------------
30 | TEST_CASE ("Empty Annotation Sequence")
31 | {
32 | std::vector beats;
33 |
34 | for (int i = 1; i <= 360; i++)
35 | beats.push_back (i / 2.);
36 |
37 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsPScore (beats, std::vector());
38 | CHECK_EQ (result, 0.);
39 | }
40 |
41 |
42 | //------------------------------------------------------------
43 | TEST_CASE ("Identical Sequences")
44 | {
45 | std::vector beats;
46 |
47 | for (int i = 1; i <= 360; i++)
48 | beats.push_back (i / 2.);
49 |
50 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsPScore (beats, beats);
51 | CHECK_EQ (result, 100.);
52 | }
53 |
54 |
55 | //------------------------------------------------------------
56 | TEST_CASE ("All beats within tolerance window")
57 | {
58 | std::vector annotations;
59 | std::vector beats;
60 |
61 | for (int i = 1; i <= 360; i++)
62 | annotations.push_back (i / 2.);
63 |
64 | for (int i = 0; i < annotations.size(); i++)
65 | beats.push_back (annotations[i] + randomPositiveOrNegativeOffset (0., 0.1));
66 |
67 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsPScore (beats, annotations, 0.2, 0.);
68 | CHECK_EQ (result, 100.);
69 | }
70 |
71 | /*
72 | //------------------------------------------------------------
73 | TEST_CASE ("All beats outside tolerance window")
74 | {
75 | std::vector annotations;
76 | std::vector beats;
77 |
78 | for (int i = 1; i <= 360; i++)
79 | annotations.push_back (i / 2.);
80 |
81 | for (int i = 0; i < annotations.size(); i++)
82 | beats.push_back (annotations[i] + randomPositiveOrNegativeOffset (0.071, 0.1));
83 |
84 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations);
85 |
86 | CHECK_EQ (result.fMeasure, 0.0);
87 | CHECK_EQ (result.precision, 0.0);
88 | CHECK_EQ (result.recall, 0.0);
89 | CHECK_EQ (result.accuracy, 0.0);
90 | }
91 |
92 | //------------------------------------------------------------
93 | TEST_CASE ("All beats on the offbeat")
94 | {
95 | std::vector annotations;
96 | std::vector beats;
97 |
98 | for (int i = 1; i <= 360; i++)
99 | annotations.push_back (i / 2.);
100 |
101 | for (int i = 0; i < annotations.size(); i++)
102 | beats.push_back (annotations[i] + 0.25);
103 |
104 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations);
105 |
106 | CHECK_EQ (result.fMeasure, 0.0);
107 | CHECK_EQ (result.precision, 0.0);
108 | CHECK_EQ (result.recall, 0.0);
109 | CHECK_EQ (result.accuracy, 0.0);
110 | }
111 |
112 | //------------------------------------------------------------
113 | TEST_CASE ("Double speed")
114 | {
115 | std::vector annotations;
116 | std::vector beats;
117 |
118 | for (int i = 1; i <= 360; i++)
119 | annotations.push_back (i / 2.);
120 |
121 | for (int i = 0; i < annotations.size(); i++)
122 | {
123 | beats.push_back (annotations[i]);
124 | beats.push_back (annotations[i] + 0.25);
125 | }
126 |
127 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations);
128 |
129 | CHECK (result.fMeasure == doctest::Approx (66.6666666667).epsilon (0.0001));
130 | CHECK_EQ (result.precision, 50.0);
131 | CHECK_EQ (result.recall, 100.0);
132 | CHECK_EQ (result.accuracy, 50.0);
133 | }
134 |
135 | //------------------------------------------------------------
136 | TEST_CASE ("Half speed")
137 | {
138 | std::vector annotations;
139 | std::vector beats;
140 |
141 | for (int i = 1; i <= 360; i++)
142 | annotations.push_back (i / 2.);
143 |
144 | for (int i = 0; i < annotations.size(); i += 2)
145 | beats.push_back (annotations[i]);
146 |
147 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations);
148 |
149 | CHECK (result.fMeasure == doctest::Approx (66.6666666667).epsilon (0.0001));
150 | CHECK_EQ (result.precision, 100.0);
151 | CHECK_EQ (result.recall, 50.0);
152 | CHECK_EQ (result.accuracy, 50.0);
153 | }
154 |
155 | //------------------------------------------------------------
156 | TEST_CASE ("Multiple correct beats per annotation")
157 | {
158 | std::vector annotations;
159 | std::vector beats;
160 |
161 | for (int i = 1; i <= 360; i++)
162 | annotations.push_back (i / 2.);
163 |
164 | for (int i = 0; i < annotations.size(); i++)
165 | {
166 | beats.push_back (annotations[i]);
167 | beats.push_back (annotations[i] + 0.01);
168 | beats.push_back (annotations[i] - 0.01);
169 | }
170 |
171 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations);
172 |
173 | CHECK (result.fMeasure == doctest::Approx (50).epsilon (0.0001));
174 | CHECK (result.precision == doctest::Approx (33.333333333).epsilon (0.0001));
175 | CHECK_EQ (result.recall, 100.0);
176 | CHECK (result.accuracy == doctest::Approx (33.333333333).epsilon (0.0001));
177 | }*/
178 | }
179 |
--------------------------------------------------------------------------------
/tests/Test_Continuity.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "doctest.h"
3 | #include "TestHelpers.h"
4 | #include
5 |
6 | //=============================================================
7 | TEST_SUITE ("Continuity")
8 | {
9 | //------------------------------------------------------------
10 | TEST_CASE ("Both Empty Sequences")
11 | {
12 | ContinuityResult result = BeatTrackingEvaluationToolbox::evaluateBeatsContinuity (std::vector(), std::vector());
13 | CHECK_EQ (result.cmlC, 0.);
14 | CHECK_EQ (result.cmlT, 0.);
15 | CHECK_EQ (result.amlC, 0.);
16 | CHECK_EQ (result.amlT, 0.);
17 | }
18 |
19 | //------------------------------------------------------------
20 | TEST_CASE ("Empty Beat Sequence")
21 | {
22 | std::vector annotations;
23 |
24 | for (int i = 1; i <= 360; i++)
25 | annotations.push_back (i / 2.);
26 |
27 | ContinuityResult result = BeatTrackingEvaluationToolbox::evaluateBeatsContinuity (std::vector(), annotations, 0.);
28 | CHECK_EQ (result.cmlC, 0.);
29 | CHECK_EQ (result.cmlT, 0.);
30 | CHECK_EQ (result.amlC, 0.);
31 | CHECK_EQ (result.amlT, 0.);
32 | }
33 |
34 | //------------------------------------------------------------
35 | TEST_CASE ("Empty Annotation Sequence")
36 | {
37 | std::vector beats;
38 |
39 | for (int i = 1; i <= 360; i++)
40 | beats.push_back (i / 2.);
41 |
42 | ContinuityResult result = BeatTrackingEvaluationToolbox::evaluateBeatsContinuity (beats, std::vector(), 0.);
43 | CHECK_EQ (result.cmlC, 0.);
44 | CHECK_EQ (result.cmlT, 0.);
45 | CHECK_EQ (result.amlC, 0.);
46 | CHECK_EQ (result.amlT, 0.);
47 | }
48 |
49 | //------------------------------------------------------------
50 | TEST_CASE ("Identical Sequences")
51 | {
52 | std::vector beats;
53 |
54 | for (int i = 1; i <= 360; i++)
55 | beats.push_back (i / 2.);
56 |
57 | ContinuityResult result = BeatTrackingEvaluationToolbox::evaluateBeatsContinuity (beats, beats, 0.);
58 | CHECK_EQ (result.cmlC, 100.);
59 | CHECK_EQ (result.cmlT, 100.);
60 | CHECK_EQ (result.amlC, 100.);
61 | CHECK_EQ (result.amlT, 100.);
62 | }
63 |
64 | //------------------------------------------------------------
65 | TEST_CASE ("All beats within tolerance window with positive offset and correct period")
66 | {
67 | std::vector annotations;
68 | std::vector beats;
69 | double annotationInterval = 0.5f;
70 |
71 | for (int i = 1; i <= 360; i++)
72 | annotations.push_back (i / 2.);
73 |
74 | for (int i = 0; i < annotations.size(); i++)
75 | beats.push_back (annotations[i] + annotationInterval * 0.1);
76 |
77 | ContinuityResult result = BeatTrackingEvaluationToolbox::evaluateBeatsContinuity (beats, annotations, 0.);
78 | CHECK_EQ (result.cmlC, 100.);
79 | CHECK_EQ (result.cmlT, 100.);
80 | CHECK_EQ (result.amlC, 100.);
81 | CHECK_EQ (result.amlT, 100.);
82 | }
83 |
84 | //------------------------------------------------------------
85 | TEST_CASE ("All beats within tolerance window with negative offset and correct period")
86 | {
87 | std::vector annotations;
88 | std::vector beats;
89 | double annotationInterval = 0.5f;
90 |
91 | for (int i = 1; i <= 360; i++)
92 | annotations.push_back (i / 2.);
93 |
94 | for (int i = 0; i < annotations.size(); i++)
95 | beats.push_back (annotations[i] - annotationInterval * 0.1);
96 |
97 | ContinuityResult result = BeatTrackingEvaluationToolbox::evaluateBeatsContinuity (beats, annotations, 0.);
98 | CHECK_EQ (result.cmlC, 100.);
99 | CHECK_EQ (result.cmlT, 100.);
100 | CHECK_EQ (result.amlC, 100.);
101 | CHECK_EQ (result.amlT, 100.);
102 | }
103 |
104 | //------------------------------------------------------------
105 | TEST_CASE ("All beats outside of tolerance window with positive offset and correct period")
106 | {
107 | std::vector annotations;
108 | std::vector beats;
109 | double annotationInterval = 0.5f;
110 |
111 | for (int i = 1; i <= 360; i++)
112 | annotations.push_back (i / 2.);
113 |
114 | for (int i = 0; i < annotations.size(); i++)
115 | beats.push_back (annotations[i] + annotationInterval * 0.2);
116 |
117 | ContinuityResult result = BeatTrackingEvaluationToolbox::evaluateBeatsContinuity (beats, annotations, 0.);
118 | CHECK_EQ (result.cmlC, 0.);
119 | CHECK_EQ (result.cmlT, 0.);
120 | CHECK_EQ (result.amlC, 0.);
121 | CHECK_EQ (result.amlT, 0.);
122 | }
123 |
124 | //------------------------------------------------------------
125 | TEST_CASE ("All beats outside of tolerance window with negative offset and correct period")
126 | {
127 | std::vector annotations;
128 | std::vector beats;
129 | double annotationInterval = 0.5f;
130 |
131 | for (int i = 1; i <= 360; i++)
132 | annotations.push_back (i / 2.);
133 |
134 | for (int i = 0; i < annotations.size(); i++)
135 | beats.push_back (annotations[i] - annotationInterval * 0.2);
136 |
137 | ContinuityResult result = BeatTrackingEvaluationToolbox::evaluateBeatsContinuity (beats, annotations, 0.);
138 | CHECK_EQ (result.cmlC, 0.);
139 | CHECK_EQ (result.cmlT, 0.);
140 | CHECK_EQ (result.amlC, 0.);
141 | CHECK_EQ (result.amlT, 0.);
142 | }
143 |
144 | //------------------------------------------------------------
145 | TEST_CASE ("All beats within tolerance window but violating period condition")
146 | {
147 | std::vector annotations;
148 | std::vector beats;
149 | double annotationInterval = 0.5f;
150 |
151 | for (int i = 1; i <= 360; i++)
152 | annotations.push_back (i / 2.);
153 |
154 | for (int i = 0; i < annotations.size(); i++)
155 | {
156 | if (i % 2 == 0)
157 | beats.push_back (annotations[i] + annotationInterval * 0.1);
158 | else
159 | beats.push_back (annotations[i] - annotationInterval * 0.1);
160 | }
161 |
162 | ContinuityResult result = BeatTrackingEvaluationToolbox::evaluateBeatsContinuity (beats, annotations, 0.);
163 | CHECK_EQ (result.cmlC, 0.);
164 | CHECK_EQ (result.cmlT, 0.);
165 | CHECK_EQ (result.amlC, 0.);
166 | CHECK_EQ (result.amlT, 0.);
167 | }
168 | }
169 |
--------------------------------------------------------------------------------
/doc/html/md__r_e_a_d_m_e.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Beat Tracking Evaluation Toolbox: Beat Tracking Evaluation Toolbox
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Beat Tracking Evaluation Toolbox
25 | v1.0
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
60 |
61 |
66 |
67 |
68 |
69 |
72 |
73 |
74 |
75 |
79 |
80 |
This is a Python implementation of a number of beat tracking evaluation methods, described in a summary paper:
81 |
82 | Evaluation Methods for Musical Audio Beat Tracking Algorithms, Matthew E. P. Davies, Norberto Degara and Mark D. Plumbley, Technical Report C4DM-TR-09-06, 2009
83 |
84 |
License
85 |
The MIT License (MIT)
86 |
Copyright (c) 2012 Matthew Davies and Adam Stark
87 |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
88 |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
89 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
90 |
Running the code
91 |
First, import the library:
92 |
import beat_evaluation_toolbox as be
93 | Then, evaluate beat estimations on database of beat annotaions as follows:
94 |
R = be.evaluate_db(annotations,beats,measures,doCI)
95 | where the arguments are as follows:
96 |
97 | 'annotations' is a list of numpy arrays containing the beat annotations for the database
98 | 'beats' is a list of numpy arrays containing the beat estimations for the database
99 | 'measures' is a list of strings indicating which evaluation measures to use. Setting measures='all' calculates all measures. Specific measures can be chosen by setting measures = ['fMeasure','cemgilAcc','gotoAcc','pScore','continuity','infoGain','amlCem'] or a subset thereof.
100 | 'doCI' is a boolean indicating whether or not to calculate confidence intervals
101 |
102 |
and the returned value is:
103 |
104 | 'R' is a dictionary containing all results
105 |
106 |
All results will be printed to the terminal once the evaluation is complete.
107 |
108 |
109 |
114 |
115 |
116 |
--------------------------------------------------------------------------------
/doc/html/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Beat Tracking Evaluation Toolbox: Beat Tracking Evaluation Toolbox - Python
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Beat Tracking Evaluation Toolbox
25 | v1.0
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
60 |
61 |
62 |
67 |
68 |
69 |
70 |
73 |
74 |
75 |
79 |
80 |
This is a Python implementation of a number of beat tracking evaluation methods, described in a summary paper:
81 |
82 | Evaluation Methods for Musical Audio Beat Tracking Algorithms, Matthew E. P. Davies, Norberto Degara and Mark D. Plumbley, Technical Report C4DM-TR-09-06, 2009
83 |
84 |
Software implementation by Matthew Davies and Adam Stark
85 |
Running the code
86 |
First, import the library:
87 |
88 | import beat_evaluation_toolbox as be
89 |
90 |
91 |
Then, evaluate beat estimations on database of beat annotaions as follows:
92 |
93 | R = be.evaluate_db(annotations,beats,measures,doCI)
94 |
95 |
96 |
where the arguments are as follows:
97 |
98 | 'annotations' is a list of numpy arrays containing the beat annotations for the database
99 | 'beats' is a list of numpy arrays containing the beat estimations for the database
100 | 'measures' is a list of strings indicating which evaluation measures to use. Setting measures='all' calculates all measures. Specific measures can be chosen by setting measures = ['fMeasure','cemgilAcc','gotoAcc','pScore','continuity','infoGain','amlCem'] or a subset thereof.
101 | 'doCI' is a boolean indicating whether or not to calculate confidence intervals
102 |
103 |
and the returned value is:
104 |
105 | 'R' is a dictionary containing all results
106 |
107 |
All results will be printed to the terminal once the evaluation is complete.
108 |
License
109 |
The MIT License (MIT)
110 |
Copyright (c) 2012 Matthew Davies and Adam Stark
111 |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
112 |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
113 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
114 |
115 |
116 |
121 |
122 |
123 |
--------------------------------------------------------------------------------
/doc/html/namespacemembers_func.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Beat Tracking Evaluation Toolbox: Namespace Members
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Beat Tracking Evaluation Toolbox
25 | v1.0
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
60 |
66 |
73 |
74 |
75 |
80 |
81 |
82 |
83 |
86 |
87 |
88 |
143 |
144 |
149 |
150 |
151 |
--------------------------------------------------------------------------------
/tests/Test_FMeasure.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "doctest.h"
3 | #include "TestHelpers.h"
4 | #include
5 |
6 | //=============================================================
7 | TEST_SUITE ("FMeasure")
8 | {
9 | //------------------------------------------------------------
10 | TEST_CASE ("Both Empty Sequences")
11 | {
12 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (std::vector(), std::vector());
13 |
14 | CHECK_EQ (result.fMeasure, 0.0);
15 | CHECK_EQ (result.precision, 0.0);
16 | CHECK_EQ (result.recall, 0.0);
17 | CHECK_EQ (result.accuracy, 0.0);
18 | }
19 |
20 | //------------------------------------------------------------
21 | TEST_CASE ("Empty Beat Sequence")
22 | {
23 | std::vector annotations;
24 |
25 | for (int i = 1; i <= 360; i++)
26 | annotations.push_back (i / 2.);
27 |
28 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (std::vector(), annotations);
29 |
30 | CHECK_EQ (result.fMeasure, 0.0);
31 | CHECK_EQ (result.precision, 0.0);
32 | CHECK_EQ (result.recall, 0.0);
33 | CHECK_EQ (result.accuracy, 0.0);
34 | }
35 |
36 | //------------------------------------------------------------
37 | TEST_CASE ("Empty Annotation Sequence")
38 | {
39 | std::vector beats;
40 |
41 | for (int i = 1; i <= 360; i++)
42 | beats.push_back (i / 2.);
43 |
44 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, std::vector());
45 |
46 | CHECK_EQ (result.fMeasure, 0.0);
47 | CHECK_EQ (result.precision, 0.0);
48 | CHECK_EQ (result.recall, 0.0);
49 | CHECK_EQ (result.accuracy, 0.0);
50 | }
51 |
52 | //------------------------------------------------------------
53 | TEST_CASE ("Identical Sequences")
54 | {
55 | std::vector beats;
56 |
57 | for (int i = 1; i <= 360; i++)
58 | beats.push_back (i / 2.);
59 |
60 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, beats);
61 |
62 | CHECK_EQ (result.fMeasure, 100.0);
63 | CHECK_EQ (result.precision, 100.0);
64 | CHECK_EQ (result.recall, 100.0);
65 | CHECK_EQ (result.accuracy, 100.0);
66 | }
67 |
68 | //------------------------------------------------------------
69 | TEST_CASE ("All beats within tolerance window")
70 | {
71 | std::vector annotations;
72 | std::vector beats;
73 |
74 | for (int i = 1; i <= 360; i++)
75 | annotations.push_back (i / 2.);
76 |
77 | for (int i = 0; i < annotations.size(); i++)
78 | beats.push_back (annotations[i] + randomPositiveOrNegativeOffset (0., 0.06));
79 |
80 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations, 0.07, 0.);
81 |
82 | CHECK_EQ (result.fMeasure, 100.0);
83 | CHECK_EQ (result.precision, 100.0);
84 | CHECK_EQ (result.recall, 100.0);
85 | CHECK_EQ (result.accuracy, 100.0);
86 | }
87 |
88 | //------------------------------------------------------------
89 | TEST_CASE ("All beats outside tolerance window")
90 | {
91 | std::vector annotations;
92 | std::vector beats;
93 |
94 | for (int i = 1; i <= 360; i++)
95 | annotations.push_back (i / 2.);
96 |
97 | for (int i = 0; i < annotations.size(); i++)
98 | beats.push_back (annotations[i] + randomPositiveOrNegativeOffset (0.071, 0.1));
99 |
100 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations);
101 |
102 | CHECK_EQ (result.fMeasure, 0.0);
103 | CHECK_EQ (result.precision, 0.0);
104 | CHECK_EQ (result.recall, 0.0);
105 | CHECK_EQ (result.accuracy, 0.0);
106 | }
107 |
108 | //------------------------------------------------------------
109 | TEST_CASE ("All beats on the offbeat")
110 | {
111 | std::vector annotations;
112 | std::vector beats;
113 |
114 | for (int i = 1; i <= 360; i++)
115 | annotations.push_back (i / 2.);
116 |
117 | for (int i = 0; i < annotations.size(); i++)
118 | beats.push_back (annotations[i] + 0.25);
119 |
120 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations);
121 |
122 | CHECK_EQ (result.fMeasure, 0.0);
123 | CHECK_EQ (result.precision, 0.0);
124 | CHECK_EQ (result.recall, 0.0);
125 | CHECK_EQ (result.accuracy, 0.0);
126 | }
127 |
128 | //------------------------------------------------------------
129 | TEST_CASE ("Double speed")
130 | {
131 | std::vector annotations;
132 | std::vector beats;
133 |
134 | for (int i = 1; i <= 360; i++)
135 | annotations.push_back (i / 2.);
136 |
137 | for (int i = 0; i < annotations.size(); i++)
138 | {
139 | beats.push_back (annotations[i]);
140 | beats.push_back (annotations[i] + 0.25);
141 | }
142 |
143 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations);
144 |
145 | CHECK (result.fMeasure == doctest::Approx (66.6666666667).epsilon (0.0001));
146 | CHECK_EQ (result.precision, 50.0);
147 | CHECK_EQ (result.recall, 100.0);
148 | CHECK_EQ (result.accuracy, 50.0);
149 | }
150 |
151 | //------------------------------------------------------------
152 | TEST_CASE ("Half speed")
153 | {
154 | std::vector annotations;
155 | std::vector beats;
156 |
157 | for (int i = 1; i <= 360; i++)
158 | annotations.push_back (i / 2.);
159 |
160 | for (int i = 0; i < annotations.size(); i += 2)
161 | beats.push_back (annotations[i]);
162 |
163 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations, 0.07, 0.);
164 |
165 | CHECK (result.fMeasure == doctest::Approx (66.6666666667).epsilon (0.0001));
166 | CHECK_EQ (result.precision, 100.0);
167 | CHECK_EQ (result.recall, 50.0);
168 | CHECK_EQ (result.accuracy, 50.0);
169 | }
170 |
171 | //------------------------------------------------------------
172 | TEST_CASE ("Multiple correct beats per annotation")
173 | {
174 | std::vector annotations;
175 | std::vector beats;
176 |
177 | for (int i = 1; i <= 360; i++)
178 | annotations.push_back (i / 2.);
179 |
180 | for (int i = 0; i < annotations.size(); i++)
181 | {
182 | beats.push_back (annotations[i]);
183 | beats.push_back (annotations[i] + 0.01);
184 | beats.push_back (annotations[i] - 0.01);
185 | }
186 |
187 | FMeasureResult result = BeatTrackingEvaluationToolbox::evaluateBeatsFMeasure (beats, annotations, 0.07, 0.);
188 |
189 | CHECK (result.fMeasure == doctest::Approx (50).epsilon (0.0001));
190 | CHECK (result.precision == doctest::Approx (33.333333333).epsilon (0.0001));
191 | CHECK_EQ (result.recall, 100.0);
192 | CHECK (result.accuracy == doctest::Approx (33.333333333).epsilon (0.0001));
193 | }
194 | }
195 |
--------------------------------------------------------------------------------
/doc/html/namespacemembers_vars.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Beat Tracking Evaluation Toolbox: Namespace Members
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Beat Tracking Evaluation Toolbox
25 | v1.0
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
60 |
66 |
73 |
74 |
75 |
80 |
81 |
82 |
83 |
86 |
87 |
88 |
143 |
144 |
149 |
150 |
151 |
--------------------------------------------------------------------------------
/tests/Test_CemgilAccuracy.cpp:
--------------------------------------------------------------------------------
1 |
2 | #include "doctest.h"
3 | #include "TestHelpers.h"
4 | #include "TestSignals.h"
5 | #include
6 |
7 | //=============================================================
8 | TEST_SUITE ("Cemgil Accuracy")
9 | {
10 | //------------------------------------------------------------
11 | TEST_CASE ("Both Empty Sequences")
12 | {
13 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsCemgilAccuracy (std::vector(), std::vector(), 0.04, 0.);
14 | CHECK_EQ (result, 0.0);
15 | }
16 |
17 | //------------------------------------------------------------
18 | TEST_CASE ("Empty Beat Sequence")
19 | {
20 | std::vector annotations;
21 |
22 | for (int i = 1; i <= 360; i++)
23 | annotations.push_back (i / 2.);
24 |
25 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsCemgilAccuracy (std::vector(), annotations, 0.04, 0.);
26 | CHECK_EQ (result, 0.0);
27 | }
28 |
29 | //------------------------------------------------------------
30 | TEST_CASE ("Empty Annotation Sequence")
31 | {
32 | std::vector beats;
33 |
34 | for (int i = 1; i <= 360; i++)
35 | beats.push_back (i / 2.);
36 |
37 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsCemgilAccuracy (beats, std::vector(), 0.04, 0.);
38 | CHECK_EQ (result, 0.0);
39 | }
40 |
41 | //------------------------------------------------------------
42 | TEST_CASE ("Identical Sequences")
43 | {
44 | std::vector beats;
45 |
46 | for (int i = 1; i <= 360; i++)
47 | beats.push_back (i / 2.);
48 |
49 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsCemgilAccuracy (beats, beats, 0.04, 0.);
50 |
51 | CHECK_EQ (result, 100.0);
52 | }
53 |
54 | //------------------------------------------------------------
55 | double getCemgilAccuracyForBeatsWithOffsetInMilliseconds (double offsetInMilliseconds)
56 | {
57 | const double offsetInSeconds = offsetInMilliseconds / 1000.;
58 |
59 | std::vector annotations;
60 | std::vector beats;
61 |
62 | for (int i = 1; i <= 360; i++)
63 | annotations.push_back (i / 2.);
64 |
65 | for (int i = 0; i < annotations.size(); i++)
66 | beats.push_back (annotations[i] + randomSign() * offsetInSeconds);
67 |
68 | return BeatTrackingEvaluationToolbox::evaluateBeatsCemgilAccuracy (beats, annotations, 0.04, 0.);
69 | }
70 |
71 | //------------------------------------------------------------
72 | TEST_CASE ("All beats outside tolerance window by 200ms")
73 | {
74 | double result = getCemgilAccuracyForBeatsWithOffsetInMilliseconds (200.0);
75 | CHECK (result == doctest::Approx (0.00037266531720786647).epsilon (0.0001));
76 | }
77 |
78 | //------------------------------------------------------------
79 | TEST_CASE ("All beats outside tolerance window by 150ms")
80 | {
81 | double result = getCemgilAccuracyForBeatsWithOffsetInMilliseconds (150.0);
82 | CHECK (result == doctest::Approx (0.08838263069350508).epsilon (0.0001));
83 | }
84 |
85 | //------------------------------------------------------------
86 | TEST_CASE ("All beats outside tolerance window by 100ms")
87 | {
88 | double result = getCemgilAccuracyForBeatsWithOffsetInMilliseconds (100.0);
89 | CHECK (result == doctest::Approx (4.39369336234074).epsilon (0.0001));
90 | }
91 |
92 | //------------------------------------------------------------
93 | TEST_CASE ("All beats outside tolerance window by 50ms")
94 | {
95 | double result = getCemgilAccuracyForBeatsWithOffsetInMilliseconds (50.0);
96 | CHECK (result == doctest::Approx (45.783336177161424).epsilon (0.0001));
97 | }
98 |
99 | //------------------------------------------------------------
100 | TEST_CASE ("All beats outside tolerance window by 25ms")
101 | {
102 | double result = getCemgilAccuracyForBeatsWithOffsetInMilliseconds (25.0);
103 | CHECK (result == doctest::Approx (82.25775623986645).epsilon (0.0001));
104 | }
105 |
106 | //------------------------------------------------------------
107 | TEST_CASE ("All beats outside tolerance window by 20ms")
108 | {
109 | double result = getCemgilAccuracyForBeatsWithOffsetInMilliseconds (20.0);
110 | CHECK (result == doctest::Approx (88.24969025845955).epsilon (0.0001));
111 | }
112 |
113 | //------------------------------------------------------------
114 | TEST_CASE ("All beats outside tolerance window by 15ms")
115 | {
116 | double result = getCemgilAccuracyForBeatsWithOffsetInMilliseconds (15.0);
117 | CHECK (result == doctest::Approx (93.21024923595276).epsilon (0.0001));
118 | }
119 |
120 | //------------------------------------------------------------
121 | TEST_CASE ("All beats outside tolerance window by 10ms")
122 | {
123 | double result = getCemgilAccuracyForBeatsWithOffsetInMilliseconds (10.0);
124 | CHECK (result == doctest::Approx (96.92332344763442).epsilon (0.0001));
125 | }
126 |
127 | //------------------------------------------------------------
128 | TEST_CASE ("All beats outside tolerance window by 5ms")
129 | {
130 | double result = getCemgilAccuracyForBeatsWithOffsetInMilliseconds (5.0);
131 | CHECK (result == doctest::Approx (99.22179382602435).epsilon (0.0001));
132 | }
133 |
134 | //------------------------------------------------------------
135 | TEST_CASE ("All beats on the offbeat")
136 | {
137 | std::vector annotations;
138 | std::vector beats;
139 |
140 | for (int i = 1; i <= 360; i++)
141 | annotations.push_back (i / 2.);
142 |
143 | for (int i = 0; i < annotations.size(); i++)
144 | beats.push_back (annotations[i] + 0.25);
145 |
146 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsCemgilAccuracy (beats, annotations, 0.04, 0.);
147 |
148 | CHECK (result == doctest::Approx (0.).epsilon (0.0001));
149 | }
150 |
151 | //------------------------------------------------------------
152 | TEST_CASE ("Double speed")
153 | {
154 | std::vector annotations;
155 | std::vector beats;
156 |
157 | for (int i = 1; i <= 360; i++)
158 | annotations.push_back (i / 2.);
159 |
160 | for (int i = 0; i < annotations.size(); i++)
161 | {
162 | beats.push_back (annotations[i]);
163 | beats.push_back (annotations[i] + 0.25);
164 | }
165 |
166 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsCemgilAccuracy (beats, annotations, 0.04, 0.);
167 |
168 | CHECK (result == doctest::Approx (66.66666667).epsilon (0.0001));
169 | }
170 |
171 | //------------------------------------------------------------
172 | TEST_CASE ("Half speed")
173 | {
174 | std::vector annotations;
175 | std::vector beats;
176 |
177 | for (int i = 1; i <= 360; i++)
178 | annotations.push_back (i / 2.);
179 |
180 | for (int i = 0; i < annotations.size(); i += 2)
181 | beats.push_back (annotations[i]);
182 |
183 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsCemgilAccuracy (beats, annotations, 0.04, 0.);
184 |
185 | CHECK (result == doctest::Approx (66.66666667).epsilon (0.0001));
186 | }
187 |
188 | //------------------------------------------------------------
189 | TEST_CASE ("Sample Sequence 1 - Compare to MADMOM")
190 | {
191 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsCemgilAccuracy (examples::beats1, examples::annotations1, 0.04, 0.);
192 | CHECK (result == doctest::Approx (85.82089134179277).epsilon (0.0001));
193 | }
194 |
195 | //------------------------------------------------------------
196 | TEST_CASE ("Sample Sequence 2 - Compare to MADMOM")
197 | {
198 | double result = BeatTrackingEvaluationToolbox::evaluateBeatsCemgilAccuracy (examples::beats2, examples::annotations2, 0.04, 0.);
199 | CHECK (result == doctest::Approx (70.2781695147737).epsilon (0.0001));
200 | }
201 |
202 |
203 | }
204 |
--------------------------------------------------------------------------------
/doc/html/namespacemembers.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | Beat Tracking Evaluation Toolbox: Namespace Members
7 |
8 |
9 |
10 |
11 |
12 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 | Beat Tracking Evaluation Toolbox
25 | v1.0
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
37 |
60 |
66 |
73 |
74 |
75 | a
76 | b
77 | c
78 | d
79 | e
80 | f
81 | g
82 | i
83 | m
84 | p
85 |
86 |
87 |
88 |
89 |
94 |
95 |
96 |
97 |
100 |
101 |
102 |
103 |
Here is a list of all documented namespace members with links to the namespaces they belong to:
104 |
105 |
- a -
110 |
111 |
112 |
- b -
120 |
121 |
122 |
- c -
151 |
152 |
153 |
- d -
164 |
165 |
166 |
- e -
174 |
175 |
176 |
- f -
190 |
191 |
192 |
- g -
218 |
219 |
220 |
- i -
228 |
229 |
230 |
- m -
235 |
236 |
237 |
- p -
245 |
246 |
247 |
252 |
253 |
254 |
--------------------------------------------------------------------------------
/src/BeatTrackingEvaluationToolbox.h:
--------------------------------------------------------------------------------
1 | //=======================================================================
2 | /**
3 | * Beat Tracking Evaluation Toolbox (C++)
4 | *
5 | * @copyright (c) 2016 Adam Stark
6 | *
7 | * License: The MIT License (MIT)
8 | *
9 | * Permission is hereby granted, free of charge, to any person obtaining a copy
10 | * of this software and associated documentation files (the "Software"), to deal
11 | * in the Software without restriction, including without limitation the rights
12 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13 | * copies of the Software, and to permit persons to whom the Software is
14 | * furnished to do so, subject to the following conditions:
15 | *
16 | * The above copyright notice and this permission notice shall be included in
17 | * all copies or substantial portions of the Software.
18 | *
19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | * THE SOFTWARE.
26 | */
27 | //=======================================================================
28 |
29 | #include
30 | #include
31 | #include
32 | #include
33 | #include
34 |
35 | //==========================================================================================
36 | /** */
37 | struct ContinuityResult
38 | {
39 | double cmlC = 0.;
40 | double cmlT = 0.;
41 | double amlC = 0.;
42 | double amlT = 0.;
43 | };
44 |
45 | //==========================================================================================
46 | /** */
47 | struct FMeasureResult
48 | {
49 | double fMeasure = 0.;
50 | double precision = 0.;
51 | double recall = 0.;
52 | double accuracy = 0.;
53 | };
54 |
55 | //==========================================================================================
56 | /** */
57 | class BeatTrackingEvaluationToolbox
58 | {
59 | public:
60 | //==========================================================================================
61 | /** Evaluates a given beat sequence against some ground annotation on all evaluation measures
62 | * and returns the results in a vector
63 | * @param beats sequence of estimated beat times (in seconds)
64 | * @param annotations sequence of ground truth beat annotations (in seconds)
65 | */
66 | static std::vector evaluate (std::vector beats, std::vector annotations);
67 |
68 | //==========================================================================================
69 | /** Calculates continuity based accuracy values as used in (Hainsworth, 2004) and (Klapuri et al, 2006)
70 | * @param beats sequence of estimated beat times (in seconds)
71 | * @param annotations sequence of ground truth beat annotations (in seconds)
72 | *
73 | * @returns a ContinuityResult struct containing scores for:
74 | *
75 | * cmlC - beat tracking accuracy, continuity required at the correct metrical level
76 | * cmlT - beat tracking accuracy, continuity not required at the correct metrical level
77 | * amlC - beat tracking accuracy, continuity required at allowed metrical levels
78 | * amlT - beat tracking accuracy, continuity not required at allowed metrical levels
79 | *
80 | * References:
81 | * -----------
82 | * - S. Hainsworth, "Techniques for the automated analysis of musical audio," Ph.D. dissertation, Department of Engineering, Cambridge University, 2004.
83 | * - A. P. Klapuri, A. Eronen, and J. Astola, "Analysis of the meter of acoustic musical signals," IEEE Transactions on Audio, Speech and Language Processing, vol. 14, no. 1, pp. 342-355, 2006.
84 | */
85 | static ContinuityResult evaluateBeatsContinuity (std::vector beats, std::vector annotations, double earliestBeatTimeToConsiderInSeconds = 5.);
86 |
87 | //==========================================================================================
88 | /** Calculates the F-Measure as used in (Dixon, 2006) and (Dixon, 2007).
89 | * @param beats sequence of estimated beat times (in seconds)
90 | * @param annotations sequence of ground truth beat annotations (in seconds)
91 | * @param toleranceWindowInSeconds tolerance window in seconds either side of a beat that determines a correct detection
92 | * @param earliestBeatTimeToConsiderInSeconds only beat times after this time will be considered for evaluation
93 | *
94 | * @Returns a struct containing the F-Measure score for the beat sequence given the annotations and related measures
95 | *
96 | * References:
97 | * ------------
98 | * - S. Dixon, "Automatic extraction of tempo and beat from expressive performances," Journal of New Music Research, vol. 30, pp. 39-58, 2001.
99 | * - S. Dixon, "Onset detection revisited," in Proceedings of 9th International Conference on Digital Audio Effects (DAFx), Montreal, Canada, pp. 133-137, 2006.
100 | * - S. Dixon, "Evaluation of audio beat tracking system beatroot," Journal of New Music Research, vol. 36, no. 1, pp. 39-51, 2007.
101 | */
102 | static FMeasureResult evaluateBeatsFMeasure (std::vector beats, std::vector annotations, double toleranceWindowInSeconds = 0.07, double earliestBeatTimeToConsiderInSeconds = 5.);
103 |
104 | //==========================================================================================
105 | /** Calculate the PScore accuracy value as used in McKinney et al, 2007.
106 | * @param beats sequence of estimated beat times (in seconds)
107 | * @param annotations sequence of ground truth beat annotations (in seconds)
108 | *
109 | * @returns PScore estimate of beat tracking accuracy
110 | *
111 | * References:
112 | * ------------
113 | * - M. F. McKinney, D. Moelants, M. E. P. Davies, and A. Klapuri, "Evaluation of audio beat tracking and music tempo extraction algorithms," Journal of New Music Research, vol. 36, no. 1, pp. 1-16, 2007.
114 | */
115 | static double evaluateBeatsPScore (std::vector beats, std::vector annotations, double threshold = 0.2, double earliestBeatTimeToConsiderInSeconds = 5.);
116 |
117 | //================================== Goto Accuracy =====================================
118 | /** Calculate the Goto and Muraoka's accuracy value as used in (Goto and Muraoka, 1997).
119 | * @param beats sequence of ground truth beat annotations (in seconds)
120 | * @param annotations sequence of estimated beat times (in seconds)
121 | *
122 | * @returns Goto beat tracking accuracy
123 | *
124 | * References:
125 | * ------------
126 | * - M. Goto and Y. Muraoka, "Issues in evaluating beat tracking systems," in Working Notes of the IJCAI-97 Workshop on Issues in AI and Music - Evaluation and Assessment, 1997, pp. 9-16.
127 | */
128 | static double evaluateBeatsGoto (std::vector beats, std::vector annotations, double threshold = 0.35, double mu = 0.2, double sigma = 0.2);
129 |
130 | //==========================================================================================
131 | /** Calculates the Cemgil et al's accuracy value as used in (Cemgil et al, 2001).
132 | * @param beats sequence of estimated beat times (in seconds)
133 | * @param annotations sequence of ground truth beat annotations (in seconds)
134 | * @param sigma the time in seconds used to calculate the Gaussian error function
135 | * @param earliestBeatTimeToConsiderInSeconds only beat times after this time will be considered for evaluation
136 | *
137 | * @Returns the beat tracking accuracy
138 | *
139 | * References:
140 | * -----------
141 | * - A. T. Cemgil, B. Kappen, P. Desain, and H. Honing, "On tempo tracking: Tempogram representation and Kalman filtering," Journal Of New Music Research, vol. 28, no. 4, pp. 259-273, 2001
142 | */
143 | static double evaluateBeatsCemgilAccuracy (std::vector beats, std::vector annotations, double sigma = 0.04, double earliestBeatTimeToConsiderInSeconds = 5.);
144 |
145 | //==========================================================================================
146 | /** Calculates Cemgil accuracy but allowing for continuity-based allowed metrical levels
147 | * @param beats sequence of estimated beat times (in seconds)
148 | * @param annotations sequence of ground truth beat annotations (in seconds)
149 | *
150 | * @returns Cemgiil beat tracking accuracy given allowed metrical levels
151 | *
152 | * References:
153 | * ------------
154 | * - "Musicians and Machines: Bridging the Semantic Gap in Live Performance", Adam Stark, PhD Thesis, 2011, Chapter 3
155 | */
156 | static double evaluateBeatsAmlCemgilAccuracy (std::vector beats, std::vector annotations, double sigma = 0.04);
157 |
158 | //================================== Information Gain ===============================
159 | /** Calculates the information gain as used in (Davies et al, 2010).
160 | * @param anns sequence of ground truth beat annotations (in seconds)
161 | * @param beats sequence of estimated beat times (in seconds)
162 | *
163 | * @returns beat tracking information gain
164 | *
165 | * References:
166 | * ------------
167 | * - M. E. P. Davies, N. Degara and M. D. Plumbley, "Measuring the performance of beat tracking algorithms algorithms using a beat error histogram," accepted to IEE Signal Processing Letters.
168 | */
169 | static double evaluateBeatsInformationGain (std::vector beats, std::vector annotations, int numHistogramBins = 40);
170 |
171 |
172 | private:
173 |
174 | //==========================================================================================
175 | struct ContinuityEvaluationScores
176 | {
177 | double totalAccuracy = 0.;
178 | double continuityAccuracy = 0.;
179 | };
180 |
181 | //==========================================================================================
182 | static double sumOfCrossCorrelation (std::vector v1, std::vector v2, int maximumLag);
183 | static ContinuityEvaluationScores continutityEvaluation (std::vector beats, std::vector annotations, double phaseThreshold = 0.175, double periodThreshold = 0.175);
184 | static std::vector createSetOfAnnotationsAtdoubleTempo (std::vector annotations);
185 | static std::vector getEveryOtherAnnotationStartingAtIndex (std::vector annotations, int startIndex);
186 | static std::vector getIndicesOfNonZeroElements (std::vector array);
187 | static std::vector removeIfLessThanValue (std::vector array, double value);
188 | static void removeElementsLessThanValue (std::vector& array, double value);
189 | static double medianOfVector (std::vector vector);
190 | static int getIndexOfNearestElement (std::vector array, double value);
191 |
192 | //==========================================================================================
193 | // Information Gain methods
194 | static std::vector findBeatError (std::vector beats, std::vector annotations);
195 | static std::vector calculateBeatErrorHistogram (std::vector beatError, std::vector histogramBins);
196 | static double findEntropy (std::vector beatErrorHistogram);
197 |
198 | //==========================================================================================
199 | template
200 | static double meanOfVector (std::vector vector);
201 |
202 | //==========================================================================================
203 | template
204 | static T maxElement (std::vector array);
205 |
206 | //==========================================================================================
207 | template
208 | static int argMax (std::vector array);
209 | };
210 |
--------------------------------------------------------------------------------
/doc/html/search/search.js:
--------------------------------------------------------------------------------
1 | // Search script generated by doxygen
2 | // Copyright (C) 2009 by Dimitri van Heesch.
3 |
4 | // The code in this file is loosly based on main.js, part of Natural Docs,
5 | // which is Copyright (C) 2003-2008 Greg Valure
6 | // Natural Docs is licensed under the GPL.
7 |
8 | var indexSectionsWithContent =
9 | {
10 | 0: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111101000100100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
11 | 1: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
12 | 2: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000111111101000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
13 | 3: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001101101000100100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
14 | 4: "0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000"
15 | };
16 |
17 | var indexSectionNames =
18 | {
19 | 0: "all",
20 | 1: "namespaces",
21 | 2: "functions",
22 | 3: "variables",
23 | 4: "pages"
24 | };
25 |
26 | function convertToId(search)
27 | {
28 | var result = '';
29 | for (i=0;i do a search
287 | {
288 | this.Search();
289 | }
290 | }
291 |
292 | this.OnSearchSelectKey = function(evt)
293 | {
294 | var e = (evt) ? evt : window.event; // for IE
295 | if (e.keyCode==40 && this.searchIndex0) // Up
301 | {
302 | this.searchIndex--;
303 | this.OnSelectItem(this.searchIndex);
304 | }
305 | else if (e.keyCode==13 || e.keyCode==27)
306 | {
307 | this.OnSelectItem(this.searchIndex);
308 | this.CloseSelectionWindow();
309 | this.DOMSearchField().focus();
310 | }
311 | return false;
312 | }
313 |
314 | // --------- Actions
315 |
316 | // Closes the results window.
317 | this.CloseResultsWindow = function()
318 | {
319 | this.DOMPopupSearchResultsWindow().style.display = 'none';
320 | this.DOMSearchClose().style.display = 'none';
321 | this.Activate(false);
322 | }
323 |
324 | this.CloseSelectionWindow = function()
325 | {
326 | this.DOMSearchSelectWindow().style.display = 'none';
327 | }
328 |
329 | // Performs a search.
330 | this.Search = function()
331 | {
332 | this.keyTimeout = 0;
333 |
334 | // strip leading whitespace
335 | var searchValue = this.DOMSearchField().value.replace(/^ +/, "");
336 |
337 | var code = searchValue.toLowerCase().charCodeAt(0);
338 | var hexCode;
339 | if (code<16)
340 | {
341 | hexCode="0"+code.toString(16);
342 | }
343 | else
344 | {
345 | hexCode=code.toString(16);
346 | }
347 |
348 | var resultsPage;
349 | var resultsPageWithSearch;
350 | var hasResultsPage;
351 |
352 | if (indexSectionsWithContent[this.searchIndex].charAt(code) == '1')
353 | {
354 | resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';
355 | resultsPageWithSearch = resultsPage+'?'+escape(searchValue);
356 | hasResultsPage = true;
357 | }
358 | else // nothing available for this search term
359 | {
360 | resultsPage = this.resultsPath + '/nomatches.html';
361 | resultsPageWithSearch = resultsPage;
362 | hasResultsPage = false;
363 | }
364 |
365 | window.frames.MSearchResults.location = resultsPageWithSearch;
366 | var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
367 |
368 | if (domPopupSearchResultsWindow.style.display!='block')
369 | {
370 | var domSearchBox = this.DOMSearchBox();
371 | this.DOMSearchClose().style.display = 'inline';
372 | if (this.insideFrame)
373 | {
374 | var domPopupSearchResults = this.DOMPopupSearchResults();
375 | domPopupSearchResultsWindow.style.position = 'relative';
376 | domPopupSearchResultsWindow.style.display = 'block';
377 | var width = document.body.clientWidth - 8; // the -8 is for IE :-(
378 | domPopupSearchResultsWindow.style.width = width + 'px';
379 | domPopupSearchResults.style.width = width + 'px';
380 | }
381 | else
382 | {
383 | var domPopupSearchResults = this.DOMPopupSearchResults();
384 | var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth;
385 | var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1;
386 | domPopupSearchResultsWindow.style.display = 'block';
387 | left -= domPopupSearchResults.offsetWidth;
388 | domPopupSearchResultsWindow.style.top = top + 'px';
389 | domPopupSearchResultsWindow.style.left = left + 'px';
390 | }
391 | }
392 |
393 | this.lastSearchValue = searchValue;
394 | this.lastResultsPage = resultsPage;
395 | }
396 |
397 | // -------- Activation Functions
398 |
399 | // Activates or deactivates the search panel, resetting things to
400 | // their default values if necessary.
401 | this.Activate = function(isActive)
402 | {
403 | if (isActive || // open it
404 | this.DOMPopupSearchResultsWindow().style.display == 'block'
405 | )
406 | {
407 | this.DOMSearchBox().className = 'MSearchBoxActive';
408 |
409 | var searchField = this.DOMSearchField();
410 |
411 | if (searchField.value == this.searchLabel) // clear "Search" term upon entry
412 | {
413 | searchField.value = '';
414 | this.searchActive = true;
415 | }
416 | }
417 | else if (!isActive) // directly remove the panel
418 | {
419 | this.DOMSearchBox().className = 'MSearchBoxInactive';
420 | this.DOMSearchField().value = this.searchLabel;
421 | this.searchActive = false;
422 | this.lastSearchValue = ''
423 | this.lastResultsPage = '';
424 | }
425 | }
426 | }
427 |
428 | // -----------------------------------------------------------------------
429 |
430 | // The class that handles everything on the search results page.
431 | function SearchResults(name)
432 | {
433 | // The number of matches from the last run of .
434 | this.lastMatchCount = 0;
435 | this.lastKey = 0;
436 | this.repeatOn = false;
437 |
438 | // Toggles the visibility of the passed element ID.
439 | this.FindChildElement = function(id)
440 | {
441 | var parentElement = document.getElementById(id);
442 | var element = parentElement.firstChild;
443 |
444 | while (element && element!=parentElement)
445 | {
446 | if (element.nodeName == 'DIV' && element.className == 'SRChildren')
447 | {
448 | return element;
449 | }
450 |
451 | if (element.nodeName == 'DIV' && element.hasChildNodes())
452 | {
453 | element = element.firstChild;
454 | }
455 | else if (element.nextSibling)
456 | {
457 | element = element.nextSibling;
458 | }
459 | else
460 | {
461 | do
462 | {
463 | element = element.parentNode;
464 | }
465 | while (element && element!=parentElement && !element.nextSibling);
466 |
467 | if (element && element!=parentElement)
468 | {
469 | element = element.nextSibling;
470 | }
471 | }
472 | }
473 | }
474 |
475 | this.Toggle = function(id)
476 | {
477 | var element = this.FindChildElement(id);
478 | if (element)
479 | {
480 | if (element.style.display == 'block')
481 | {
482 | element.style.display = 'none';
483 | }
484 | else
485 | {
486 | element.style.display = 'block';
487 | }
488 | }
489 | }
490 |
491 | // Searches for the passed string. If there is no parameter,
492 | // it takes it from the URL query.
493 | //
494 | // Always returns true, since other documents may try to call it
495 | // and that may or may not be possible.
496 | this.Search = function(search)
497 | {
498 | if (!search) // get search word from URL
499 | {
500 | search = window.location.search;
501 | search = search.substring(1); // Remove the leading '?'
502 | search = unescape(search);
503 | }
504 |
505 | search = search.replace(/^ +/, ""); // strip leading spaces
506 | search = search.replace(/ +$/, ""); // strip trailing spaces
507 | search = search.toLowerCase();
508 | search = convertToId(search);
509 |
510 | var resultRows = document.getElementsByTagName("div");
511 | var matches = 0;
512 |
513 | var i = 0;
514 | while (i < resultRows.length)
515 | {
516 | var row = resultRows.item(i);
517 | if (row.className == "SRResult")
518 | {
519 | var rowMatchName = row.id.toLowerCase();
520 | rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_'
521 |
522 | if (search.length<=rowMatchName.length &&
523 | rowMatchName.substr(0, search.length)==search)
524 | {
525 | row.style.display = 'block';
526 | matches++;
527 | }
528 | else
529 | {
530 | row.style.display = 'none';
531 | }
532 | }
533 | i++;
534 | }
535 | document.getElementById("Searching").style.display='none';
536 | if (matches == 0) // no results
537 | {
538 | document.getElementById("NoMatches").style.display='block';
539 | }
540 | else // at least one result
541 | {
542 | document.getElementById("NoMatches").style.display='none';
543 | }
544 | this.lastMatchCount = matches;
545 | return true;
546 | }
547 |
548 | // return the first item with index index or higher that is visible
549 | this.NavNext = function(index)
550 | {
551 | var focusItem;
552 | while (1)
553 | {
554 | var focusName = 'Item'+index;
555 | focusItem = document.getElementById(focusName);
556 | if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
557 | {
558 | break;
559 | }
560 | else if (!focusItem) // last element
561 | {
562 | break;
563 | }
564 | focusItem=null;
565 | index++;
566 | }
567 | return focusItem;
568 | }
569 |
570 | this.NavPrev = function(index)
571 | {
572 | var focusItem;
573 | while (1)
574 | {
575 | var focusName = 'Item'+index;
576 | focusItem = document.getElementById(focusName);
577 | if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
578 | {
579 | break;
580 | }
581 | else if (!focusItem) // last element
582 | {
583 | break;
584 | }
585 | focusItem=null;
586 | index--;
587 | }
588 | return focusItem;
589 | }
590 |
591 | this.ProcessKeys = function(e)
592 | {
593 | if (e.type == "keydown")
594 | {
595 | this.repeatOn = false;
596 | this.lastKey = e.keyCode;
597 | }
598 | else if (e.type == "keypress")
599 | {
600 | if (!this.repeatOn)
601 | {
602 | if (this.lastKey) this.repeatOn = true;
603 | return false; // ignore first keypress after keydown
604 | }
605 | }
606 | else if (e.type == "keyup")
607 | {
608 | this.lastKey = 0;
609 | this.repeatOn = false;
610 | }
611 | return this.lastKey!=0;
612 | }
613 |
614 | this.Nav = function(evt,itemIndex)
615 | {
616 | var e = (evt) ? evt : window.event; // for IE
617 | if (e.keyCode==13) return true;
618 | if (!this.ProcessKeys(e)) return false;
619 |
620 | if (this.lastKey==38) // Up
621 | {
622 | var newIndex = itemIndex-1;
623 | var focusItem = this.NavPrev(newIndex);
624 | if (focusItem)
625 | {
626 | var child = this.FindChildElement(focusItem.parentNode.parentNode.id);
627 | if (child && child.style.display == 'block') // children visible
628 | {
629 | var n=0;
630 | var tmpElem;
631 | while (1) // search for last child
632 | {
633 | tmpElem = document.getElementById('Item'+newIndex+'_c'+n);
634 | if (tmpElem)
635 | {
636 | focusItem = tmpElem;
637 | }
638 | else // found it!
639 | {
640 | break;
641 | }
642 | n++;
643 | }
644 | }
645 | }
646 | if (focusItem)
647 | {
648 | focusItem.focus();
649 | }
650 | else // return focus to search field
651 | {
652 | parent.document.getElementById("MSearchField").focus();
653 | }
654 | }
655 | else if (this.lastKey==40) // Down
656 | {
657 | var newIndex = itemIndex+1;
658 | var focusItem;
659 | var item = document.getElementById('Item'+itemIndex);
660 | var elem = this.FindChildElement(item.parentNode.parentNode.id);
661 | if (elem && elem.style.display == 'block') // children visible
662 | {
663 | focusItem = document.getElementById('Item'+itemIndex+'_c0');
664 | }
665 | if (!focusItem) focusItem = this.NavNext(newIndex);
666 | if (focusItem) focusItem.focus();
667 | }
668 | else if (this.lastKey==39) // Right
669 | {
670 | var item = document.getElementById('Item'+itemIndex);
671 | var elem = this.FindChildElement(item.parentNode.parentNode.id);
672 | if (elem) elem.style.display = 'block';
673 | }
674 | else if (this.lastKey==37) // Left
675 | {
676 | var item = document.getElementById('Item'+itemIndex);
677 | var elem = this.FindChildElement(item.parentNode.parentNode.id);
678 | if (elem) elem.style.display = 'none';
679 | }
680 | else if (this.lastKey==27) // Escape
681 | {
682 | parent.searchBox.CloseResultsWindow();
683 | parent.document.getElementById("MSearchField").focus();
684 | }
685 | else if (this.lastKey==13) // Enter
686 | {
687 | return true;
688 | }
689 | return false;
690 | }
691 |
692 | this.NavChild = function(evt,itemIndex,childIndex)
693 | {
694 | var e = (evt) ? evt : window.event; // for IE
695 | if (e.keyCode==13) return true;
696 | if (!this.ProcessKeys(e)) return false;
697 |
698 | if (this.lastKey==38) // Up
699 | {
700 | if (childIndex>0)
701 | {
702 | var newIndex = childIndex-1;
703 | document.getElementById('Item'+itemIndex+'_c'+newIndex).focus();
704 | }
705 | else // already at first child, jump to parent
706 | {
707 | document.getElementById('Item'+itemIndex).focus();
708 | }
709 | }
710 | else if (this.lastKey==40) // Down
711 | {
712 | var newIndex = childIndex+1;
713 | var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex);
714 | if (!elem) // last child, jump to parent next parent
715 | {
716 | elem = this.NavNext(itemIndex+1);
717 | }
718 | if (elem)
719 | {
720 | elem.focus();
721 | }
722 | }
723 | else if (this.lastKey==27) // Escape
724 | {
725 | parent.searchBox.CloseResultsWindow();
726 | parent.document.getElementById("MSearchField").focus();
727 | }
728 | else if (this.lastKey==13) // Enter
729 | {
730 | return true;
731 | }
732 | return false;
733 | }
734 | }
735 |
736 | function setKeyActions(elem,action)
737 | {
738 | elem.setAttribute('onkeydown',action);
739 | elem.setAttribute('onkeypress',action);
740 | elem.setAttribute('onkeyup',action);
741 | }
742 |
743 | function setClassAttr(elem,attr)
744 | {
745 | elem.setAttribute('class',attr);
746 | elem.setAttribute('className',attr);
747 | }
748 |
749 | function createResults()
750 | {
751 | var results = document.getElementById("SRResults");
752 | for (var e=0; e