From 2fde783b5a4aff7e18c9dcabbb6cdef73d5a4b12 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Sun, 11 Oct 2009 12:37:01 +0200 Subject: [PATCH] src/spectral/fft.c: do not zero phase for no good reason, use ATAN2 macro --- src/spectral/fft.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/spectral/fft.c b/src/spectral/fft.c index 7814b301..2aea246d 100644 --- a/src/spectral/fft.c +++ b/src/spectral/fft.c @@ -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.; -- 2.26.2