Live data from Hacker News

Generating Coherent Noise Using Fourier Transforms

farazzshaikh.medium.com

1–10 of 31 posts

Re: Generating Coherent Noise Using Fourier Transforms

#3

What's a situation where noise like this is useful? In any case it's very pretty and nice and I enjoyed the article.

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 its DFT) look like this: https://demofox2.files.wordpress.com/2018/08/vc.png

And an example of dithering with white and blue noise: https://demofox2.files.wordpress.com/2019/06/randomvsblue.jp...

Re: Generating Coherent Noise Using Fourier Transforms

#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?

Re: Generating Coherent Noise Using Fourier Transforms

#5
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.

Re: Generating Coherent Noise Using Fourier Transforms

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

Re: Generating Coherent Noise Using Fourier Transforms

#9
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?

Re: Generating Coherent Noise Using Fourier Transforms

#10

What's a situation where noise like this is useful? In any case it's very pretty and nice and I enjoyed the article.

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.

Post reply on HN