Mercurial > hg > audiodb
comparison sample.cpp @ 269:dcbb30790b30 sampling
Whoops. Fix EXTREMELY EMBARRASSING bug in distance computation.
author | mas01cr |
---|---|
date | Mon, 16 Jun 2008 11:57:25 +0000 |
parents | 30a2a45f2b70 |
children | 9636040ff503 |
comparison
equal
deleted
inserted
replaced
268:30a2a45f2b70 | 269:dcbb30790b30 |
---|---|
125 | 125 |
126 VERB_LOG(1, "%f %f %f | ", v1norm, v2norm, v1v2); | 126 VERB_LOG(1, "%f %f %f | ", v1norm, v2norm, v1v2); |
127 /* assume normalizedDistance == true for now */ | 127 /* assume normalizedDistance == true for now */ |
128 /* FIXME: not convinced that the statistics we calculated in | 128 /* FIXME: not convinced that the statistics we calculated in |
129 TASLP paper are valid for normalizedDistance */ | 129 TASLP paper are valid for normalizedDistance */ |
130 double dist = 2 - v1v2 / sqrt(v1norm * v2norm); | 130 double dist = 2 - 2 * v1v2 / sqrt(v1norm * v2norm); |
131 VERB_LOG(1, "%f %f\n", dist, log(dist)); | 131 VERB_LOG(1, "%f %f\n", dist, log(dist)); |
132 sumdist += dist; | 132 sumdist += dist; |
133 sumlogdist += log(dist); | 133 sumlogdist += log(dist); |
134 i++; | 134 i++; |
135 } else { | 135 } else { |