From 1942323f14ca44b9e478ff95cae037fde148ff72 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Thu, 1 Oct 2009 09:04:35 +0200 Subject: [PATCH] src/onset/onsetdetection.c: fix off by one error in complexdomain without complex.h --- src/onset/onsetdetection.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/onset/onsetdetection.c b/src/onset/onsetdetection.c index dc8f6fa4..86312e44 100644 --- a/src/onset/onsetdetection.c +++ b/src/onset/onsetdetection.c @@ -87,11 +87,11 @@ void aubio_onsetdetection_complex (aubio_onsetdetection_t *o, cvec_t * fftgrain, ); #else o->meas[j] = (fftgrain->norm[i][j])*COS(o->dev1->data[i][j]); - o->meas[(nbins-1)*2-j] = (fftgrain->norm[i][j])*SIN(o->dev1->data[i][j]); + o->meas[(nbins-1)*2-1-j] = (fftgrain->norm[i][j])*SIN(o->dev1->data[i][j]); /* sum on all bins */ onset->data[i][0] += //(fftgrain->norm[i][j]); SQRT(SQR( (o->oldmag->data[i][j]-o->meas[j]) ) - + SQR( (-o->meas[(nbins-1)*2-j]) ) + + SQR( (-o->meas[(nbins-1)*2-1-j]) ) ); #endif /* swap old phase data (need to remember 2 frames behind)*/ -- 2.26.2