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
@ThomQu
ABC_weighting()
produces analog filter coefficients. ThenA_weighting()
converts it to a digital filter using bilinear transform (which has the discrepancy of going to zero at fs/2, so it's only accurate for low frequencies or if your sampling rate is high), thenA_weight()
actually applies that digital filter to a signal.