c++ - Computing a 3D power spectrum in fftw -
i trying compute 3d power spectrum -- is, averaged power in frequency shells. think i'm doing calculation of shell densities correctly, i'm not sure how determine frequency of each shell.
supposing sampling rate fs
same in each dimension, , length of original samples in each dimension same value n
. shell "index" idx = sqrt(i*i + j*j + k*k)
i, j, , k extent in each direction. how compute frequency of shell?
it's simpler think: vector (i, j, k)
wave vector, associated frequency taking length , dividing length of edge of cube.
f = sqrt(i*i + j*j + k*k)/edgelength
the result spacial frequency. if looking temporal frequency, need additional information links 2 together.
the thing need take care of, location of 0 frequency within fft transformed cube: algorithms place @ upper left corner, others place in center. wherever is, need take care don't misinterpret low frequency aliased high frequency in opposite direction, i. e. absolute value of i, j, k
should less half width of cube.
Comments
Post a Comment