[LAD] stereospread.lv2 - Stereo spreading plugin (conjugate random phase all-pass filter pair)

Florian Paul Schmidt mista.tapas at gmx.net
Wed Nov 16 12:51:44 CET 2022


I wrote a small plugin for spreading mono content to stereo and I would
like to receive some feedback on it from people more knowledgable in DSP
matters than me.

It has one nice property: It spreads the signal over the spectrum by way
of a conjugate pair of random phase all-pass filters, and since it's a
conjugate pair it sums back to unity when down-mixing to mono. So, no
ugly comb filter effects like when downmixing a Haas-expanded signal.


The page has an example sound..

How it works:

It's actually rather simple:

1. create a vector of random phases (matlab notation):

filter_length = 1000;
spread = pi;

hfft1 = exp(-1i*(spread*rand(filter_length,1) - spread/2));

And for the second filter just take the complex conjugate:

hfft2 = conj(hfft1);

This ensures that what is a phase theta in the first filter becomes a
phase of -theta in the second filter, and summed that just gives a phase
of 0.

2. Then assemble the coefficients such that it corresponds to a fft of a
real signal and do the inverse fft (possibly I have a small error here
which i needed to fix with the 'symmetric' flag in matlab):

f1 = ifft([1; hfft1; conj(hfft1((end-1):-1:1))], 'symmetric');
f2 = ifft([1; hfft2; conj(hfft2((end-1):-1:1))], 'symmetric');

3. The two IRs f1 and f2 implement the pair of filters and can be
applied via convolution (which the above plugin does).

It seems to be possible with little ill effect to reduce the length of
the filter down to a size of 50 samples or so by just cutting it off
before the convolution.

What do you think?

Kind regards,


More information about the Linux-audio-dev mailing list