Skip to article frontmatterSkip to article content

5. Filters

Introduction

To play low frequencies, a speaker needs to move a large volume of air slowly. To play high frequencies, it needs to move a small volume of air quickly. Because of these conflicting requirements HiFi speaker boxes typically use multiple speakers that are each designed for a certain frequency range. Playing frequencies outside that range may result in a quiet or inaccurate output, and may even damage the speaker.

Problem context of Module 5. Each transfer function is annotated, i.e. the voltage-to-voltage transfer function of each filter and the voltage-to-pressure transfer function of each speaker.

Figure 1:Problem context of Module 5. Each transfer function is annotated, i.e. the voltage-to-voltage transfer function of each filter and the voltage-to-pressure transfer function of each speaker.

The IP-1 speaker box houses 3 types of speakers, as shown in Figure 1. The woofer is designed for the bass (low) frequencies, the midtoner is designed for the middle frequencies, and the tweeter is designed for the treble (high) frequencies. The box has two woofers that are connected in parallel, resulting in a total of 4 speakers. The objective of this module is to create a filter for each speaker such that only frequencies within a desired range can pass. Tweaking these filters is also the main method of achieving a flat over-all acoustic transfer.

The following 4 sections gradually build up the knowledge to analyze filters, design filters, adjust per-speaker volume, and integrate everything. Instructions for building and testing filters are found at the end of this module.

Note that this chapter assumes that the load of each filter is approximately resistive. It will be denoted by RLR_L. This is because Zobel-compensated loudspeaker impedance is approximately resistive in the frequency range of operation. For more information on this, see Module 4.

Transfer Functions

Theory: Audio in Linear Circuits

To design a circuit that handles audio signals, it is important to know what these signals look like, and how they can be analyzed. In electronics, audio signals are continuous functions of time that are limited in amplitude and bandwidth. The amplitude limit exists because playback devices cannot have an infinite output voltage range. The bandwidth limit exists because the human ear can only hear frequencies between roughly 20 Hz and 20 kHz.

Audio signals can be broken down into mulitple signals with different frequencies. This breakdown is called a frequency spectrum, and it says how “present” each frequency in the signal is. To ensure that the system’s output sound accurately resembles its input voltage, the frequency spectra of both need to have roughly the same shape.

The transfer function H(ω)H(\omega) can be defined as the ratio of the output and the input spectrum. If H(ω)H(\omega), is a constant, then both spectra have the same shape. In this case it is said that the system has a flat transfer, because the graph of HH as a function of ω\omega is flat. The mathematics behind frequency spectra is outside the scope of IP-1, and will be treated in the 2nd year. Transfer functions, however, are very much of interest during this project.

Thankfully, the transfer function of any linear system, such as a linear circuit, can be obtained without knowing the frequency spectra of any signals. If the input x(t)x(t) is set to x(t)=ejωtx(t) = e^{j\omega t}, then any output y(t)y(t) is obtained through the expression y(t)=H(ω)ejωt=H(ω)x(t)y(t) = H(\omega) \cdot e^{j\omega t} = H(\omega) \cdot x(t) where HCH \in \mathbb{C}. That is, y(t)y(t) is also a complex exponential function with the same frequency as x(t)x(t) but its amplitude and phase are changed by H(ω)H(\omega) with respect to x(t)x(t). In other words, H(ω)H(\omega) can simply be obtained through phasor analysis.

Application

  1. Derive the transfer function H(ω)H(\omega) of the filters in Figure 2 and 3 below as a function of LL, CC, RLR_L and ω\omega using symbolic phasor analysis.

  2. Calculate the values of H(0)H(0) and limωH(ω)\lim_{\omega \to \infty} H(\omega). Which frequencies does each filter pass, and which frequencies does it block?

  3. Can you derive the same conclusions, without doing any calculations, from looking at each circuit and replacing the capacitors and inductors at DC or at high frequencies with open or closed circuits?

1st order filters

(a)

1st order filters

(b)

Figure 2:1st order filters

2nd order filters

(a)

2nd order filters

(b)

Figure 3:2nd order filters

Filter Design

Theory: LPFs and HPFs

Types and Bands

The magnitude H(ω)|H(\omega)| of the transfer function of each of the filters from the previous exercises is plotted in Figure 4 and 5. Clearly, the filters of plots 4a and 5a only pass low frequencies, and stop high frequencies. The opposite is true for the filters of plots 4b and 5b. Hence, they are called Low-Pass Filters (LPF) and High-Pass Filters (HPF) respectively. The frequency range in which a filter passes or stops signals is called the pass-band or stop-band respectively.

1st order LPF

(a)1st order LPF

1st order HPF

(b)1st order HPF

