Skip to content

llwyd/pinkrain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pinkrain

Real time pink noise generation with rain visualization.

Rust

pinkrain

Algorithm

The Voss-McCartney algorithm is used to generate the pink noise. The algorithm essentially involves having multiple white noise generators that each update at different rates, as detailed in the gif below. These noise generators are summed every iteration to produce the next sample. I've found that 15 generators (plus a continually updating white noise generator) produces a pleasant sounding pink noise.

noisegen

Included in this repository is a model of the algorithm, which shows that if you average several runs of the algorithm you get a pretty close to ideal pink noise frequency response. Pink noise is characterised by it's 1/f frequency response as detailed in the diagram below. There are some noticible ripples there but it is insignificant to the human ear :).

model

Resources