This is a collection of IIR digital filter plugins, designed for using a computer to perform crossover and equalization for active loudspeakers. The plugins are written for LADSPA, the Linux Audio Developers Plugin API, so they can be used in any LADSPA-capable host: I mostly use ecasound. The code is released under the GNU Public License, i.e. this is free software.
I developed these for implementing DSP versions of the Linkwitz Labs Pluto and LX521. Now I use them for rapid-prototyping audio reproduction systems. But the filters are generic building blocks that could be used for other things. It's hardly an exhaustive collection, just what I've needed myself and have bothered to write. I'll probably add more over time.
Indeed. Most of the filters here have already been implemented elsewhere. But since existing implementations lack clear documentation, it was difficult to discover e.g. the order of a filter and what its parameters mean (does the frequency of a highpass give the -3dB point? or the -6dB point? Is it 6dB/oct? or 12?) I ended up writing these plugins myself so I could be certain that the parameters have their standard meanings in the audio engineering world, and that the filters have the expected magnitiude and phase responses.
I've tested the filters extensively for distortion: it's neglibible. You can run the tests yourself -- I've included them in the testing
folder. The filters do what they're supposed to while adding barely measurable distortion or digital "noise". Beyond that, questions as to whether these filters are more (or less) "transparent" than others are misguided. But yes, the filters are "audiophile quality" if that matters.
Source Package |
Release Date |
14-05-2013 |
|
rt-plugins-0.0.2.tar.gz |
26-06-2013 |
rt-plugins-0.0.3.tar.gz |
03-09-2013 |
rt-plugins-0.0.4.tar.gz |
28-07-2015 |
rt-plugins-0.0.5.tar.gz |
07-03-2016 |
rt-plugins-0.0.6.tar.gz |
04-01-2017 |
Label |
Index |
Parameters |
Description |
RTlowpass1 |
9015 |
fc[Hz] |
1st-order low-pass, -3dB at fc |
RThighpass1 |
9016 |
fc[Hz] |
1st-order high-pass, -3dB at fc |
RTlowpass |
9006 |
fc[Hz], Q |
2nd-order low-pass, -3dB at fc |
RThighpass |
9007 |
fc[Hz], Q |
2nd-order high-pass, -3dB at fc |
RTlr4lowpass |
9020 |
fc[Hz] |
Linkwitz-Riley 4th-order low-pass, -6dB at fc |
RTlr4hipass |
9021 |
fc[Hz] |
Linkwitz-Riley 4th-order high-pass, -6dB at fc |
RTlowshelf |
9002 |
gain[dB], fc[Hz], Q |
low shelving (unity gain at high frequency) |
RThighshelf |
9003 |
gain[dB], fc[Hz], Q |
high shelving (unity gain at low frequency) |
RTparaeq |
9001 |
gain[dB], fc[Hz], Q |
parametric eq (notch/peak) at fc |
RTallpass1 |
9010 |
fc[Hz] |
1st-order all-pass (non-inverting) |
RTallpass2 |
9005 |
fc[Hz], Q |
2nd-order all-pass (non-inverting) |
The parameters take floating point values. The gain
parameter can be positive or negative. The fc
parameter specifies the corner frequency for the high- and low-pass
filters, and the center of the transition band for the shelving and
all-pass filters.
All of the plugins are designed for real-time use. They
are implemented as digital
biquads, designed by applying a bilinear
transform
to the corresponding analog transfer function, with pre-warping to
account for the frequency-warping inherent to biquads. The biquad
coefficients and accumulators are kept in double precision (53 bits of
precision) to make quantization distortion negligible (except maybe for extremely high Q
or low fc
).
I have a blog post that includes some typical magnitude and phase response measurements for all of these, plus some examples of how to use the filters in ecasound.
Note: Each plugin is supposed to have a unique index, assigned by the ladspa.org people. I haven't requested these indices yet as things are still in flux. If you have other LADSPA plugins with the same index values I don't know what will happen.
ladspa.h
installed on your system. You can get it here, or on Ubuntu (and
probably other Debian-based distros) you can just do: sudo
apt-get
install ladspa-sdk
tar xfz rt-plugins-x.x.x.tar.gz
(where x.x.x is the version number)cd rt-plugins-x.x.x/build/
cmake ..
make
sudo make install
By default this installs the plugins in /usr/local/lib/ladspa
.
If you
want them to go somewhere else, edit the Makefile
before
installing.
You probably want to set the environment variable LADSPA_PATH to
contain the path
to the plugins, so they can be found; something like this in your
~/.bashrc (or some such):
export LADSPA_PATH=/usr/local/lib/ladspa:/usr/lib/ladspa
Unfortunately sine.so
(installed by ladspa-sdk) has a
bug that can throw a
"double free or corruption" error, even if you don't actually use that
plugin (I think it occurs when a LADSPA host scans for available
plugins). If you encounter this the best remedy is probably to
just rm -f /usr/lib/ladspa/sine.so
.
I used some of Steve Harris's wonderful swh-plugins as a code
base, which in turn implements the digital biquads
described in Robert Bristow-Johnson's "Cookbook
formulae for audio EQ biquad filter coefficients" (you can
find the corresponding transfer functions defined there). I changed the interface to some of the filters and implemented
some that were missing (shelving and all-pass filters). Thanks Steve for making the code available.
Most of what you need to understand how the filters work can be found in wikipedia:
http://en.wikipedia.org/wiki/Digital_filter