Figure 4:Example transfer functions of 1st order filters.

2nd order LPF

(a)2nd order LPF

2nd order HPF

(b)2nd order HPF

Figure 5:Example transfer functions of 2nd order filters.

Asymptotes and Corner Frequency

The transfer functions of each of these filters can be written as the ratio of two complex polynomials, as shown in (1), where the coefficients aia_i and bib_i are real numbers. The order of a filter is the highest order of B(jω)B(j\omega) or A(jω)A(j\omega).

H(ω)=B(jω)A(jω)=b2(jω)2+b1jω+b0a2(jω)2+a1jω+a0H(\omega) = \frac{B(j\omega)}{A(j\omega)} = \frac{b_2 \cdot (j\omega)^2 + b_1 \cdot j\omega + b_0}{a_2 \cdot (j\omega)^2 + a_1 \cdot j\omega + a_0}

The ratio of the lowest order terms of B(ω)B(\omega) and A(ω)A(\omega) yields an asymptote for the low frequency behavior. The ratio of the highest order terms yields an asymptote for the high frequency behavior. The asymptotes are represented in Figure 4 and 5 by light blue lines. In this manual we define the corner frequency fcf_c in Hertz or ωn\omega_n in rad/s as the intersection between the asymptotes. The corner frequency can be seen as the boundary between the pass-band and the stop-band.

How are cut-off, corner and -3 dB frequency different?

The term half-power frequency, or -3 dB frequency, refers to the frequency at which the signal power is half of the signal power of frequencies in the pass-band.

The terms cut-off frequency (ωc\omega_c) or corner frequency (ωn\omega_n) are used to refer to the frequency at which a filter transfer transitions between the pass-band and the stop-band.

People often refer to the -3 dB frequency as the cut-off or corner frequency, but it is dangerous to assume that this is always the case! In this manual, like in your EE1C2 textbook, the corner frequency is defined as the intersection of the asymptotes of the transfer function. In some cases people may even use their own definition of the exact value of the corner frequency.

Order and Roll-Off

The order of the stop-band asymptote determines how steep H(ω)H(\omega) is. The filters in plots 4a and 4b have a so-called 1st order roll-off because the stop-band asymptote is of the 1st order. The filters in plots 5a and 5b have a steeper 2nd order roll-off.

Quality Factor

The transfer functions of 2nd order LPFs and HPFs can be written in the generic forms of (2) and (3). The asymptotes are listed in Table 1, and can be derived solely from the 2nd and 0th order terms of the respective transfer functions.

HLPF(ω)=11ωn2(jω)2+1ωnQjω+1H_{LPF}(\omega) = \frac{1}{\frac{1}{\omega_n^2} \cdot (j\omega)^2 + \frac{1}{\omega_n Q} \cdot j\omega + 1}
HHPF(ω)=1ωn2(jω)21ωn2(jω)2+1ωnQjω+1H_{HPF}(\omega) = \frac{\frac{1}{\omega_n^2} \cdot (j\omega)^2}{\frac{1}{\omega_n^2} \cdot (j\omega)^2 + \frac{1}{\omega_n Q} \cdot j\omega + 1}

Table 1:2nd order LPF and HPF asymptotes

Filter Type

Pass-Band Asymptote

Stop-Band Asymptote

LPF

H(ω)=1|H(\omega)| = 1

H(ω)=ωn2ω2|H(\omega)| = \frac{\omega_n^2}{\omega^2}

HPF

H(ω)=ω2ωn2|H(\omega)| = \frac{\omega^2}{\omega_n^2}

H(ω)=1|H(\omega)| = 1

The 1st order term 1/ωnQ1/\omega_n Q determines how H(ω)|H(\omega)| transitions from one asymptote to the other around the corner frequency ωn\omega_n. The effect of this term is shown in Figure 6. The variable QQ is called the quality factor, and can be seen as a measure of how much the transfer function spikes at the corner frequency. In fact:

H(ωn)=Q|H(\omega_n)| = Q
The transfer function of a 2nd order LPF (left) and HPF (right) plotted for multiple values of Q.

Figure 6:The transfer function of a 2nd order LPF (left) and HPF (right) plotted for multiple values of Q.

The value of QQ, and whether H(ω)|H(\omega)| spikes, is related to how damped the circuit is:

Phase Shift

H(ω)H(\omega) is a complex number. If H(ω)=0H(\omega) = 0, the output signal is not shifted in phase with respect to the input signal. If H(ω)=+jH(\omega) = +j, then the output leads the input by 90°. The amount of phase shift H(ω)\angle{H(\omega)} is a function of ω\omega. Phase shift becomes relevant in the next section when we start to add the transfers of each speaker. When signals of opposite phase are summed they interfere destructively and cancel out, which causes a dip in the overall transfer function of the system.

