changeset 1571:5fe24e4af12c spectrogramparam

A little faster as vector
author Chris Cannam
date Thu, 08 Nov 2018 12:56:03 +0000 (2018-11-08)
parents 410819150cd3
children c36ffc195988
files data/model/FFTModel.cpp
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/data/model/FFTModel.cpp	Wed Nov 07 15:46:36 2018 +0000
+++ b/data/model/FFTModel.cpp	Thu Nov 08 12:56:03 2018 +0000
@@ -454,6 +454,7 @@
 
         // so-called median will actually be the dist*100'th percentile
         medianWinSize = getPeakPickWindowSize(type, sampleRate, bin, dist);
+
         halfWin = medianWinSize/2;
 
         while ((int)window.size() > medianWinSize) {
@@ -467,7 +468,7 @@
             else binmax = nv - 1;
         }
 
-        deque<float> sorted(window);
+        vector<float> sorted(window.begin(), window.end());
         sort(sorted.begin(), sorted.end());
         float median = sorted[int(float(sorted.size()) * dist)];