From: Paul Brossier Date: Thu, 1 Oct 2009 07:04:35 +0000 (+0200) Subject: src/onset/onsetdetection.c: fix off by one error in complexdomain without complex.h X-Git-Tag: bzr2git~242 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1942323f14ca44b9e478ff95cae037fde148ff72;p=aubio.git src/onset/onsetdetection.c: fix off by one error in complexdomain without complex.h --- 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)*/