Live data from Hacker News

Generating Coherent Noise Using Fourier Transforms

farazzshaikh.medium.com

11–20 of 31 posts

Re: Generating Coherent Noise Using Fourier Transforms

#11
post #4

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?

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.

The normal distribution is special in being closed under linear transformation.

Re: Generating Coherent Noise Using Fourier Transforms

#12

Up to phase I think this is equivalent to just integrating the noise, so you should get some kind of Brownian function.

Yes integration is a 1/f Fourier multiplier. But if you want to do (1/f)^alpha then it's not so straightforward in the time domain.

Re: Generating Coherent Noise Using Fourier Transforms

#13
post #8

Maybe I've been in computer graphics land for too long, but I'm somewhat surprized by the author's initial surprize. Isn't it obvious that you get a fractal surface if you sum up frequencies with 1/f amplitude?

Nothing about computer graphics, I think everyone who has worked with signal processing would be surprised by the authors initial surprise (I was). The question is more what else would one expect?

And for people like me, unfamiliar with it but still knowing what a Fourier transform is, just reading the algorithm I really see no reasons why it particularly "shouldn't work", as the author said.

Re: Generating Coherent Noise Using Fourier Transforms

#14
The oldest work I'm aware of that uses this approach for producing fractals (clouds in this case) is Gardner's[1], from 1985.

I dunno if Gardner's earlier paper from 1979, "Computer-generated texturing to model real-world features", contains the idea already because I could never find a digital version of that one.

[1] https://www.cs.drexel.edu/~david/Classes/Papers/p297-gardner...

Re: Generating Coherent Noise Using Fourier Transforms

#15
post #8

Maybe I've been in computer graphics land for too long, but I'm somewhat surprized by the author's initial surprize. Isn't it obvious that you get a fractal surface if you sum up frequencies with 1/f amplitude?

Nothing about computer graphics, I think everyone who has worked with signal processing would be surprised by the authors initial surprise (I was). The question is more what else would one expect?

Indeed.

I suspect perhaps the author is surprised because squinting/defocussing your eyes at the original noise doesn't much look like the final result.

Thats because as well as removing the high frequency components (like squinting), this algorithm also is rescaling the amplitude.

Re: Generating Coherent Noise Using Fourier Transforms

#16
post #12

Up to phase I think this is equivalent to just integrating the noise, so you should get some kind of Brownian function.

Yes integration is a 1/f Fourier multiplier. But if you want to do (1/f)^alpha then it's not so straightforward in the time domain.

In the theoretical PDEs world, non-integer alpha represents a fractional derivative.

Re: Generating Coherent Noise Using Fourier Transforms

#17

Earlier quoted context omitted.

Game textures often use this kind of noise for terrain heights, smoke, etc. A similar kind of noise known as blue noise can be generated by taking the Fourier transform and not applying a 1/f filter but a high-pass filter instead. You end up with noise that only has high frequencies in it, and not low frequencies. Thus the noise does not have large-scale features, which is ideal for use in dithering. Blue noise (and…

Interestingly enough, in the white noise vs blue noise dithering, I appreciate the white noise one (left) much more because the blue-noise one (right) looks blurry. I guess it depends a lot on the input though, a bit like how nearest-neighbor is a much better algorithm than bi-cubic to scale up pixel art while the result is horrible if you use it on a real-world picture.

I see them as both blurry, but the but the one on the left is more grainy.

Re: Generating Coherent Noise Using Fourier Transforms

#19
post #12

Up to phase I think this is equivalent to just integrating the noise, so you should get some kind of Brownian function.

Yes integration is a 1/f Fourier multiplier. But if you want to do (1/f)^alpha then it's not so straightforward in the time domain.

> Yes integration is a 1/f Fourier multiplier.

Can you explain this? I don’t see the connection. I can see how the zero-frequency value would be equal to the integral (well, the average).

Edit: figured it out. Derivative operator multiplies each basis function by its index. D exp(inx) = inexp(inx). Apply the inverse operation (divide by index) to get the integral.

Re: Generating Coherent Noise Using Fourier Transforms

#20
post #4

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?

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).

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.

Post reply on HN