# Filter to add 3dB per octave?

If I want to add 3dB per octave to signal (e.g. to flatten out the power spectrum of an exponential sine sweep), is it really just as simple as...

1. Take the Fourier transform of the time-domain signal, let's call this A(f).
2. Multiply this by the square root of the frequency (square root because power goes like amplitude squared)?
3. Maybe normalize by the lowest frequency, so that there's unity gain for that frequency.
4. Take the inverse Fourier transform to get back to the time domain.

Mathematically, the filter would be, simply,...

A'(f) := A(f) * sqrt ( f / f_low )

Is this right, and/or is there a better way?
(I've searched around and...it seems this is such a simple matter that people don't post how to do this.)

• – MBaz
Dec 4, 2015 at 19:27
• The post you refer to is about zeroing out bins. How is that relevant? I'm not talking about zeroing out bins. Dec 4, 2015 at 19:41
• you could also consider increasing the amplitude of your expontential sine sweep as the frequency increases.  in fact, why do you even want to do this? if you're doing an exponential frequency sine sweep (as opposed to linear frequency sweep), ain't it because you want equal energy per octave instead of equal energy per Hz? Dec 4, 2015 at 20:45
• A whole international industry of people would want to do this because exponential sine sweep is the modern method for constructing acoustic impulse responses for measuring reverberation time (e.g., Farina, 2006 -- See pcfarina.eng.unipr.it/Public/Papers/226-AES122.pdf). This method is the international standard method, ISO 3382-2:2008. The exponential gives you a regular pattern of pre-echos which can be easily studied. The downside is that there is a -3dB/octave roll off from the exponential sweep which much be corrected for in order to render true ("flat") impulse results. Dec 4, 2015 at 22:03
• The signal is generated with uniform amplitude because of loudspeaker performance. The +3dB correction is intended as a post-processing correction effect. (Apart from that, the test signals have already been recorded and gaining access to the room again is not feasible. ) Dec 4, 2015 at 22:07

take any of the pinking filters you can find and swap the zeros with the poles.

e.g. here's my pinking filter with 3 real poles and 3 real zeros (all inside the unit circle):

$$H(z) = A \frac{(z-q_1)(z-q_2)(z-q_3)}{(z-p_1)(z-p_2)(z-p_3)}$$

$p_1$ = 0.99572754, $q_1$ = 0.98443604

$p_2$ = 0.94790649, $q_2$ = 0.83392334

$p_3$ = 0.53567505, $q_3$ = 0.07568359

just swap the poles with the zeros.

• I have used this filter before and found it and its inverse to to work well. From r b-j's notes elsewhere: "the response follows the ideal -3 dB/octave curve to within + or - 0.3 dB over a 10 octave range from 0.0009*nyquist to 0.9*nyquist" Dec 4, 2015 at 23:46
• yeah, it's cheap (inexpensive) and not particularly great. somewhere else i said, if i were to ever do it again, i would make it 5 poles, 4 zeros. never did it again. and i can't remember what value to put in for $A$. Dec 5, 2015 at 2:19
• I minimax optimized it for the same band for 5 poles, 4 zeros: $q_1=0.698258$, $p_1=0.378332$, $q_2=0.937174$, $p_2=0.862595$, $q_3=0.985792$, $p_3=0.970548$, $q_4=0.996652$, $p_4=0.993022$, $p_5=0.998655$. Mar 9, 2016 at 10:47
• (Poles and zeros were constrained to be real, dunno if that was too smart) Mar 9, 2016 at 21:40
• hey @OlliNiemitalo, you got 2668 rep. why don't you self-nominate yourself (that's evidently the only way, i can't nominate you) for moderator? Mar 10, 2016 at 21:24

If you are trying to convert the sweep response to an impulse response, you can do this directly by dividing the discrete Fourier transform (DFT) of the sweep response by the DFT of the sweep, and by taking the inverse DFT of the result. The division automatically compensates for the "pink" spectrum of the exponential sweep. Avoid division by zero and near-zero values at the very lowest and at the very highest frequencies; ramp the ends of the DFT of the sweep to magnitude of 1.