Theory: BPFs

A filter that only passes frequencies between two corner frequencies is called a Band-Pass Filter (BPF). Figure 7 shows transfer of a 2nd order BPF.

Transfer function of a 2nd order BPF.

Figure 7:Transfer function of a 2nd order BPF.

Circuit of a 2nd order BPF.

Figure 8:Circuit of a 2nd order BPF.

A 2nd order BPF can be made by combining a 2nd order LPF and a 2nd order HPF into one circuit. Such a circuit is shown in Figure 8. The ODE describing the circuit behavior is of the 4th order, which makes both analysis and design incredibly difficult. However, fortunately the LPF and the HPF part can be designed independently under certain conditions.

jωL2RL  and  1jωC2RL|j\omega L_2| \ll R_{L} \text{~~and~~} |\frac{1}{j\omega C_2}| \gg R_L
jωL1RL  and  1jωC1RL|j\omega L_1| \gg R_{L} \text{~~and~~} |\frac{1}{j\omega C_1}| \ll R_L
The BPF from  turns into a 2nd order HPF when  holds.

Figure 9:The BPF from Figure 8 turns into a 2nd order HPF when (5) holds.

The BPF from  turns into a 2nd order LPF when  holds.

Figure 10:The BPF from Figure 8 turns into a 2nd order LPF when (6) holds.

These approximations are true when the corner frequency of the HPF in Figure 9 is much lower than the corner frequency of the LPF in Figure 10. As a rule of thumb, it should be at least 5 times smaller. The proof for this condition is given below.

Application

  1. Determine the type (LPF or HPF), and order of each of the circuits in Figure 2 and 3.

  2. Find the value of ωn\omega_n and H(ωn)|H(\omega_n)| as a function of RLR_L, CC and LL for each circuit.

  3. For which value of QQ does H(ωn)|H(\omega_n)| of the 2nd order LPF equal H(ωn)|H(\omega_n)| of the 1st order LPF? Anwer the same question for the HPFs. Is a 2nd order filter with this QQ overdamped, critically damped, or underdamped?

  4. Which filter would you use for which speaker?

Volume Adjustment

Theory: Resistive Attenuator

Each speaker has a different voltage-to-pressure conversion ratio within their operating range. However, to achieve a flat spectrum each speaker should be equally loud. This can be compensated for by adding a resistive divider at the input of each speaker to make the loudest speakers less loud. Doing so would affect the load resistance seen by the filters, meaning you would have to redesign them afterward. Fortunately, a resistive volume adjustment circuit can be made by adding a resistor in series and in parallel with the load as shown in Figure 11.

Resistive volume adjustment circuit.

Figure 11:Resistive volume adjustment circuit.

Application

  1. Calculate the equivalent impedance ReqR_{eq} of the circuit in Figure 11. seen by the input.

  2. Calculate the transfer function H(ω)=βH(\omega) = \beta, where the constant β\beta is the amplitude adjustment factor.

  3. Use the expressions derived above to find expressions for R2R_2 and R1R_1 as a function of β\beta such that the condition that Req=RLR_{eq} = R_L is satisfied.

Integration and Testing

Theory: Bode Plots

Transfer functions are often plotted on so-called Bode plots. The left plot graphs the magnitude H(ω)2|H(\omega)|^2 in decibels (dB), and the right plot graphs the phase H(ω)\angle H(\omega) in degrees. An example is shown in Figure 12.

Example of a Bode plot. Usually magnitude and phase are plotted separately, but sometimes they are combined into one plot for compactness.

Figure 12:Example of a Bode plot. Usually magnitude and phase are plotted separately, but sometimes they are combined into one plot for compactness.

For historical reasons the decibel is the conventional unit that ratios of power are expressed in. Decibels (dB) are equal to one-tenth of a bel (B), which is the base-10 logarithm of a ratio of power quantities. Using a logarithmic scale over a linear scale (see (7) and (8)) yields a number that is easier to work with when one power is many orders of magnitude larger than another.

G=PoutPin  [-]G = \frac{P_{out}}{P_{in}} \text{~~[-]}
GdB=10log10(PoutPin)  [dB]G_{dB} = 10 \log_{10}\left(\frac{P_{out}}{P_{in}}\right) \text{~~[dB]}
Scenario 1, where P_{L,1} is dissipated in Z_L.

Figure 13:Scenario 1, where PL,1P_{L,1} is dissipated in ZLZ_L.

Scenario 2, where P_{L,2} is dissipated in Z_L.

Figure 14:Scenario 2, where PL,2P_{L,2} is dissipated in ZLZ_L.

