# Blue Noise creation via filtering?

Started by July 25, 2004
```Hello all, I trust I'm not intruding.  I'm interested in creating
"blue noise", as referred to in the following "Colors of Noise FAQ"
posted in comp.dsp, and other sources:

http://tinyurl.com/45h2k

A quick synopsis:  "blue noise" is so named because the power is
concentrated at the high end of the spectrum.  It has a power
distribution of P = f, vs. P = 1/f for pink noise.

Pink noise, or a reasonable facsimile thereof, is easy to generate
using streams of random numbers.  I've written a program to do it
using the Voss-McCartney algorithm and it works well.

However, I don't see any way to algorithmically generate blue noise,
which seems to me to sort of be the inverse of pink noise.  So I
presume the only way to do so would be to filter white noise with a
high-pass filter that rolls off at 3.02dB/octave .. and here is where
I get out of my depth.  I have no musical knowledge, have only the
vaguest sense of what an octave is, and I don't know of any software
that can effect such a high-pass filter.  There is plenty of software
that can do, for example, a filter that will pass everything above
3KHz with a 500Hz transition band, but that isn't what I need.

I'd be grateful for any suggestions on software that I could use to
make blue noise in this manner.  :-)

```
```No Name wrote:
> Hello all, I trust I'm not intruding.  I'm interested in creating
> "blue noise", as referred to in the following "Colors of Noise FAQ"
> posted in comp.dsp, and other sources:

> A quick synopsis:  "blue noise" is so named because the power is
> concentrated at the high end of the spectrum.  It has a power
> distribution of P = f, vs. P = 1/f for pink noise.
>
> Pink noise, or a reasonable facsimile thereof, is easy to generate
> using streams of random numbers.  I've written a program to do it
> using the Voss-McCartney algorithm and it works well.

How about inverting the spectrum of pink noise?

In other words, mix the folding frequency (pi) to DC.

-- Mark
```
```No Name wrote:

> Hello all, I trust I'm not intruding.  I'm interested in creating
> "blue noise", as referred to in the following "Colors of Noise
> FAQ" posted in comp.dsp, and other sources:
>
> http://tinyurl.com/45h2k
>
> A quick synopsis:  "blue noise" is so named because the power is
> concentrated at the high end of the spectrum.  It has a power
> distribution of P = f, vs. P = 1/f for pink noise.
>
> Pink noise, or a reasonable facsimile thereof, is easy to generate
> using streams of random numbers.  I've written a program to do it
> using the Voss-McCartney algorithm and it works well.
>
> However, I don't see any way to algorithmically generate blue
> noise,
> which seems to me to sort of be the inverse of pink noise.  So I
> presume the only way to do so would be to filter white noise with
> a high-pass filter that rolls off at 3.02dB/octave .. and here is
> where
> I get out of my depth.  I have no musical knowledge, have only the
> vaguest sense of what an octave is, and I don't know of any
> software
> that can effect such a high-pass filter.  There is plenty of
> software that can do, for example, a filter that will pass
> everything above 3KHz with a 500Hz transition band, but that isn't
> what I need.
>
> I'd be grateful for any suggestions on software that I could use
> to
> make blue noise in this manner.  :-)

Just my 2 ct:

Idea no 1 (1ct)

High-pass filter with the 3db-point at the maximum frequency where
your noise spectrum ends. The whole band is on the flange of the
filter - you don't use the passband region.

Idea no 2 (1ct)

In the frequency domain, define your spectrum, then do an inverse
FFT, which will give you the desired noise.

Note:
if you consider a digital system ( a sampled signal), you'll have an
upper frequency limit, which is half your sampling frequency.
Your blue noise spectrum ends on that maximum frequency, therefore
isn't really blue...
Even an analog system will not be able to produce real blue noise,
because this would require infinite power at highest frequencies.

Bernhard
```
```Mark Borgerding wrote:
...
> > A quick synopsis:  "blue noise" is so named because the power is
> > concentrated at the high end of the spectrum.  It has a power
> > distribution of P = f, vs. P = 1/f for pink noise.
...
> How about inverting the spectrum of pink noise?
>
> In other words, mix the folding frequency (pi) to DC.

That's a good idea to create noise with a spectral density ~ 1/(pi-f)
(*), which does not seem the OP wants.

If I had to create noise with psd ~ f, I would filter white noise with
the differential operator, which has a frequency response of f. A
computationally extremely efficient approximation would be to use the
first difference operator with impulse response h = {1,-1}.

Regards,
Andor

(*) So called pink noise or 1/f noise really has a psd ~ 1/f^beta,
with the parameter beta somewhere in the range of ]0,1[. Note that the
psd has to be integrable for the autocorrelation function (and hence
the time series) to exist. alpha = 1 - beta is called the long-range
correlation or Hurst parameter.

>
> -- Mark
```
```Andor wrote:
> Mark Borgerding wrote:
> ...
>
>>>A quick synopsis:  "blue noise" is so named because the power is
>>>concentrated at the high end of the spectrum.  It has a power
>>>distribution of P = f, vs. P = 1/f for pink noise.
>
> ...
>
>>How about inverting the spectrum of pink noise?
>>
>>In other words, mix the folding frequency (pi) to DC.
>
>
> That's a good idea to create noise with a spectral density ~ 1/(pi-f)
> (*), which does not seem the OP wants.

Good point. I looked at the document link provided by OP.
It describes pink noise as "power density decreases 3dB per octave"
It describes blue noise as "power density increases 3dB per octave"

Without thinking too hard, it sounded like spectral inversion.  I don't
usually think in terms of octaves.

>
> If I had to create noise with psd ~ f, I would filter white noise with
> the differential operator, which has a frequency response of f. A
> computationally extremely efficient approximation would be to use the
> first difference operator with impulse response h = {1,-1}.

That's a bit closer, but not quite right either.  The mag2 frequency
response of h=[1,-1] is pretty curvy. |H(theta) |^2 is not ~theta.

H(Z) = 1 - Z^-1 = 1 - exp(-j theta )

A quick plot:
theta=linspace(0,pi);
plot( abs( 1 - exp( -j * theta ) ).^2 )

Interestingly, you can alias the curved parts together by decimating by
two without LPFing.  This makes the power curve nice and linear.
Unfortunately, that line is considerably offset from zero at DC due to
the aliased power. So even though the power curve is straight, no
scaling can make it proportional to f.

*shrug*

I'd probably go with filtering white noise as OP suggested.

<PLUG> Come attend my sessions at the comp.dsp conference this week.
"Fast Convolution Filtering: From Basics to Filter Banks"
</PLUG>

Mark
```
```Mark Borgerding wrote:
> Andor wrote:
>
>> Mark Borgerding wrote:
>> ...
>>
>>>> A quick synopsis:  "blue noise" is so named because the power is
>>>> concentrated at the high end of the spectrum.  It has a power
>>>> distribution of P = f, vs. P = 1/f for pink noise.
>>
>>
>> ...
>>
>>> How about inverting the spectrum of pink noise?
>>>
>>> In other words, mix the folding frequency (pi) to DC.
>>
>>
>>
>> That's a good idea to create noise with a spectral density ~ 1/(pi-f)
>> (*), which does not seem the OP wants.
>
>
> Good point. I looked at the document link provided by OP.
> It describes pink noise as "power density decreases 3dB per octave"
> It describes blue noise as "power density increases 3dB per octave"
>
> Without thinking too hard, it sounded like spectral inversion.  I don't
> usually think in terms of octaves.
>
>>
>> If I had to create noise with psd ~ f, I would filter white noise with
>> the differential operator, which has a frequency response of f. A
>> computationally extremely efficient approximation would be to use the
>> first difference operator with impulse response h = {1,-1}.
>
>
> That's a bit closer, but not quite right either.  The mag2 frequency
> response of h=[1,-1] is pretty curvy. |H(theta) |^2 is not ~theta.
>
> H(Z) = 1 - Z^-1 = 1 - exp(-j theta )

I guess by theta you mean the frequency parameter. The magnitude
response of the first difference filter is strictly monotonic
increasing, rising from 0 to 2. It has magnitude response

|H(w)| = |1 - Exp(-j w)| = 2 Sin(w),

resp. magnitude squared response

|H(w)|^2 = 2 (1 - Cos(w) )

for 0<= w <= Pi.

For w around Pi/2, |H(w)|^2 is ~ w, and deviates accordingly for w
around 0 and Pi. As I wrote, it is an approximation of the differential
operator. For a noise generator, it might be close enough (and it's main

> I'd probably go with filtering white noise as OP suggested.

Yes, that's the whole point - the OP asked what kind of filter to use. I
suggested the first difference. If that isn't close enough, you can
generate a higher order FIR approximation of the differential operator,
but that usually is overkill.

> <PLUG> Come attend my sessions at the comp.dsp conference this week.
> "Fast Convolution Filtering: From Basics to Filter Banks"
> </PLUG>

Have you written a proceeding on that? Sounds interesting.

Regards,
Andor

```
```Andor Bariska wrote:

> |H(w)| = |1 - Exp(-j w)| = 2 Sin(w)
^^^^^
Correction:
|H(w)| = |1 - Exp(-j w)| = 2 Sin(w/2)

```
```Mark Borgerding <mark@borgerding.net> writes:
> [...]
> <PLUG> Come attend my sessions at the comp.dsp conference this week.
> "Fast Convolution Filtering: From Basics to Filter Banks"
> </PLUG>

I look forward to hearing you talk on this interesting topic, Mark.
--
%  Randy Yates                  % "Ticket to the moon, flight leaves here today
%% Fuquay-Varina, NC            %  from Satellite 2"
%%% 919-577-9882                % 'Ticket To The Moon'
%%%% <yates@ieee.org>           % *Time*, Electric Light Orchestra
```
```On 2004-07-26 07:15:57 +0200, Bernhard Holzmayer
>
> Idea no 2 (1ct)
> In the frequency domain, define your spectrum, then do an inverse FFT,
> which will give you the desired noise.

Just an addition: you need to make sure that you're using random phases
for the reconstruction to actually get a noise sequence from your
transform. You also need to make sure your transform length is
sufficiently large - if you use that recipe in a STFT way overlapping
will introduce artifacts if you don't calculate your phases carefully.

As an easy alternative, you could use the resulting impulse response as
a FIR filter on white noise.
--
Stephan M. Bernsee
http://www.dspdimension.com

```
```No Name <nizo@spizam.com> wrote in message news:<mdn8g012bqf69bs18kpddo0rqam015c4ss@4ax.com>...
> A quick synopsis:  "blue noise" is so named because the power is
> concentrated at the high end of the spectrum.  It has a power
> distribution of P = f, vs. P = 1/f for pink noise.
>
> Pink noise, or a reasonable facsimile thereof, is easy to generate
> using streams of random numbers.  I've written a program to do it
> using the Voss-McCartney algorithm and it works well.
>
> However, I don't see any way to algorithmically generate blue noise,
> which seems to me to sort of be the inverse of pink noise.  So I
> presume the only way to do so would be to filter white noise with a
> high-pass filter that rolls off at 3.02dB/octave .. and here is where

If you can generate pink noise easily, just filter it with a 6
dB/octave high pass filter (i.e. a differentiator) to get the blue
noise. There is plenty of literature on differentiators available
online, and you may be able to get by with just taking the difference
of successive samples.

Btw, the Voss-McCartney algorithm is a very inefficient way to
generate pink noise. You will do much better by applying a simple IIR
filter to a white noise stream. You can find the necessary filter
coefficients at the music-dsp source code archive
(http://www.musicdsp.org/).

Sincerely,
Frederick Umminger
```