Closed zhongpenggeo closed 5 years ago
Thanks for your query. Could you provide a reference for that? To my knowledge the square is used simply to make all values in the power spectrum positive, which is accomplished with np.abs
.
Could you provide more context, please?
Thanks for your query. Could you provide a reference for that? To my knowledge the square is used simply to make all values in the power spectrum positive, which is accomplished with
np.abs
.Could you provide more context, please?
https://github.com/fatiando/fatiando/blob/ac2afbcb2d99b18f145cc1ed40075beb5f92dd5a/fatiando/gravmag/transform.py#L542
I find Power Density Spectra in Fatinado is square. And you userr = 2.0*np.log(FT[mask])
to compute log of Power Density Spectra in function 'radial_spectrum' in pycurious-src/pycurious/grid/curie.py , which is the same as log((FT)**2)
Sure, so it follows then there is no difference in the radial power spectrum. These statements return the same results:
2*np.log(np.abs(np.fft.fft2(data*vtaper)))
np.log(np.abs(np.fft.fft2(data*vtaper))**2)
Statement 1 is slightly more computationally friendly.
hello, I have a question about your code to compute radially averaged power spectrum. In grid/curie.py, you compute power spectrum in function _radialspectrum
FT = np.abs(np.fft.fft2(data*vtaper))
But as I known, it shoud be
FT = np.abs(np.fft.fft2(data*vtaper))**2
, the square of absolute of fft, isn't it?