io7m | single-page | multi-page | Aradine User Manual
4.1. com.io7m.aradine.envelope.table1
Previous
4. DSP Modules
Up
4.3. com.io7m.aradine.filter.recursive1
Next

# 4.2. com.io7m.aradine.filter.biquad1

- 4.2.1. Overview
- 4.2.2. Applications
  - 4.2.2.1. Cascading
  - 4.2.2.2. Uses
- 4.2.3. References

## 4.2.1. Overview

1
The com.io7m.aradine.filter.biquad1 module contains biquad filter implementations.

## 4.2.2. Applications

## 4.2.2.1. Cascading

1
Biquad filters can be composed to produce stronger filters. The output signal of one filter is fed into the input of another filter in a process known as cascading. The main filter implementation included in the com.io7m.aradine.filter.biquad1 module is a filter of order 2 (specifically, it has two poles, and two zeroes). It would be theoretically possible to use the same algorithm with more filter coefficients to produce a single filter of order N, but in practice it is better to cascade N / 2 filters of order 2; the resulting filter will be much more numerically stable and less subject to issues such as those involving floating point precision.
2
For example, the following code uses four filters of order 2 to produce an effective filter of order 8:

### 4.2.2.1.3. Order 8

    final var stage0 = new ARBQ1BiquadBPFO2();
    final var stage1 = new ARBQ1BiquadBPFO2();
    final var stage2 = new ARBQ1BiquadBPFO2();
    final var stage3 = new ARBQ1BiquadBPFO2();

    final var s0 = stage0.processOneFrame(input);
    final var s1 = stage1.processOneFrame(s0);
    final var s2 = stage2.processOneFrame(s1);
    final var out = stage3.processOneFrame(s2);

## 4.2.2.2. Uses

1
Biquad filters are relatively suitable for use in EQ applications, or when the filter cutoff value is not expected to be modulated over time. For rapidly modulating filter cutoff values, a state variable filter may be more suitable.

## 4.2.3. References

1
The filter implementation is loosely based upon the C++ implementation provided at https://www.earlevel.com/main/2012/11/26/biquad-c-source-code/.
4.1. com.io7m.aradine.envelope.table1
Previous
4. DSP Modules
Up
4.3. com.io7m.aradine.filter.recursive1
Next
io7m | single-page | multi-page | Aradine User Manual