Mercurial > hg > match-vamp
changeset 160:581b1118ec28 refactors
Permit overriding reference frequency for second input in MatchPipeline
author | Chris Cannam |
---|---|
date | Thu, 29 Jan 2015 17:07:05 +0000 |
parents | cdbee79699b0 |
children | 123147f096d2 |
files | src/MatchPipeline.cpp src/MatchPipeline.h |
diffstat | 2 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/MatchPipeline.cpp Thu Jan 29 17:02:48 2015 +0000 +++ b/src/MatchPipeline.cpp Thu Jan 29 17:07:05 2015 +0000 @@ -20,7 +20,8 @@ MatchPipeline::MatchPipeline(FeatureExtractor::Parameters feParams, FeatureConditioner::Parameters fcParams, DistanceMetric::Parameters dParams, - Matcher::Parameters matchParams) : + Matcher::Parameters matchParams, + double secondReferenceFrequency) : m_fe1(feParams), m_fe2(feParams), m_fc1(fcParams), @@ -32,6 +33,11 @@ m_lastFrameIn2(0), m_frameNo(0) { + if (secondReferenceFrequency != 0.0) { + feParams.referenceFrequency = secondReferenceFrequency; + m_fe2 = FeatureExtractor(feParams); + } + m_pm1.setOtherMatcher(&m_pm2); }
--- a/src/MatchPipeline.h Thu Jan 29 17:02:48 2015 +0000 +++ b/src/MatchPipeline.h Thu Jan 29 17:07:05 2015 +0000 @@ -35,11 +35,18 @@ * -> Features * -> Conditioned features * -> Matcher + * + * Only one set of FeatureExtractor::Parameters is provided; this + * contains a single reference frequency, but it's possible the + * two input streams may have different tuning frequencies. A + * separate frequency for the second input can be provided here as + * an optional parameter if needed. */ MatchPipeline(FeatureExtractor::Parameters feParams, FeatureConditioner::Parameters fcParams, DistanceMetric::Parameters dParams, - Matcher::Parameters matchParams); + Matcher::Parameters matchParams, + double secondReferenceFrequency = 0.0); ~MatchPipeline();