Consider the two scenarios in Figure 13 and 14, where Vin\mathbf{V}_{in}, Vout\mathbf{V}_{out}, ZL\mathbf{Z}_{L} and H(ω)\mathbf{H}(\omega) are phasors. The average power dissipated by the load in both scenarios can be compared in dB as in (9).

GdB=10log10(PL,2PL,1)=10log10(Vout22Re[ZL])(Vin22Re[ZL])=10log10VoutVin2G_{dB} = 10 \log_{10} \left( \frac{P_{L,2}}{P_{L,1}} \right) = 10 \log_{10} \frac{\left(\frac{|\mathbf{V_{out}}|^2}{2\text{Re}[\mathbf{Z_L}]}\right)}{\left(\frac{|\mathbf{V_{in}}|^2}{2\text{Re}[\mathbf{Z_L}]}\right)} = 10 \log_{10}\left| \frac{\mathbf{V}_{out}}{\mathbf{V}_{in}} \right|^2

Substituting Vout=H(ω)Vin\mathbf{V_{out} = \mathbf{H}(\omega) \mathbf{V_{in}}} further simplifies the expression to:

GdB=10log10H(ω)2=20log10H(ω)G_{dB} = 10 \log_{10} |\mathbf{H}(\omega)|^2 = 20 \log_{10} |\mathbf{H}(\omega)|

In other words, GdBG_{dB} shows the effect of the added circuit on the power transfer from input to output by comparing the scenario before (Fig. 13) and after (Fig. 14) inserting the circuit. This is what a Bode plot graphs, and this is why it graphs H(ω)2|H(\omega)|^2 in dB instead of simply H(ω)|H(\omega)|.

Application

The Tellegen Hall has 3 measurement setups for measuring frequency response of electrical or electro-acoustic systems. Each measurement yields the raw data of a Bode plot, i.e. H2|H|^2 and H\angle H as a function of frequency in Hertz. The setups are operated by TAs and lab staff. Please ask them if you want to perform a measurement. The following dropdown menus show each measurement setup and explain what they measure and how.

Setup 1: Filter Response Measurement

The filter response measurement setup returns a Bode plot of the voltage-to-voltage transfer function of the filter that was measured. The setup is shown in Figure 15.

Measurement setup for filter response measurement.

Figure 15:Measurement setup for filter response measurement.

In this setup a PC generates a signal that is turned into an analog voltage by a sound card. A voltage amplifier (buffer) with a low output impedance applies this voltage to the input of the tested filter such that the effect of the signal source’s resistance on the measurement becomes negligible. The voltage across the louspeaker is fed back to the PC through the sound card together with a copy of the source signal, which acts as a measurement reference. The PC generates a noise-like signal, and is able to calculate the transfer function of the filter based on the returned voltage.

Setup 2: Acoustic Response Measurement (Short Range)

The short range acoustic response measurement setup returns a Bode plot of the voltage-to-pressure transfer function of a speaker. The setup is shown in Figure 16.

Measurement setup for short range acoustic response measurement.

Figure 16:Measurement setup for short range acoustic response measurement.

The setup is and works the same as setup 1 except there is no filter, and the voltage that is fed back into the PC via the sound card comes from a microphone positioned 2 cm from the speaker cone. This voltage is proportional to the measured sound pressure. By measuring so closely to the speaker, the influence of sound reflections in the room on the measurement is low. Only one speaker can measured at a time with this setup.

Setup 3: Acoustic Response Measurement (Long Range)

The long range acoustic response measurement setup returns a Bode plot of the voltage-to-pressure transfer function of the system as a whole, including the power amplifier, filter(s) and speaker(s). The setup is shown in Figure 16.

Measurement setup for long range acoustic response measurement.

Figure 17:Measurement setup for long range acoustic response measurement.

The setup is and works the same as setup 2, except the buffer is replaced by your power amplifier, and one or more filters and speakers depending on how many you want to measure simultaneously. The microphone is placed 1 m in front of the speaker box at the height of the tweeter. The distance from each speaker to the microphone is approximately equal, which allows you to measure the entire system at once. However because of this, the measurement is also more sensitive to sound reflections in the room.

At the start of this project you are given measurement data obtained with setup 2 for each speaker type. Using this data and the theory presented in this module, design and build filters such that the acoustic response of the system as a whole is as flat as possible between 20 Hz and 20 kHz. You can use setup 3 to test this. Passive components to build filters with are available in the lab. Note that these components only have values that are part of the E series.

You are highly recommended to simulate your circuits in LTspice or Python before building them, and to use setup 1 to verify their behavior before using setup 2 and 3 to measure acoustic transfers.