diff options
author | Jamie Bullock <jamie@postlude.co.uk> | 2006-12-21 11:31:51 +0000 |
---|---|---|
committer | Jamie Bullock <jamie@postlude.co.uk> | 2006-12-21 11:31:51 +0000 |
commit | 0971d72ace9b0d4c956817bf88f97e15461af112 (patch) | |
tree | 184b385a0919bbe6e4dbb7a40c264fabccfdf04c /src/vector.c | |
parent | 55e12c391bbfb4c6bd7054e78b807dfc97cd3ed5 (diff) | |
download | LibXtract-0971d72ace9b0d4c956817bf88f97e15461af112.tar.gz LibXtract-0971d72ace9b0d4c956817bf88f97e15461af112.tar.bz2 LibXtract-0971d72ace9b0d4c956817bf88f97e15461af112.zip |
xtract_magnitude_spectrum() and xtract_peaks() share format of N/2 frequency values and N/2 magnitude coefficients. 'Fixed' xtract_loudness() so that N=1 can be used for specific loudness.
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); |