A tree can be produced by counting the number of trailing zeros from an input integer index.
This count ('c') of trailing zeros (or position of the lowest bit) comes back every 2^c sample, i.e. corresponds to a frequency of 2^-c
Furthermore every sample corresponds with one and only one octave.
I first encountered this contruction in pink noise generator in audio, using this tree of octaves to downsample a source of white noise into many down-octaves with a gain of 2^{-Octave}
One advantage is that the downsampled octaves pull from the white noise generator at most once per sample, so there's an even load on the generator and no "bursts" of randomness.
- Voss-McCartney pink noise generator, see http://www.firstpr.com.au/dsp/pink-noise/#Voss and http://www.firstpr.com.au/dsp/pink-noise/#Voss-McCartney
- Stefan Stenzel's New Shade Of Pink generator, see http://stenzel.waldorfmusic.de/post/pink/
Application by Alex Evans to generate pink noise in a tweet:
one cheap way to make fairly pink noise: static signed char r[8]; static int pink,frame; int b=__builtin_ctz(128|frame++); pink-=r[b]; r[b]=rand(); return pink+=r[b]; // running sum of 8 uniform random numbers updated every 2,4,8... samples