简体   繁体   中英

How to generate 2D colored noise

I'm unsuccessfully trying to generate a 2D array of pink noise. Can anyone explain me how to do this? Otherwise, is there a python library that allows to generate 2D (or higher dimensionality) colored noise (1/f noise)?

  1. generate white noise in 2D, eg using np.random.randn
  2. calculate FFT_2D of it ( numpy.fft.fft2 )
  3. multiply result (2D spectrum) by 1/f**2 matrix, calculated in such a way: 1/f_along_x * 1/f_along_y . That's how I interpret this definition of pink noise in N-dimensions , but I am not sure I am correct!
  4. Use IFFT_2D to get pink noise image (numpy.fft.ifft2)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM