-
Notifications
You must be signed in to change notification settings - Fork 12
Description
Hey, thanks for the package.
Though there is a bug(feature) in your code.
If you consider Parseval's theorem you can theoretically compute the variance of the generated GRF from its power spectrum.
In your case, the variance of the generated field quite significantly deviates from the theoretical one (right plot). For big-scale perturbations (big power slope) deviation can even reach 300% ! Though, if you average generated variance over ~100 phases you will get the theoretical one.
I assume it is related to the way how you generate phases of the Fourier image. One can either sample phases using straightforward random.uniform or he can use more sophisticated, yet robust, Polar Box-Muller transform.
The figure represents how deviation between generated variance and one from Parseval's theorem depends on the Power Slope of the GRF. (figures were computed for 100x100 pixels GRF and 100 random seeds for every Power slope)
If my guess is correct you might want to change these two functions
Line 183 in 315e30b
| def gauss_hermitian(self): |
Line 247 in 315e30b
| def _adjust_phase(ft, left_edge, freq, axes, b): |
