Filter to make pink noise from white (updated March 2000) ------------------------------------ This is an approximation to a -10dB/decade filter using a weighted sum of first order filters. It is accurate to within +/-0.05dB above 9.2Hz (44100Hz sampling rate). Unity gain is at Nyquist, but can be adjusted by scaling the numbers at the end of each line. If 'white' consists of uniform random numbers, such as those generated by the rand() function, 'pink' will have an almost gaussian level distribution. b0 = 0.99886 * b0 + white * 0.0555179; b1 = 0.99332 * b1 + white * 0.0750759; b2 = 0.96900 * b2 + white * 0.1538520; b3 = 0.86650 * b3 + white * 0.3104856; b4 = 0.55000 * b4 + white * 0.5329522; b5 = -0.7616 * b5 - white * 0.0168980; pink = b0 + b1 + b2 + b3 + b4 + b5 + b6 + white * 0.5362; b6 = white * 0.115926; An 'economy' version with accuracy of +/-0.5dB is also available. b0 = 0.99765 * b0 + white * 0.0990460; b1 = 0.96300 * b1 + white * 0.2965164; b2 = 0.57000 * b2 + white * 1.0526913; pink = b0 + b1 + b2 + white * 0.1848; --- paul.kellett@maxim.abel.co.uk http://www.abel.co.uk/~maxim/