Skip to content
Joakim Fors edited this page Nov 5, 2015 · 4 revisions

Notes

Filters

How to calculate biquad filter parameters for the shelving pre-filter and high-pass filter stages of the ITU-R BS.1770 K-weighting filter.

Shelving filter

The cutoff frequency of the shelving pre-filter is 1500 Hz. The biquad coefficients can be calculated using the following formula from http://www.musicdsp.org/files/Audio-EQ-Cookbook.txt:

f0 = 1500;
w0 = 2*pi*f0/fs;
Q = 0.5;
gain = 4;
A = 10^(4/40);
S = 1;
alpha = sin(w0)/2 * sqrt((A + 1/A)*(1/S -1) + 2); 
b0 =    A*( (A+1) + (A-1)*cos(w0) + 2*sqrt(A)*alpha );
b1 = -2*A*( (A-1) + (A+1)*cos(w0)                   );  
b2 =    A*( (A+1) + (A-1)*cos(w0) - 2*sqrt(A)*alpha );
a0 =        (A+1) - (A-1)*cos(w0) + 2*sqrt(A)*alpha;
a1 =    2*( (A-1) - (A+1)*cos(w0)                   );  
a2 =        (A+1) - (A-1)*cos(w0) - 2*sqrt(A)*alpha;

High-pass filter

Use a cutoff frequency of 38 Hz to obtain the same frequency response as the filter given in ITU-R BS.1770-4. The biquad coefficients can be calculated as follows:

f0 = 38; 
w0 = 2*pi*f0/fs;
Q = 0.5;
alpha = sin(w0)/(2*Q);
b0 =  (1 + cos(w0))/2;
b1 = -(1 + cos(w0));
b2 =  (1 + cos(w0))/2;
a0 =  1 + alpha;
a1 = -2*cos(w0);
a2 =  1 - alpha;
Clone this wiki locally