I\'m using Jtransforms java library to perform analysis on a given dataset.
An example of the data is as follows:
980,988,1160,1080,928,1068,1156,11
To get the magnitude of bin k you need to calculate sqrt(re * re + im * im), wheer re, im are the real and imaginary components in the FFT output for bin k.
For your particular FFT re[k] = a[2*k]
and im[k] = a[2*k+1]
. Therefore to calculate the power spectrum:
for k in 0 to N/2 - 1
spectrum[k] = sqrt(sqr(a[2*k]) + sqr(a[2*k+1]))