src/spectral/fft.c: do not zero phase for no good reason, use ATAN2 macro
authorPaul Brossier <piem@piem.org>
Sun, 11 Oct 2009 10:37:01 +0000 (12:37 +0200)
committerPaul Brossier <piem@piem.org>
Sun, 11 Oct 2009 10:37:01 +0000 (12:37 +0200)
src/spectral/fft.c

index 7814b3017f5d649294f96d5badd46b21daacfaa0..2aea246dd29bc6841d3828d7ee1d4fcd148adb77 100644 (file)
@@ -185,9 +185,7 @@ void aubio_fft_get_phas(fvec_t * compspec, cvec_t * spectrum) {
   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.;