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 @annezhangxue @shangyan0517 @frgos2 @masahf @mankind-nil @Zeokat
Can you all tell me how you use this code so I can improve it? I tried to fold it into a library with other related functions like THD+N calculators, etc. But people still comment on this gist, so maybe it's better for it to be self-contained? I assume you are all using the digital filter version and not the analog filter coefficients?