From: Paul Brossier Date: Sun, 11 Oct 2009 10:37:01 +0000 (+0200) Subject: src/spectral/fft.c: do not zero phase for no good reason, use ATAN2 macro X-Git-Tag: bzr2git~143 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2fde783b5a4aff7e18c9dcabbb6cdef73d5a4b12;p=aubio.git src/spectral/fft.c: do not zero phase for no good reason, use ATAN2 macro --- 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.;