Hacker News new | ask | show | jobs
by cousin_it 116 days ago
When I was learning DSP, I was surprised by the fact that generating pink (1/f) noise, sample by sample, is not mathematically easy at all.

One practical approach is passing white noise (every sample independent random) through a "pinking filter", which is a sum of a bunch of lowpass filters at different frequencies, so that the sum of their cutoff "knees" approximates the frequency curve of pink noise. Another approach is generating in chunks using Fourier transform from a desired shape. Given the ubiquity of 1/f noise, you'd think there would be a simpler and more direct algorithm, but no.

1 comments

If you change your Fourier transform approach into a time domain convolution, then you can generate it sample by sample. White noise -> FIR filter, this is a pretty simple and direct algorithm as far as DSP goes. The wiki on pink noise mentions this. I've done the FIR filter approach to simulate 1/f phase noise.