shithub: aubio

Download patch

ref: d4a6eb9c49e9a5f755a4c4d46570b0e970adbd34
parent: c721874779073106425b8c883f3c27879665d108
parent: 2b3280abacda5f37518ee1579428fa9a4a908c68
author: Paul Brossier <piem@piem.org>
date: Sat Nov 3 15:12:13 EDT 2007

merge from banane

--- a/src/fft.c
+++ b/src/fft.c
@@ -120,9 +120,9 @@
 
 void aubio_fft_getnorm(smpl_t * norm, fft_data_t * spectrum, uint_t size) {
   uint_t i;
-  norm[0] = SQR(spectrum[0]);
-  for (i=1;i<size/2;i++) norm[i] = (SQR(spectrum[i]) + SQR(spectrum[size-i]));
-  norm[size/2] = SQR(spectrum[size/2]);
+  norm[0] = spectrum[0];
+  for (i=1;i<size/2;i++) norm[i] = SQRT((SQR(spectrum[i]) + SQR(spectrum[size-i])));
+  norm[size/2] = spectrum[size/2];
 }
 
 void aubio_fft_getphas(smpl_t * phas, fft_data_t * spectrum, uint_t size) {