Filter Realization Basics

First of all we researched an efficient approach to real time filtering. We came to the conclusion that biquad filters are a flexible filter framework since various practical second order filter types can be realized by biquad filters.

Filter Process <>

A biquad’s behaviour and filter properties are completely determined by its six coefficients B0, B1, B2, A0, A1, A2 and its two states T1 and T2 which are basically the last two processed samples.

At first we just saved exactly those two states. Later on we faced the issue that we would have to save and load states repeatedly if we wanted to do some filter property computation during processing. Filter Channels > As a result we decided to implement filter channels. Each channel has its own states and one of those channels (R) is reserved for filter property computations. Hence no more state juggling is necessary.

Supported Filter Types and Adjustable Parameters

We implemented the most basic and important filter types, namely, peak, high/low/all pass, high/low shelf, band pass, band reject and smoothing filter. For each filter type we apply the calculation rules presented in the book DAFX: Digital Audio Effects to compute the biquad coefficients based on given practical parameters (center frequency (fc), sampling rate (fs), gain, quality value (q), smoothing parameter (p)).

Filter Types <>

Filter Updating

As mentioned earlier biquad filters are very flexible. Biquads of different filter types can be converted into any other filter type. For this purpose the biquad coefficients have to be computed again and updated. In case a user wants to only adjust the filter parameters, such an update routine is necessary aswell. Filter Update <> This update mechanism is implemented via asynchronous communication. If any parameter is changed, a flag _valuechange is set to true. The coefficients can then be updatet by calling the method update_coefficients_if_needed.

Summary

Filter >>>

Each filter is a biquad filter that consists of its six coefficients, all adjustable parameters (fc, fs, q, p, gain), a vector of states (each vector entry has two states) and a filter type that characterizes which adjustable parameters have to be used in the update process of the coefficients.

Reference

(1) Udo Zölzer (2011) DAFX: Digital Audio Effects, 2nd ed., published by John Wiley & Sons