# HG changeset patch # User Chris Cannam # Date 1400599293 -3600 # Node ID 629c9525b815ff27d07de5f77f4222edfc5ab7ee # Parent 6e9ddd07dc3c748434dc51c11aed31e8d46ce6e8 Some measurements suggest we get slightly better results with more iterations, but not drastically worse with fewer -- so go lower for draft and higher for hq mode diff -r 6e9ddd07dc3c -r 629c9525b815 src/EM.cpp --- a/src/EM.cpp Tue May 20 15:56:57 2014 +0100 +++ b/src/EM.cpp Tue May 20 16:21:33 2014 +0100 @@ -182,12 +182,20 @@ } } - //!!! try normalising so as to sum to unity and then taking L2 - //!!! norm of the two (for measure of how close they are) - for (int i = 0; i < m_binCount; ++i) { m_q[i] = column[i] / m_estimate[i]; } + +/* + double l2norm = 0.0; + + for (int i = 0; i < m_binCount; ++i) { + l2norm += (column[i] - m_estimate[i]) * (column[i] - m_estimate[i]); + } + + l2norm = sqrt(l2norm); + cerr << "l2norm = " << l2norm << endl; +*/ } void diff -r 6e9ddd07dc3c -r 629c9525b815 src/Silvet.cpp --- a/src/Silvet.cpp Tue May 20 15:56:57 2014 +0100 +++ b/src/Silvet.cpp Tue May 20 16:21:33 2014 +0100 @@ -352,7 +352,7 @@ int width = filtered.size(); - int iterations = 12; //!!! more might be good? + int iterations = m_hqMode ? 20 : 10; Grid pitchMatrix(width, vector(processingNotes));