## Re: Changing filter's coefficients to compensate sampling rate changes

#####
Reply #10 –

By MathWorks: ( https://www.mathworks.com/help/audio/ref/weightingfilter-class.html?s_tid=gn_loc_drop )

"*These coefficients are recomputed for nonstandard sample rates using the algorithm *

described in Mansbridge, Stuart, Saoirse Finn, and Joshua D. Reiss. "**Implementation **

and Evaluation of Autonomous Multi-track Fader Control." Paper presented at the

132nd Audio Engineering Society Convention, Budapest, Hungary, 2012."

(AES Convention Paper 8588)

Looks like the original coefficients are calculated using:

% ITU-R BS1770-4 --------------------------------------

fs = 48000;

% HSF

db = 3.999843853973347;

f0 = 1681.974450955533;

Q = 0.7071752369554196;

K = tan(pi * f0 / fs);

Vh = power(10.0, db / 20.0);

Vb = power(Vh, 0.4996667741545416);

pa0 = 1.0;

a0 = 1.0 + K / Q + K * K

pb0 = (Vh + Vb * K / Q + K * K) / a0

pb1 = 2.0 * (K * K - Vh) / a0

pb2 = (Vh - Vb * K / Q + K * K) / a0

pa1 = 2.0 * (K * K - 1.0) / a0

pa2 = (1.0 - K / Q + K * K) / a0

% HPF

f0 = 38.13547087602444;

Q = 0.5003270373238773;

K = tan(pi * f0 / fs);

rb0 = 1.0

rb1 = -2.0

rb2 = 1.0

ra0 = 1.0

ra1 = 2.0 * (K * K - 1.0) / (1.0 + K / Q + K * K)

ra2 = (1.0 - K / Q + K * K) / (1.0 + K / Q + K * K)

% ------------------------------------------------------

Could this same code be used to calculate coefficients for other samplerates by just changing the vlue of parameter **fs[/]?**