Mercurial > hg > silvet
changeset 48:1a4cab304d68 preshift
Sum rather than max?
author | Chris Cannam |
---|---|
date | Mon, 07 Apr 2014 14:36:52 +0100 |
parents | ccb1a437a828 |
children | ce1d88759557 |
files | notes/transcriptionMultipleTemplates-annotated.m src/Silvet.cpp |
diffstat | 2 files changed, 9 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/notes/transcriptionMultipleTemplates-annotated.m Mon Apr 07 14:18:39 2014 +0100 +++ b/notes/transcriptionMultipleTemplates-annotated.m Mon Apr 07 14:36:52 2014 +0100 @@ -62,17 +62,16 @@ %% transposed X = intCQT(:,round(1:7.1128:size(intCQT,2)))'; -%% median filter to reduce noise -- I think this is essentially the -%% same as Xue's method for devuvuzelation +%% median filter to remove broadband noise (i.e we filter across +%% frequency rather than time) noiseLevel1 = medfilt1(X',40); noiseLevel2 = medfilt1(min(X',noiseLevel1),40); X = max(X-noiseLevel2',0); %% take every 4th row. We had 100 per second (10ms) so this is 40ms as -%% the comment says. I am guessing we denoised at a higher resolution -%% for better denoising, though still not at the original resolution, -%% for speed. Y is now 1088x545 in our example and looks pretty clean -%% as a contour plot. +%% the comment says. It's not clear to me why we denoise before doing +%% this rather than after? Y is now 1088x545 in our example and looks +%% pretty clean as a contour plot. Y = X(1:4:size(X,1),:); % 40ms step %% a 1x1088 array containing the sum of each column. Doesn't appear to
--- a/src/Silvet.cpp Mon Apr 07 14:18:39 2014 +0100 +++ b/src/Silvet.cpp Mon Apr 07 14:36:52 2014 +0100 @@ -26,6 +26,7 @@ #include <cstdio> using std::vector; +using std::cout; using std::cerr; using std::endl; using Vamp::RealTime; @@ -461,12 +462,12 @@ vector<double> filtered; for (int j = 0; j < processingNotes; ++j) { - double noteMax = 0.0; + double noteSum = 0.0; for (int s = 0; s < processingShifts; ++s) { double val = pitches[j * processingShifts + s]; - if (val > noteMax) noteMax = val; + noteSum += val; } - m_postFilter[j]->push(noteMax); + m_postFilter[j]->push(noteSum); filtered.push_back(m_postFilter[j]->get()); }