I have a signal that has a spectral shape very similar to the transfer function of a second-order lowpass filter (butterworth design).


I would like to whiten the spectrum of this spectrum in the time domain. For that, I need a filter that reverses the effect of the second-order lowpass filter.

I can calculate the inverse filter of the second-order lowpass by exchanging the A- and B-coefficients, but this will amplify high frequency components to infinity.

How do I design a filter that has the inverse transfer function of a second-order butterworth design but does not amplify to infinity at $f_s/2$? The transfer function should have the same corner frequency, but smoothly rise with 12 dB per octave.

Is this even possible? Any pointers as to how to design such a filter would be helpful!

  • $\begingroup$ Are you looking for an mathematically exact inverse filter (system) or just a filter to whiten your signal as much as possible... In the former case you need to mathemathically specify the forward system so that its inverse can at least in principal be derived and implemented as a stable causal system provided the forward system satisfies certain properties. The latter just involves the design of a general bandpass filter with a specific magnitude response to amplify high frequencies while maintaning stability. $\endgroup$
    – Fat32
    Jul 7, 2015 at 10:57
  • $\begingroup$ A stable exact inverse doesn't exist, as pointed out by the OP, because of the zero at Nyquist. $\endgroup$
    – Matt L.
    Jul 7, 2015 at 11:25
  • 1
    $\begingroup$ @Fat32 I am just looking for a filter to whiten my signal as much as possible. $\endgroup$
    – bastibe
    Jul 7, 2015 at 11:36
  • $\begingroup$ @Matt L. I am confused ? is the OP sure that the system to be inverted is a Butterworth filter or he "thinks" that it is so..? $\endgroup$
    – Fat32
    Jul 7, 2015 at 21:24
  • 1
    $\begingroup$ bastibe, if all you need to do is invert a given Butterworth LPF, then all you need to do is swap the locations of the poles and zeros of the Butterworth LPF. the existing zeros will all be at $z=-1$, so when you put all of your poles there, you will have to bump them slightly inside the unit circle. you don't want a bunch of poles sitting squarely on (or outside of) the unit circle. $\endgroup$ Jul 7, 2015 at 22:54

2 Answers 2


The simplest and probably best approach is to use a second order IIR filter exchanging numerator and denominator from the original filter - as you suggested - but move the double pole at $z=-1$ (Nyquist) slightly towards $z=0$, i.e. slightly decrease the pole radius to make the filter stable. Just play around with the exact value. The higher the value, the closer to Nyquist will the approximation of the inverse filter be.

This little Matlab/Octave program shows how to do it:

[b,a] = butter(2,.005);     % some 2nd order Butterworth LP filter
r = 0.98;                   % desired pole radius < 1
b2 = a;                     % EQ numerator
a2 = [1,2*r,r*r];           % EQ denominator
k = sum(a2)/sum(b2);
b2 = k*b2;                  % scaling
[H1,w] = freqz(b,a,512);    % Butterworth frequency response
H2 = freqz(b2,a2,512);      % EQ frequency response

% plot EQ'd response
grid on, xlabel('normalized frequency'),
ylabel('dB'), title('equalized response')

enter image description here

  • $\begingroup$ Could someone explain why a2 is [1,2*r,r*r]? $\endgroup$
    – Joost
    Aug 13, 2019 at 8:44
  • 1
    $\begingroup$ @Joost: You want a double pole at $z=-r$, $|r|<1$, so your denominator polynomial is $(1+rz^{-1})^2=1+2rz^{-1}+r^2z^{-2}$. $\endgroup$
    – Matt L.
    Aug 13, 2019 at 9:21

If you are using Matlab or Octave, then consider trying firls. It allows you to specify an amplitude vs frequency template for the filter, which you can specify to avoid blow-up at high frequencies.

  • $\begingroup$ firls designs a filter with a piecewise linear magnitude response, so you can't use it here. $\endgroup$
    – Matt L.
    Jul 7, 2015 at 11:04
  • $\begingroup$ Well, it'll be better than an unstable filter, @MattL. ;-) $\endgroup$
    – Peter K.
    Jul 7, 2015 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.