How to design an inverse for a Butterworth low-pass filter? 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!
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 &lt; 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
plot(w/pi,20*log10(abs(H1.*H2)))
grid on, xlabel('normalized frequency'),
ylabel('dB'), title('equalized response')