# All-pass filters to remedy group delay

I would like to sum a filterbank made of bandpass butterworth filters to reconstruct an audio signal. Given group delays for each channel shown in the following plot . . .

How would I go about designing complementaty allpass filters to flatten this out somewhat? It doesn't have to be completely flat, just a bit flatter than it is. Sampling the impulse responses to make linear phase filters is not an option at the moment.

The Matlab code used to generate this is shown below. Note: I have multiplied the group delays by a factor of 2 as the signal is passed through the bank twice.

sr = 22050;

%Make octave wide filters
cfs = [125 250 500 1000 2000 4000];
bw = 1; %octaves

nBins = 2^12;
gd = zeros(nBins,numel(cfs));

for nn = 1:numel(cfs)
cf = cfs(nn);
loEdge = cf*(2^-bw/2);
hiEdge = cf*(2^+bw/2);
[b, a] = butter(2, [loEdge hiEdge]/(sr/2), 'bandpass');
[gd(:,nn),f] = grpdelay(b,a,nBins,sr);
end

figure; semilogx(f,2*gd); xlim([10 8000])
legend(num2str(cfs')); xlabel ('F [Hz]'); ylabel('Group delay [samples]')

• Butterworth filters are really not a very good choice for multiband processing and resynthesis. I doubt you will be able to get the results you expect even with phase compensation. Are you sure you cannot use a more suitable alternative? – Jazzmaniac Dec 26 '13 at 15:30
• What's the problem you're trying to solve that way? – sellibitze Jan 25 '14 at 21:24

Maybe you'd be better off using Bessel-Thompson filters. Maybe one could find an all-pass that approximately corrects a Butterworth filter, but it looks rather hard.

You could use half order filtres and filter bidirectionally, which worldwide result in linear phase. Even in case of real-time processing overlap and add block processing approximations could be used.

I manage this (in a pretty much perfect manner), in the following way:

I'm assuming that you have a set of lowpass & highpass filters, where LPx and HPx are at the same frequency in order to do the splitting. LP0 is the lowest crossover frequency, LP2 is the highest.

I generate the signals like this:

----- LP0 ----- LP1 ----- LP2 --- lowest frequency subband
|
--- HP0 ----- LP1 ----- LP2 ---
|
--- HP1 ----- LP2 ---
|
--- HP2 --- highest frequency subband


With this filter network, all signals have the same delay, and can be added back together in a pretty much perfect manner.

It works like a charm for me. Please vote up or accept my answer if you like it :-)

Thanks, -Caleb