[sdiy] A new shade of pink (noise)
Richie Burnett
rburnett at richieburnett.co.uk
Tue Nov 24 20:51:53 CET 2020
Hi Tom,
I got to the bottom of this eventually after we were discussing this offline
a few years back. What he does is he runs the "top octave" noise generator
at the full sample rate, then runs the next highest octave noise generator
at half of the full sample rate, but linearly interpolates this. This
really just means inserting one new sample between each pair of samples, and
this is done by increasing the bit-depth. Essentially all he does is uses
linear-interpolation to interpolate all of the successively lower speed
noise generators up to the full output sample rate, and then mix them
together. This is like a Zero-Order-Hold followed by an integrator for each
successive noise source. So the next octave down runs at a quarter of the
sample rate, and 3 new levels are inserted between each pair of samples to
bring the output up to the full output sample rate. So every noise source
is effectively upsampled to the final output rate using linear
interpolation.
The result of this is that each of the many noise sources running at the
different sample rates produces an output that ramps linearly between two
levels (with the amount of "in between" levels being determine by the sample
rate of this noise source relative to the final output sample rate.)
When all of the different noise sources are mixed together to get the final
output (pink noise) it gives less ripple in the power spectrum than using a
set of Zero-Order-Hold noise sources because the sinc-like spectral envelope
of each noise source rolls off faster with linear interpolation than with
ZOH. (You get an additional 6dB/oct rolloff due to the conceptual
integration. Or you can think of it that the discontinuities are now in the
gradient dy/dt rather than in the value y.)
I remember he says something in his paper about the very top part of the
spectral profile not having quite the right slope though, and he proposed
correcting this with some sort of FIR filter? When I implemented it, I just
ran the whole thing at a faster sample rate so that the part of the power
spectrum that wasn't quite "pink" was moved above the audio band where human
ears wouldn't notice. But for test/measurement usage it might be worth
correcting the response with the FIR.
I have to say that I didn't code this up on a PIC or dsPIC or anything Tom.
Just wrote some equations in Goldwave expression evaluator to generate the
relevant noise sources, mixed them together, and then looked at the power
spectrum using MATLAB. The performance is really good, but you have to run
the power spectrum evaluation on several minutes of noise in order to really
get a picture for how well the power spectrum converges to 1/f. I think I
was generating 10 minute long pink noise recordings with 96kHz sample rate
in order to assess the residual ripple in the power spectrum!
-Richie,
-----Original Message-----
From: Tom Wiltshire
Sent: Tuesday, November 24, 2020 12:57 PM
To: Benjamin Tremblay via Synth-diy
Subject: [sdiy] A new shade of pink (noise)
There’s an interesting paper by Stefan Stenzel on Github, describing a new
digital pink noise generation algorithm:
https://github.com/Stenzel/newshadeofpink/blob/master/newshadeofpink.pdf
Has anyone seen this? I’ve read it, but there’s one thing I don’t
understand. In the paper, he talks about taking multiple 1-bit noise sources
(as you would in the Voss0-McCartney algorithm) but instead of using a “zero
order hold” (e.g. “stretching” each sample) to decrease the sample rate, he
uses linear interpolation.
This is the bit I don’t get - how do you linearly interpolate a 1-bit
signal? There’s nothing in between!
He mentions at one point that the digital signal is to be interpreted as -1
or +1, which would mean that there is a 0 between the two values, but I
still don’t understand how that makes sense when it’s a digital signal and
not a bit of signal processing maths formula.
Any clarifications appreciated. I’d like to understand this method better,
but the paper is very brief, assumes quite a lot of background I don’t have,
and doesn’t provide any worked examples for illustration.
Many thanks,
Tom
==================
Electric Druid
Synth & Stompbox DIY
==================
_______________________________________________
Synth-diy mailing list
Synth-diy at synth-diy.org
http://synth-diy.org/mailman/listinfo/synth-diy
Selling or trading? Use marketplace at synth-diy.org
--
This email has been checked for viruses by AVG.
https://www.avg.com
More information about the Synth-diy
mailing list