diff options
Diffstat (limited to 'src/vector.c')
-rw-r--r-- | src/vector.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/vector.c b/src/vector.c index 739004e..bc7140b 100644 --- a/src/vector.c +++ b/src/vector.c @@ -51,12 +51,12 @@ int xtract_magnitude_spectrum(const float *data, const int N, const void *argv, fftwf_execute(plan); for(n = 1; n < M; n++){ - result[n] = sqrt(SQ(temp[n]) + SQ(temp[N - n])) / N; - result[M + n] = n * q; + result[M + n] = sqrt(SQ(temp[n]) + SQ(temp[N - n])) / N; + result[n] = n * q; } - result[0] = fabs(temp[0]) / N; - result[M] = q * .5; + result[M] = fabs(temp[0]) / N; + result[0] = q * .5; fftwf_destroy_plan(plan); fftwf_free(temp); |