## 1. Introduction

Sallen and Key filters are active filters built from RC networks, comprising only resistors and capacitors. The absence of self-induction coils allows them to operate at low frequency, for example for audio signal processing.

This document presents examples of Sallen and Key filters. We are first of all interested in an elementary cell which performs a filter of order 2, then we will see how to associate several cells in order to obtain a higher order.

## 2. Low pass filter

### 2.a. 2nd order filter

The following figure shows the schematic of a Sallen and Key low pass filter:

The active element is a voltage amplifier of gain K. Ideally, the amplifier should have an input impedance large enough to be considered infinite, and an output impedance of zero. It performs the following function: Vs (t) = KV1 (t) (1)

It was originally a tube amplifier. Today, transistors (invented in 1947) have replaced tubes (these are still used in high-end Hi-Fi). To make a voltage amplifier, the simplest solution is to use an integrated circuit called an integrated linear amplifier (or op-amp). A gain K = 1 can be obtained with a follower assembly:

To obtain a gain greater than 1, the non-inverting amplifier assembly is used:

For an ideal op-amp, the transfer function looks like this: H (ω) = K1 + mjωωc + jωωc2 (2)

avec :ωc=1RC1C2(3)m=2C1C2+C2C1(1-K)(4)

The first relation fixes the cutoff frequency. The coefficient m is adjusted to optimize the frequency response of the filter. A Butterworth-type response gives a uniform decay of -40 decibels per decade in the attenuated band. This is obtained with m = 2 (5)

A simple way to get this value is to choose K = 1 (follower amplifier) and 2C1 = C2. This solution has the advantage of giving a filter of unity gain in the passband. The downside is the practical difficulty of choosing two capacitors satisfying this condition while fixing the cutoff frequency. Furthermore, it may be advantageous to vary the gain K. A more flexible solution consists in choosing C1 = C2 = C. We then have m = 3-K. The value of K can be adjusted precisely by placing a potentiometer in the divider bridge. To obtain the Butterworth filter of order 2, we therefore need K = 1.586.

Here is an example :

import numpy from matplotlib.pyplot import * C=10e-9 R=22e3 m=numpy.sqrt(2) K=3-m fc=1.0/(1*numpy.pi*R*C) def H(f): return K/(1+1j*m*f/fc-(f/fc)**2) def bode(H,start,stop): freq = numpy.logspace(start=start,stop=stop,num=1000) h = H(freq) gdb = 20*numpy.log10(numpy.absolute(h)) phi = numpy.angle(h) figure(figsize=(8,8)) subplot(211) plot(freq,gdb) xscale('log') xlabel("f (Hz)") ylabel("GdB") grid() subplot(212) plot(freq,phi) xscale('log') xlabel("f (Hz)") ylabel("phi") grid() bode(H,1,5)

### 2.b. Order n filter

In certain cases, a more selective filter is sought, that is to say one whose slope in the band is attenuated is greater. By associating filters like the previous one in series, we can obtain a Butterworth filter of order n = 2p, whose gain has the following form: G (ω) = 11 + ωωc2n (6)

The slope in the attenuated band is then -20n decibels per decade.

This is obtained by associating in series p second-order filters, with the following coefficients: mi = 2sinπni + 12 (7) Ki = 3-mi (8)

with i = 0.1 … p-1. For example, to obtain a filter of order 4, we use two filters of order 2 with the same values of R and C, the first with K = 1.152, the second with K = 2.235.

Other types of frequency responses (Bessel and Chebyshev) can be obtained with other values of K.

## 3. Band pass filter

The following figure shows the diagram of a bandpass filter:

For an ideal amplifier, the transfer function is of the following form: H (ω) = Amjωω01 + mjωω0 + jωω02 (9)

avec :A=K5-K(10)ω0=2RC(11)m=5-K2(12)

*ω0 is the central pulsation of the passband, corresponding to the maximum of the gain and to a zero phase shift. The bandwidth width is: Δω = ω02 (5-K) (13)*

The gain K makes it possible to adjust the width of the passband. It must be less than 5, otherwise the circuit is unstable. A value close to 5, for example K = 4.8, makes it possible to obtain a very selective band-pass filter. As K approaches 5, the maximum gain A increases. If you want to operate at constant gain, you can add an amplification stage with a 1 / A gain at the output.

The following figure shows an embodiment of this filter with an op-amp and a potentiometer allowing to precisely adjust the coefficient K between 4.3 and 5.3.

Here is Bode’s diagram for K = 4.8:

C=10e-9 R=22e3 K=4.8 f0=numpy.sqrt(2)/(2*numpy.pi*R*C) m=(5-K)/numpy.sqrt(2) def H(f): return K/(5-K)*(1j*m*f/f0)/(1+1j*m*f/f0-(f/f0)**2) bode(H,1,5)

## 4. High pass filter

For an ideal amplifier, the transfer function is of the following form: H (ω) = Ajωωc21 + mjωωc + jωωc2 (14)

with: A = K (15) ωc = 1RC (16) m = 3-K (17)

As for the low-pass filter, we choose m = 2 to have a constant slope of +20 decibels per decade in the attenuated band. Here is Bode’s diagram:

import numpy import math import cmath from matplotlib.pyplot import * C=10e-9 R=22e3 m=numpy.sqrt(2) K=3-m fc=1.0/(1*numpy.pi*R*C) def H(f): return K*(f/fc)**2/(1+1j*m*f/fc-(f/fc)**2) bode(H,1,5)