DSPRelated.com
Blogs

Digital State Variable Filters

A classic analog filter is the so-called "state variable filter". This blog covers realization of a continuous-time second-order lowpass filter as a state-space model which is then digitized via both forward and backward Euler schemes to produce the so-called Chamberlin form of a digital resonator (which has desirable numerical properties). Finally, the Faust form of the resonator is derived.

Normalized Second-Order Continuous-Time Lowpass Filter

The transfer function of a normalized second-order lowpass can be written as

lowpass transfer function

where the normalization maps the desired -3dB frequency \omega _{c} to 1, i.e.,

\tilde{s} = \frac{s}{\omega_c}

and the ``quality factor'' Q is defined as

Q = \frac{\omega_c}{2\alpha}

where \alpha is a convenient definition for bandwidth in radians per second, given by minus the real part of the complex-conjugate pole locations \conj{p} and \overline{p} in the s plane:

p,\pc = -\alpha \pm j\sqrt{\omega_c^2-\alpha^2}

Here we assume 0<\alpha<\omega_c, so that the poles have nonzero imaginary parts.

A second-order Butterworth lowpass filter is obtained for Q=1/\sqrt{2}. Larger Q values give the ``corner resonance'' effect often used in music synthesizers.

Bode Plots for Second-Order Butterworth Filters

Filters of this type are nicely viewed in a Bode plot which shows the magnitude frequency response (in dB) versus a log frequency axis.  In matlab we can say, for example,

sys = tf(1,[1,sqrt(2),1]);
bode(sys);

to see the frequency response of our normalized second-order Butterworth lowpass filter.

Note that our lowpass is easily converted to a bandpass or highpass filter by changing the transfer-function numerator from 1 to s or s^2, respectively:

bode(tf([0 0 1],[1,sqrt(2),1])); % lowpass
bode(tf([0 1 0],[1,sqrt(2),1])); % bandpass
bode(tf([1 0 0],[1,sqrt(2),1])); % highpass
bode(tf([1 0 1],[1,sqrt(2),1])); % notch

These frequency responses are shown below:

Figure 1: Overlay of normalized second-order Butterworth lowpass, bandpass, highpass, and notch filters.
Bode plots for various second-order Butterworth filters

$$y(t) = k_0 + \sum_{n=1}^{\infty} \int_{-\infty}^{\infty}\cdots \int_{-\infty}^{\infty}k_n(t_1,t_2,\ldots,t_n)x(t-t_1)x(t-t_2)\cdots x(t-t_n)dt_1dt_2\cdots dt_n$$



To post reply to a comment, click on the 'reply' button attached to each comment. To post a new comment (not a reply to a comment) check out the 'Write a Comment' tab at the top of the comments.

Please login (on the right) if you already have an account on this platform.

Otherwise, please use this form to register (free) an join one of the largest online community for Electrical/Embedded/DSP/FPGA/ML engineers: