Coding pink noise

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Amphiprion
    Senior Member
    • Apr 2006
    • 886

    Coding pink noise

    OK, I thought this would be a simple operation like filtering an audio file, but apparently it's not. I'm trying to generate band-limited pink noise (20-100Hz) in Matlab from white gaussian noise. I could be lazy and just import and filter a wav file of pink noise, but I'm trying to do this and learn something at the same time.

    Question: has anyone done this? The easiest algorithms I can find are pseudocode such as this:

    white=(whichever method you choose);
    buf0=0.997 * buf0 + 0.029591 * white;
    buf1=0.985 * buf1 + 0.032534 * white;
    buf2=0.950 * buf2 + 0.048056 * white;
    buf3=0.850 * buf3 + 0.090579 * white;
    buf4=0.620 * buf4 + 0.108990 * white;
    buf5=0.250 * buf5 + 0.255784 * white;
    pink=buf0 + buf1 + buf2 + buf3 + buf4 + buf5;

    and

    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;

    I'm pretty sure the last two lines of the second example are transposed, but that's how it was written on the website I pulled it from. Anyway, I'm trying to figure out how the coefficients affect the pink noise output, and how to generate them. The second example is supposed to be accurate down to 9.2Hz (+/-.05db) at 44.1kHz, but I have no idea why, how to calculate this, or how to verify this. Any DSP folk that have any idea how to do this? I'm regretting selling my textbooks back.
  • Amphiprion
    Senior Member
    • Apr 2006
    • 886

    #2
    Nevermind, it helps to read further down the page, dur. If anyone wants to know, they're just combinations of hand-tweaked 6db/octave lowpass filters used to approximate a 3dB/octave low pass response for the pink noise. See pic:

    Comment

    Working...
    Searching...Please wait.
    An unexpected error was returned: 'Your submission could not be processed because you have logged in since the previous page was loaded.

    Please push the back button and reload the previous window.'
    An unexpected error was returned: 'Your submission could not be processed because the token has expired.

    Please push the back button and reload the previous window.'
    An internal error has occurred and the module cannot be displayed.
    There are no results that meet this criteria.
    Search Result for "|||"