[pulseaudio-discuss] patch to add low pass filtered lfe output via module-lfe-lp
Alexander E. Patrakov
patrakov at gmail.com
Fri Mar 1 06:36:46 PST 2013
2013/3/1 Justin Chudgar <justin at justinzane.com>:
> I was planning to address the channel preferences somehow. I know that some
> recievers have a "small/medium/large" setting for each channel-pair indicating
> the low freq capabilities of the attached speakers. This seems like a good
> idea from the perspective of limiting the audio knowledge required of the end
> user, but becomes a nightmare with the current "key=value" modargs system.
Well, that's not my area of expertise, too. I think Colin or Arun can
help you figure out how to implement the relevant sink properties.
> As far as the 1st order butterworth, it was simply the easiest thing for me to
> get working. I'm a total novice when it comes to technical audio and signal
> processing, so I am very interested to hear specific recommendations on the
> actual lowpass/highpass implementation. I'm planning on trying librtfilter just
> to be able to quickly listen to different implementations. If there is a better
> way, let me know.
As for comparing classical lowpass IIR filters - they sound nearly the
same. What matters is how to make sure that the signal that you added
to LFE is meaningfully subtracted from the original channel (or, more
precisely, what the original channel has to be replaced with in order
to avoid playing unwanted frequencies through any channel, losing any
frequencies, or playing any frequencies twice - once in that channel
and once in the LFE channel). It's the result of this "subtraction"
that is not well-described in filter cookbooks. The problem is that
the gain does not change as quickly as one would expect from an IIR
filter of a given order as one changes the frequency of the input
signal if you go with the "subtract lowpass filter output from the
original channel" approach. The keyword to search for is "crossover
What you implemented is just a pair of 1st order IIR filters. A pair
of 1st order filters is a valid choice for a crossover, and it even
makes a transient-perfect crossover. The drawback is that both
high-pass and low-pass filters have a rather slow rolloff.
Another popular solution with IIR crossover filters is
http://en.wikipedia.org/wiki/Linkwitz-Riley_filter . If you can make a
2nd-order Butterworth filter, you can make an LR-4 crossover, too. It
is allpass (does not introduce gain errors), but not transient-perfect
(introduces phase errors).
And, if you are too lazy to understand all the math, just use a FIR
filter. It is very easy to design a pair of zero-phase FIR filters
that will together make a transient-perfect crossover with as sharp
transition between the two bands as you want.
> Just to be explicit, links to documentation about appropriate filters would be
> greatly helpful.
FIR filters are well documented in this free book:
http://www.dspguide.com/ (be sure to read an important FFT-based
speedup technique, that is, sadly, not implemented in pulseaudio's
module-virtual-surround-sink.so). As for IIR, I don't know a single
book that covers the whole topic well.
Alexander E. Patrakov
More information about the pulseaudio-discuss