diff options
author | Jamie Bullock <jamie@jamiebullock.com> | 2013-01-09 23:09:34 +0000 |
---|---|---|
committer | Jamie Bullock <jamie@jamiebullock.com> | 2013-01-09 23:09:34 +0000 |
commit | 9c106a6004ffcfb55f0036535982fb118a3b2718 (patch) | |
tree | 87279a20edfd43c3cb761c8cd216bd9c7661e5b0 /src/window.c | |
parent | 7982c434bb9f85f6a08d7353b63b7ee2a939e7ff (diff) | |
download | LibXtract-9c106a6004ffcfb55f0036535982fb118a3b2718.tar.gz LibXtract-9c106a6004ffcfb55f0036535982fb118a3b2718.tar.bz2 LibXtract-9c106a6004ffcfb55f0036535982fb118a3b2718.zip |
implemented optimised FFT via the Accelerate framework. closes #5
Diffstat (limited to 'src/window.c')
-rw-r--r-- | src/window.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/window.c b/src/window.c index 18a4e15..0d00402 100644 --- a/src/window.c +++ b/src/window.c @@ -56,7 +56,7 @@ void hamming(double *window, const int N) const double M = N - 1; for (n = 0; n < N; n++) - window[n] = 0.53836 - (0.46164 * cos(2.0 * PI * (double)n / M)); + window[n] = 0.53836 - (0.46164 * cos(2.0 * M_PI * (double)n / M)); } @@ -67,7 +67,7 @@ void hann(double *window, const int N) const double M = N - 1; for (n = 0; n < N; n++) - window[n] = 0.5 * (1.0 - cos(2.0 * PI * (double)n / M)); + window[n] = 0.5 * (1.0 - cos(2.0 * M_PI * (double)n / M)); } @@ -107,7 +107,7 @@ void bartlett_hann(double *window, const int N) { term1 = a1 * fabs(n / M - 0.5); - term2 = a2 * cos(2.0 * PI * (double)n / M); + term2 = a2 * cos(2.0 * M_PI * (double)n / M); window[n] = a0 - term1 - term2; } @@ -127,8 +127,8 @@ void blackman(double *window, const int N) for (n = 0; n < N; n++) { - term1 = a1 * cos(2.0 * PI * (double)n / M); - term2 = a2 * cos(4.0 * PI * (double)n / M); + term1 = a1 * cos(2.0 * M_PI * (double)n / M); + term2 = a2 * cos(4.0 * M_PI * (double)n / M); window[n] = a0 - term1 + term2; } @@ -193,9 +193,9 @@ void blackman_harris(double *window, const int N) for (n = 0; n < N; n++) { - term1 = a1 * cos(2.0 * PI * n / M); - term2 = a2 * cos(4.0 * PI * n / M); - term3 = a3 * cos(6.0 * PI * n / M); + term1 = a1 * cos(2.0 * M_PI * n / M); + term2 = a2 * cos(4.0 * M_PI * n / M); + term3 = a3 * cos(6.0 * M_PI * n / M); window[n] = a0 - term1 + term2 - term3; } |