Skip to content
Snippets Groups Projects
Commit 14dd8fad authored by Martin Rusek's avatar Martin Rusek
Browse files

fix: csiChord function updated to work with non standard roots.

parent 667689bb
Branches
No related tags found
No related merge requests found
...@@ -271,7 +271,7 @@ double calcul::distance_dtw_csiChroma(vtr<double> const &u, vtr<double> const &v ...@@ -271,7 +271,7 @@ double calcul::distance_dtw_csiChroma(vtr<double> const &u, vtr<double> const &v
///@param[in] uKey element of the compared key time series (12d vector) ///@param[in] uKey element of the compared key time series (12d vector)
///@param[in] vKey element of the compared key time series (12d vector) ///@param[in] vKey element of the compared key time series (12d vector)
///@return chord distance ///@return chord distance
double calcul::distance_dtw_csiChord(vtr<double> const &u, vtr<double> const &v, vtr<int> const &uKey, vtr<int> const &vKey) double calcul::distance_dtw_csiChord(vtr<double> const &u, vtr<double> const &v, vtr<int> const &uKey, vtr<int> const &vKey)
{ {
auto getRoot = [](vtr<double> const &chord) { auto getRoot = [](vtr<double> const &chord) {
auto getShift = [](int idx) { return idx > 11 ? idx % 12 : idx; }; auto getShift = [](int idx) { return idx > 11 ? idx % 12 : idx; };
...@@ -286,8 +286,21 @@ double calcul::distance_dtw_csiChord(vtr<double> const &u, vtr<double> const &v ...@@ -286,8 +286,21 @@ double calcul::distance_dtw_csiChord(vtr<double> const &u, vtr<double> const &v
} }
} }
//if (chord == vtr<double>{0,0,0,0,0,0,0,0,0,0,0,0}) if (chord == vtr<double>{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0})
return 0;
else {
int c = 0;
for (int i = 0; i < (int)chord.size(); i++)
if (chord[i] > 0) c++;
if (c != 3)
{
cout << print::vector(chord);
return -1;
}
}
//chord = vtr<double>{ 1, 0, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0 }; */
return 0; return 0;
}; };
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment