Design an analog K-weighting filter

GroupDIY Audio Forum

Help Support GroupDIY Audio Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

vmsa

Member
Joined
Jun 20, 2022
Messages
20
Location
Argentina
Designing an analog K filter

I present to you another disruptive idea. In this design, I attempt to emulate the filter that is necessary for creating an analog loudness meter, in accordance with the ITU - BS1770 recommendation.
As sure you know, the Loudness Meters are implemented for the digital audio, in software, and used within a DAW to measure and normalize audio levels
As a "vintage" electronics enthusiast, I was motivated by the provocation that these devices don’t exist in the analog world. The challenge of designing and evaluating a useful device that operates in the analog domain was irresistible! All the parameters specified in the documents are based on algorithms for implementation in the digital domain. However, measuring loudness outside the digital environment can be valuable, even if it’s an approximation of actual values.

Of course, a good calibration of the audio voltages, corresponding to the dBFS values displayed on the DAW screen will be necessary, but it can be done. Accuracy to tenths of a dB may be impractical to obtain, but in fact, prototypes that have operated satisfactorily within a range below 1 dB have proven to be useful, when a reference value is needed within an audio chain. Moreover, designing a meter in the analog environment allows it to be built using readily available, cost-effective components, without the need for programming expertise. And it’s fun!

In short, to obtain a meter that measures ‘loudness’, you need to follow these steps:
  • Each input channel passes through a K-weighting frequency filter.
  • Measure its RMS (Root Mean Square) value.
  • Adjust the gain of each channel according to its spatial position.
  • Add (sum) all channels. (Note: You need to sum the power, not the amplitude.)
  • Apply time integration, which varies depending on the chosen measurement mode.
  • Then, weight it in decibels (take the logarithm), and call it LU or LK.
  • The resulting value is displayed in various ways, such as a numerical value, a bar, radar sweeps, etc.

The K-weighting filter

The K filter is the first step in the process. We can say that this weighting consists of two parts (or two filters in a chain). It involves a high-pass filter for frequencies below 100 Hz and another high-pass filter for frequencies above 1 kHz. This approximates the loudness perceived at around 70 dB SPL by our auditory system.
The parameters for the two parts of the K-weighting curve are as follows:

1697065347410.png
Fig 1: Frequency Response Curves of K-Weighting​

The filter known as RLB (Revised Low-Frequency B-Weighting) is a high-pass filter with a resonance frequency of 37 Hz and a Q factor of 0.5. A key detail in my design is that its output must terminate at -4 dB to enable the pre-filter to achieve the 4 dB gain.

The other filter, referred to as the Pre-Filter, is a high-pass filter that rises by 4 dB for high frequencies. The resonance frequency is 1.7 kHz, and the Q factor is 0.7. Therefore, above the cutoff frequency, the total output is 0 dB, as depicted in Fig 2.

1697065307054.png
Fig 2: K-Weighting Response Curve​

Design

To construct an analog filter, a good option is to consider a filter based on the well-known Sallen-Key circuit. Initially, I attempted to create both parts separately, in two stages. While this can be done, it’s complicated and I found it unsatisfactory. That’s when the idea of combining them into a single stage was born.
By merging them, a single stage that performs all the filtering is obtained. To achieve this, a new Sallen Key implementation had to be developed, which I hadn’t seen anywhere else, could be considered original - a homegrown filter, a crazy variation!

1697065425558.png
Fig. 3: Basic Sallen-Key filter diagram​

Starting from the basic theory modeled with four impedances and considering the requirement of having a Q of 0.5 at 37 Hz and 0.7 at 1.7 kHz for the two high-pass filters, I deduced that in the RLB, the resistance ratio (Z4 and Z3) would have to be 1, and for the pre-filter, 0.5. So, I transitioned from the general circuit shown in Fig 3, to the one in Fig 4.

1697065481760.png
Fig. 4: My developed circuit

In this configuration, Z4, Z6, and Z7 constitute the pre-filter, while Z1, Z2, and the combination of Z4+Z5 make up the RLB filter. Z3 is common to both filters.
It’s clear that one filter is in parallel with the other, so their mutual impact needs to be considered in the calculations. However, since the RLB operates at low frequencies and the pre-filter at high frequencies, the overlap is not severe, or significant. At low frequencies, Z6 and Z7 will be negligible, and at high frequencies, Z1 and Z2 will be reduced to a resistance. As a result, Z1, Z2, and Z5 form a resistive pass network in a star configuration that affects the pre-filter.
In the low-frequency part of the filter (the RLB filter), the branches Z1 and Z2, which typically only contain capacitors, will now include a series resistor to achieve a -4 dB attenuation for this filter’s output, as shown in Figure 5.

1697065628749.png
Fig. 5: RLB Filter diagram​

I chose R3 to be 100K because it's a relatively high value, which allow me to use small capacitors. Additionally, I'll use TL084 type operational amps with FET input.
For a Q of 0.5, I choose (R4 + R5), as R3, to be equal at 100 Kohms. To calculate the output attenuation, assuming capacitors are shorted (at high frequencies), we have two attenuators in cascade: (R1 // R4+R5) and (R2 // R3). If we aim for a -4 dB attenuation, which corresponds to 0.63 times, each of the two resistors (R1 and R2) will contribute with a square root of 0.63, which is approximately 0.79.

Therefore, the values of R1 and R2 will be:
R = (100K / 0.79) - 100K = 26.58K
I’ve chosen 27K.

The parallel resistance is half of that, which is 13.5K. So, the ratio of the resistors (m) will be calculated as:

m = 100K / (100 + 13.5) K = 0.88​
Taking the square root gives approximately 0.94.

The capacitors will be calculated as follows:

C = 0.16 / (37 Hz * 113.5K * 0.94) = 40 nF​

Now, for the high-frequency part, given that here Q = 0.7 which needs a m = 2, and as: Q = √(m)/2 (where m is the ratio between resistances),
with one resistor (R3) at 100K and the other (R4) at 27K from the star equivalent, I select a value of 18K for R4.

1697066168584.png
Fig. 6: Pre-filter​

To calculate the capacitors based on the filter's resonance at 1.7 kHz, I used:

C = 0.16 / (1.7 K * 13.5 K * 1.41) = 4.9 nF,​
I choose 4.7 nF.

Since the resistance for the RLB filter was 100k, and for the pre-filter is 18k, we have R5 = 100 - 18 = 82k.
Adjusting the corresponding values.

Furthermore, the capacitors are in parallel between both branches, and as I will use 4.7 nF capacitors. To reach an effective 40 nF in the RLB filter part, I will reduce C3 and C4 to 33 nF, which is the nearest available value.
It's clear that I'm attempting to create a compromise between accuracy and real-world implementation with this K-weighting filter. Some deviation from the ideal curve would be acceptable for me. It's merely a reference point to be able to evaluate audio levels in LU or LK with good approximation.

Now we have all the values to assemble them in Multisim and verify their response, as shown in Figure 7.

1697066285957.png

Fig. 7: Filter Measurements in the Simulator​

The simulation confirmed that the calculated values were reasonably accurate. While there was some deviation from the ideal curve, it was close enough to be usable in a "home-made" analog loudness meter. Comparing it to an actual meter further affirmed the effectiveness of this approximation.

The Fig. 8 shows the curve obtained from the circuit wired in the Protoboard using the Spectra Plus software. As can be seen, it presents a good similarity with the specified response in the ITU1770.

K filter Proto.jpg

Fig 8: Measurement from the circuit implemented

Conclusions

In my test I found that the expected values at the output of a K-weighted filter at various frequencies depend on the chosen reference point. This could be at the maximum output value (referenced to the output at high frequencies), at 1 kHz (which is the typical adjustment frequency in audio), or in the region where the filters overlap (where the curve is relatively flat at around 500 Hz). Then I show you them in the Table 1.

Frequency [Hz]
Ref. Máx.
Ref. 1 KHZRef. 500Hz
10​
-27,7​
-24,4​
-23,7​
20​
-17,3​
-14​
-13,3​
50​
-7,9​
-4,6​
-3,9​
100​
-5,1​
-1,8​
-1,1​
200​
-4,3​
-1​
-0,3​
500​
-4​
-0,7​
0​
1.000​
-3,3​
0​
0,7​
2.000​
-0,9​
2,4​
3,1​
5.000​
0​
3,3​
4​
10.000​
0​
3,3​
4​
20.000​
0​
3,3​
4​

Table 1: Values of K filter stage output, depending on the chosen reference.​

I hope this article has been useful in helping you understand how a Loudness Meter works. I also hope you find this design interesting as it demonstrates how to create a variation of an SK filter to implement a response that is more complex than a simple high-pass or low-pass filter. With a single stage, this design provides the weighted output to feed an RMS meter, which is how Loudness would be measured according to the ITU standard, BS1770.
I owe you a circuit board, but the ones I’ve built have been hand-wired. Nevertheless, it’s a straightforward circuit to construct. The challenge remains.

Thank you all for your time and attention. I hope this article has sparked some ideas and deepened our understanding of electronics. Remember, every circuit we build, every problem we solve, brings us one step closer to the next great breakthrough in electronics. Keep experimenting and keep exploring!
 

Attachments

  • 1697065158286.png
    1697065158286.png
    102.2 KB · Views: 1
Your design appears to be exactly what I've been looking for, so I've implemented it into the KiCad 8 Simulator - which uses ngspice. It produces a similar plot, except that the HF shelves at 8db above the 500Hz area. My question, as I'm new to simulation, which plot do you think is correct?
 
Your design appears to be exactly what I've been looking for, so I've implemented it into the KiCad 8 Simulator - which uses ngspice. It produces a similar plot, except that the HF shelves at 8db above the 500Hz area. My question, as I'm new to simulation, which plot do you think is correct?
Hello, I designed it using Multisim, as shown. I wouldn't be able to tell you how it works in the KiCad simulator. But check the connections; perhaps there's a mistake in the filter network junction. I've built it in hardware, as shown, and the measurements on the bench were satisfactory, so I'm confident it should be fine. Greetings.
 
Back
Top