News for hackers. Stuff that matters.
Re:Generating Coherent Noise Using Fourier Transforms by praptak on Thursday June 03, 2021 @07:06AM (#27379461)
Quote the article:

  1. Generate some White Noise.
  2. Perform a Fourier transform on the White Noise.
Are the two separate steps necessary? It should be possible to directly generate the Fourier Transform of the white noise, rather than applying FFT to the waveform, right?
Re:Generating Coherent Noise Using Fourier Transforms by frumiousirc on Thursday June 03, 2021 @07:32AM (#27379655)

    3. apply filter
    4. apply inverse FT
It is equivalent to replace 1, 2 and 3 with a proper stochastic but direct sampling of the 1/f function to get the Fourier amplitudes and a uniform sampling for Fourier phase.

This would save processing time by avoiding the calculation of one 2D FFT and the application of the filter (a 2D array multiplication).

Re:Generating Coherent Noise Using Fourier Transforms by TheOtherHobbes on Thursday June 03, 2021 @12:11PM (#27383485)
Even simpler: create your desired amplitude spectrum to match your desired filtered noise profile. This is trivial for any noise spectrum with a simple linear filter - it's just a linear function with the desired slope. It's only slightly less trivial for more complex spectra.

Randomise the phases. (i)FFT. Done.

Re:Generating Coherent Noise Using Fourier Transforms by frumiousirc on Friday June 04, 2021 @07:58AM (#27392710)
The 1/f (or any) noise spectrum represents only the *mean* amplitude in frequency domain. In reality, the amplitude at each frequency itself has an associated distribution. Since frequency domain is complex the amplitude represents a radius in 2D space and if the underlying random walk is Gaussian then the amplitude is distributed according to Rayleigh.

For generating artistic images, the artist may ignore this fact and generate only the random phases. Image to image, humans probably won't know the shortcut. But in fact, each image will have exactly the same amplitude spectra and that's not physical for real stochastic processes. Depending on the usage of the images, the shortcut could be fatal.

Eg, if we train a neural net on these generated images we should not expect that NN to perform well on the real data which our generated images were meant to represent.

Re:Generating Coherent Noise Using Fourier Transforms by gnramires on Thursday June 03, 2021 @03:34PM (#27386240)
Right (and that would be more efficient, I guess), but the Fourier transform of White Noise yields complex white noise with real and imaginary part such that their std deviation a and b obeys var_x = a^2 + b^2 (This follows from FFT being Unitary or Parveval's theorem), so each frequency component has sqrt(2)/2 times the (non-transformed) signal standard deviation. So simply generate two i.i.d. white noise fields with scaled variance (1/2).

It's important to keep in mind when speaking of noise that we are referring to average values (or statistical values), e.g. although the power spectrum of white noise is on average flat, as we discussed it's really random (the expected amplitude spectrum in fact has average 0 anywhere, since it's also white noise!).

Re:Generating Coherent Noise Using Fourier Transforms by nightcracker on Thursday June 03, 2021 @07:18AM (#27379527)
At least when using Gaussian white noise, the DFT of the noise is the same distribution with a smaller variance: https://dsp.stackexchange.com/questions/24170/what-are-the-s...

I don't think the same neat result holds when you use uniform white noise, but I haven't done the math.

Re:Generating Coherent Noise Using Fourier Transforms by eutectic on Thursday June 03, 2021 @08:41AM (#27380369)
The normal distribution is special in being closed under linear transformation.
Re:Generating Coherent Noise Using Fourier Transforms by munificent on Thursday June 03, 2021 @02:58PM (#27385807)
Yup! That's basically what Perlin noise does.

Generate a bunch of sine waves at various frequencies ("octaves") and add them together.