Voltecx is in beta. The macOS build comes first; Windows and Linux packages are still being tested.Beta. macOS comes first; Windows and Linux are still in testing. What's new
Documentation

IIR Filter (Biquad Cascade) (iir)

Filters a sampled signal with a chain of second-order sections.

iir

Component reference · 繁體中文

Group: Control · Kind: {"block":"iir","kind":"control"}

When to use it

Use it for Butterworth, Chebyshev or elliptic filters exported from a filter design tool. Use FIR Filter when you need linear phase.

Pins

Pin Domain Meaning
in signal Signal to filter, sampled every ts
out signal Filtered output, held between samples

Common parameters

  • ts: Time between samples (Default: required)
  • sections: Filter sections, six numbers each (Default: required)
  • gain: Overall gain applied to the input (Default: 1)

Parameters

Key Unit Default Typical range Description
ts s required Time between samples
offset s 0 Time of the first sample
sections — required Filter sections, six numbers each
gain — 1 Overall gain applied to the input
lo — -1e30 Lowest value the output can reach; the limited output is what the filter remembers
hi — 1e30 Highest value the output can reach; the limited output is what the filter remembers
y0 — 0 Output at the start while the input is zero (needs a pole at z = 1)

Parameter descriptions are in English in both languages.

Model

sections holds six numbers per section, b0, b1, b2, a0, a1, a2, one section after the other, at most 64 sections. Each section is (b0 + b1·z^-1 + b2·z^-2) / (a0 + a1·z^-1 + a2·z^-2) with a0 not 0. The input is first multiplied by gain, then passes through the sections in order. The block has direct feedthrough only when gain and every b0 are not 0.

Common mistakes

  • Each section lists the top part first: b0, b1, b2, a0, a1, a2. Swapping the two halves gives a different filter with no warning, and a list whose length is not a multiple of 6 is refused.
  • Design the sections for the same ts the block uses. If your design tool gives the overall gain as a separate number, enter it as gain; if the gain is already inside the b coefficients, leave gain at 1.

Problems rules: compile.error

Datasheet and sources

ts is the sample time of the data, 1/fs. The sections and the gain come from a filter design tool, using your cutoff, order and filter family at that sample rate, exported as second-order sections.

Example

Open the example with the command file.openExample and the name demo:iir.


Generated by cargo xtask reference from the usage texts and parameter specs. Do not edit by hand.