ref: 131b8013744b8b4f79247951d234313e55d6e62e
parent: 5a0545817cc42731e32c250d8bc3cf43f3661e23
author: lenox <lenox>
date: Mon Feb 7 14:46:37 EST 2000
fixed bug with atan2()
--- a/rdft_spectrum.c
+++ b/rdft_spectrum.c
@@ -224,7 +224,9 @@
f[i] = sqrt(a*a + b*b); /* magnitude -- please note that the
scaling depends on size n */
/* complex part: phase */
- f[j] = atan2(b, a); /* magnitude f[i] has phase f[n-i] */
+
+ if (a != 0.0) f[j] = atan2(b, a); /* magnitude f[i] has phase f[n-i] */
+ else f[j] = 0.0;
}
f[0]=sqrt(f[0]*f[0]+f[n/2]*f[n/2]); /* ill-defined bin */