shithub: aubio

Download patch

ref: 2fde783b5a4aff7e18c9dcabbb6cdef73d5a4b12
parent: 76fc277f4bb19ac2291c1114a2b82b3f5183d9f9
author: Paul Brossier <piem@piem.org>
date: Sun Oct 11 08:37:01 EDT 2009

src/spectral/fft.c: do not zero phase for no good reason, use ATAN2 macro

--- a/src/spectral/fft.c
+++ b/src/spectral/fft.c
@@ -185,9 +185,7 @@
   for (i = 0; i < spectrum->channels; i++) {
     spectrum->phas[i][0] = 0.;
     for (j=1; j < spectrum->length - 1; j++) {
-      if (compspec->data[i][j] == 0.) spectrum->phas[i][j] = 0;
-      else
-      spectrum->phas[i][j] = atan2f(compspec->data[i][compspec->length-j],
+      spectrum->phas[i][j] = ATAN2(compspec->data[i][compspec->length-j],
           compspec->data[i][j]);
     }
     spectrum->phas[i][spectrum->length-1] = 0.;