1

So I would like to have a design method for filters with 3dB and 6dB per octave roll off -- for generating pink and brown noise respectively.

I know the following 'pinking' filters exist: Filter to add 3dB per octave?

But the poster says he doesn't remember the value for A, nor does he give any idea of how he did it in the first place.

So my main question is:

How do we pick the poles and zeros of such a filter?

The Dude
  • 632
  • 4
  • 12

3 Answers3

3

-6 dB / octave is trivial.

a common reference for a pinking filter is http://www.firstpr.com.au/dsp/pink-noise/

robert bristow-johnson
  • 20,661
  • 4
  • 38
  • 76
  • Wow you are super helpful. What would we ever do without you? – The Dude Jan 27 '16 at 21:07
  • 2
    Btw, that was sarcasm. You failed to answer the question, completely, [and also linked something which I also linked in my original post] so you don't deserve that +1 there. – The Dude Jan 27 '16 at 21:24
  • okay, Dude, it's a slope of about -3 dB/octave. you can make whatever value for $A$ for however loud you wanna make it. it isn't equally loud at all frequencies. the 3 poles and 3 zeros in the link above with an $A=0.923$ will have that -3 dB/octave ramp cross 0 dB at about 0.322 Nyquist or $\omega \approx 1$. decide where you want whatever gain you want at whatever frequency and set $A$ with respect to that. – robert bristow-johnson Jan 27 '16 at 21:58
  • you would have the same kinda issue with a simple 1-pole LPF to do brown or red noise. where do you want the -6 dB/octave ramp to cross the 0 dB level? – robert bristow-johnson Jan 27 '16 at 21:59
  • Now we may be getting somewhere. So, if I want to do brown noise, I need to design a simple 1 pole LPF. So I let my cutoff frequency be wc = 2 * pi * fc, with fc in hertz. I take wc, prewarp it, and design a 1st order Butterworth filter. Using the bilinear transform, I convert it into a discrete filter, and there I am. This filter should cross the 3dB level at wc.

    But, how do I do -3dB/octave? Why did you pick 3 poles and 3 zeros? What filter design did you use?

    – The Dude Jan 28 '16 at 14:52
  • So from your post on the pinking filter, I need to alternate real poles and zeros. So from the edge of the unit circle back down to the origin, the pole-zero diagram should look like [pole1, zero1, pole2, zero2, pole3, zero3, ...etc]. Where |pole_i| > |zero_i| and |zero_i| > |pole_{i+1}|. From here, since they are in the Z-domain already, I can design the digital coefficients directly.

    Why is this structure needed? What if I want to use complex poles and zeros -- do I need to still follow a radial line down to the origin?

    How do you pick A? Trial and Error?

    – The Dude Jan 28 '16 at 15:05
  • the spacing of the poles and zeros were roughly equal in log-frequency. they had to be bumped around by trial and error. complex poles and zeros were not particularly useful since the slope i wanted was half the slope of a single real pole. trial, measure, and adjust on A. all this is pretty easy with MATLAB. i did this originally back in the 80s with a C compiler running on an old B&W Mac. – robert bristow-johnson Jan 28 '16 at 18:59
  • i guess another criterion for choosing A is so the pinking filter (or browning filter) has the same aggregate power coming out (over a given frequency range) as power going in. then some frequencies will be boosted and others will be cut. and you'll know the power going in if you have a good random number generator. still sorta a trial, measure, and adjust thing with MATLAB. – robert bristow-johnson Jan 28 '16 at 19:26
2

here's what to do for -3 dB/octave (what i remember from 1985):

first take your 1/sqrt(f) magnitude function and inverse-warp that frequency response to what it will look like in the analog s-domain. instead of only a -3 dB/oct ramp (which is what you after BLT frequency warping) you have a -3 dB/oct ramp that starts to level out a little in the s-domain.

Then apply straight line ramps at -6 dB/oct and 0 dB/oct (like with "Bode plots, remember them from electronics class?) to approximate your pre-warped ramp. convert those alternating poles and zeros to digital using the BLT. then your pre-warped ramp will come out like a straight ramp after BLT frequency warping. then adjust the pole or zero that is on the edges to minimize the maximum error in the log-log plot in the digital domain.

robert bristow-johnson
  • 20,661
  • 4
  • 38
  • 76
-1

So I have figured out the answer, thanks to a little prodding by RBJ.

Creating -6dB/octave Filters and Brown Noise:

  1. Generate a White Noise Sequence.
  2. Design a 1st Order Butterworth Filter
  3. Apply 1st Order Buttworth to the White Noise Sequence [Use the Bilinear Transform to convert the analog coefficients to digital, and apply the digital filter to the white noise sequence].

Creating -3dB/octave Filters and Pink Noise:

  1. Generate a White Noise Sequence
  2. Generate arbitrary interleaved poles and zeros on the positive real line within the unit circle. Such that $|p_{i}| > |z_{i}|$ and $|z_{i}| > |p_{i+1}|$. Set the first pole close to the unit circle.
  3. Convert these roots to coefficients, and use these coefficients as the coefficients of a digital filter.
  4. Apply said digital filter to the White Noise Sequence.

What I am still not sure of is why we need to interleave the poles and zeros, but that isn't exactly what the question asked. Can anybody elaborate?

The Dude
  • 632
  • 4
  • 12
  • 1
    Browning filter: should be 1-pole LPF with the zero at $z=-1$. all such 1-pole filters are, strictly speaking, a Butterworth, but they are also a 1-pole Tchebyshev, etc. the "Butterworth" distinction is not relevant until you get to 2nd-order filters and above, so Q or resonance becomes an issue. – robert bristow-johnson Jan 29 '16 at 21:42