comparison Matcher.h @ 29:cd0ffe6b1e68

Make distance scale a parameter as well
author Chris Cannam
date Fri, 31 Oct 2014 13:03:16 +0000
parents 9f60d097f0b2
children
comparison
equal deleted inserted replaced
28:2744c870d8c5 29:cd0ffe6b1e68
60 60
61 Parameters(float rate_, double hopTime_, int fftSize_) : 61 Parameters(float rate_, double hopTime_, int fftSize_) :
62 sampleRate(rate_), 62 sampleRate(rate_),
63 frameNorm(NormaliseFrameToSum1), 63 frameNorm(NormaliseFrameToSum1),
64 distanceNorm(DistanceMetric::NormaliseDistanceToLogSum), 64 distanceNorm(DistanceMetric::NormaliseDistanceToLogSum),
65 distanceScale(90.0),
65 useSpectralDifference(true), 66 useSpectralDifference(true),
66 useChromaFrequencyMap(false), 67 useChromaFrequencyMap(false),
67 hopTime(hopTime_), 68 hopTime(hopTime_),
68 fftSize(fftSize_), 69 fftSize(fftSize_),
69 blockTime(10.0), 70 blockTime(10.0),
79 FrameNormalisation frameNorm; 80 FrameNormalisation frameNorm;
80 81
81 /** Type of distance metric normalisation */ 82 /** Type of distance metric normalisation */
82 DistanceMetric::DistanceNormalisation distanceNorm; 83 DistanceMetric::DistanceNormalisation distanceNorm;
83 84
85 /** Scaling factor for distance metric; must guarantee that the
86 * final value fits in the data type used, that is, unsigned
87 * char.
88 */
89 double distanceScale;
90
84 /** Flag indicating whether or not the half-wave rectified 91 /** Flag indicating whether or not the half-wave rectified
85 * spectral difference should be used in calculating the 92 * spectral difference should be used in calculating the
86 * distance metric for pairs of audio frames, instead of the 93 * distance metric for pairs of audio frames, instead of the
87 * straight spectrum values. */ 94 * straight spectrum values. */
88 bool useSpectralDifference; 95 bool useSpectralDifference;
138 * DTW steps. */ 145 * DTW steps. */
139 bool firstPM; 146 bool firstPM;
140 147
141 /** Configuration parameters */ 148 /** Configuration parameters */
142 Parameters params; 149 Parameters params;
143
144 /** Scaling factor for distance metric; must guarantee that the
145 * final value fits in the data type used, that is, unsigned
146 * char.
147 */
148 double scale;
149 150
150 /** Width of the search band in FFT frames (see <code>blockTime</code>) */ 151 /** Width of the search band in FFT frames (see <code>blockTime</code>) */
151 int blockSize; 152 int blockSize;
152 153
153 /** The number of frames of audio data which have been read. */ 154 /** The number of frames of audio data which have been read. */