libiir  1.1.1
Describing IIR filters as strings

This library allows the user to describe an IIR filter chain as a string, which is useful to allow configurable filtering using e.g. a configuration file. This page describes the format of such strings.

The string is first split into individual IIR filters. Each filter is written as type(params) and separated by whitespace. The string must contain at least one filter but may contain an arbitrary number.

Description of filter types

Raw coefficients

An IIR filter may be specified as raw coefficients, in which case the type is raw and the params consists of a string:


The coefficients c[0]…c[i] and d[0]…d[i] are written in standard C floating-point notation. They are separated by commas, except the transition between c and d coefficients, which is separated by a slash.

Butterworth filters

For a low-pass filter, type is butterworth_lowpass. For a high-pass filter, type is butterworth_highpass. Parameters as per iir_butterworth_lowpass(), i.e.:


For band-pass filters, type is butterworth_bandpass. For band-stop filters, type is butterworth_bandstop. Parameters as per iir_butterworth_bandpass(), i.e.:


Anything greater than 4th order will be split into multiple 4th-order (or less) segments. Note however this will lead to the corner frequencies being off.