You should use this version instead; it's better.
Note that this uses a bilinear transform and so is not accurate at high frequencies.
Apply an A-weighting filter to a sound stored as a NumPy array.
Use Audiolab or other module to import .wav or .flac files, for example. http://www.ar.media.kyoto-u.ac.jp/members/david/softwares/audiolab/
Translated from MATLAB script (BSD license) at: http://www.mathworks.com/matlabcentral/fileexchange/69
I was asked on Stack Exchange for my MZTi code, even if crude, so here it is.
I don't think it's correct at very low sample rates, because of aliasing, but should be better at the typical 44.1 or 48 kHz. It's definitely wrong below fs = 2.5 kHz. In between, I think the MZTi zeroes are forcing it into compliance despite being poorly-transformed.
I don't think it makes much practical difference in dB levels vs the BLT method, by the way.
And the reference is https://www.khabdha.org/wp-content/uploads/2008/03/optimizing-the-magnitude-response-of-mzt-filters-mzti-2007.pdf