Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
A-weighting filter (16kHz sampling) for SoX. Filter coefficient was picked up from FaNT (http://dnt.kr.hs-niederrhein.de/indexbd2f.html?option=com_content&view=article&layout=default&id=22&Itemid=15&lang=en)
-1.6382357e-06
-1.2934910e-06
-1.7385587e-06
-1.3888608e-06
-1.8607494e-06
-1.5019314e-06
-2.0060450e-06
-1.6312799e-06
-2.1713256e-06
-1.7674181e-06
-2.3438207e-06
-1.8309434e-06
-2.5008428e-06
-1.9986466e-06
-2.6278900e-06
-2.1538604e-06
-2.8921719e-06
-2.3937852e-06
-3.2266221e-06
-2.6943428e-06
-3.6253145e-06
-3.0507522e-06
-4.0881743e-06
-3.4641669e-06
-4.6192077e-06
-3.9393221e-06
-5.2253031e-06
-4.4835132e-06
-5.9156418e-06
-5.1061270e-06
-6.7013635e-06
-5.8182256e-06
-7.5949695e-06
-6.6314414e-06
-8.6084136e-06
-7.5545151e-06
-9.7474348e-06
-8.5843287e-06
-1.0998501e-05
-9.5123118e-06
-1.2275144e-05
-1.0697707e-05
-1.3519617e-05
-1.1900826e-05
-1.5080674e-05
-1.3346547e-05
-1.6891618e-05
-1.5022834e-05
-1.8957029e-05
-1.6936753e-05
-2.1291059e-05
-1.9104871e-05
-2.3916618e-05
-2.1552123e-05
-2.6864817e-05
-2.4311450e-05
-3.0175015e-05
-2.7424142e-05
-3.3895450e-05
-3.0940663e-05
-3.8083927e-05
-3.4921073e-05
-4.2806773e-05
-3.9432665e-05
-4.8130861e-05
-4.4547959e-05
-5.4110641e-05
-4.9781081e-05
-6.0531466e-05
-5.5916291e-05
-6.7260773e-05
-6.2471078e-05
-7.5018452e-05
-6.9964294e-05
-8.3833553e-05
-7.8489896e-05
-9.3813004e-05
-8.8158972e-05
-1.0508612e-04
-9.9106007e-05
-1.1781066e-04
-1.1149480e-04
-1.3217771e-04
-1.2552361e-04
-1.4841748e-04
-1.4143187e-04
-1.6680726e-04
-1.5950964e-04
-1.8768220e-04
-1.8011049e-04
-2.1144734e-04
-2.0366775e-04
-2.3858298e-04
-2.3076412e-04
-2.6970431e-04
-2.6068439e-04
-3.0470598e-04
-2.9539153e-04
-3.4372547e-04
-3.3441055e-04
-3.8864336e-04
-3.7937085e-04
-4.4046553e-04
-4.3137871e-04
-5.0044145e-04
-4.9173817e-04
-5.7009788e-04
-5.6205602e-04
-6.5134093e-04
-6.4435206e-04
-7.4658367e-04
-7.4120025e-04
-8.5891976e-04
-8.5592508e-04
-9.9237016e-04
-9.9288457e-04
-1.1522407e-03
-1.1578865e-03
-1.3456457e-03
-1.3588154e-03
-1.5822673e-03
-1.6068612e-03
-1.8758951e-03
-1.9136171e-03
-2.2431308e-03
-2.3028597e-03
-2.7086945e-03
-2.8016113e-03
-3.3128457e-03
-3.4554588e-03
-4.1128850e-03
-4.3307405e-03
-5.1954680e-03
-5.5282360e-03
-6.6941327e-03
-7.2036258e-03
-8.8183744e-03
-9.6005282e-03
-1.1902644e-02
-1.3103694e-02
-1.6491125e-02
-1.8322423e-02
-2.3491695e-02
-2.6208083e-02
-3.4489664e-02
-3.8127744e-02
-5.2632400e-02
-5.4864159e-02
-8.8774525e-02
-1.2614848e-02
1.0035687e+00
-1.2614848e-02
-8.8774525e-02
-5.4864159e-02
-5.2632400e-02
-3.8127744e-02
-3.4489664e-02
-2.6208083e-02
-2.3491695e-02
-1.8322423e-02
-1.6491125e-02
-1.3103694e-02
-1.1902644e-02
-9.6005282e-03
-8.8183744e-03
-7.2036258e-03
-6.6941327e-03
-5.5282360e-03
-5.1954680e-03
-4.3307405e-03
-4.1128850e-03
-3.4554588e-03
-3.3128457e-03
-2.8016113e-03
-2.7086945e-03
-2.3028597e-03
-2.2431308e-03
-1.9136171e-03
-1.8758951e-03
-1.6068612e-03
-1.5822673e-03
-1.3588154e-03
-1.3456457e-03
-1.1578865e-03
-1.1522407e-03
-9.9288457e-04
-9.9237016e-04
-8.5592508e-04
-8.5891976e-04
-7.4120025e-04
-7.4658367e-04
-6.4435206e-04
-6.5134093e-04
-5.6205602e-04
-5.7009788e-04
-4.9173817e-04
-5.0044145e-04
-4.3137871e-04
-4.4046553e-04
-3.7937085e-04
-3.8864336e-04
-3.3441055e-04
-3.4372547e-04
-2.9539153e-04
-3.0470598e-04
-2.6068439e-04
-2.6970431e-04
-2.3076412e-04
-2.3858298e-04
-2.0366775e-04
-2.1144734e-04
-1.8011049e-04
-1.8768220e-04
-1.5950964e-04
-1.6680726e-04
-1.4143187e-04
-1.4841748e-04
-1.2552361e-04
-1.3217771e-04
-1.1149480e-04
-1.1781066e-04
-9.9106007e-05
-1.0508612e-04
-8.8158972e-05
-9.3813004e-05
-7.8489896e-05
-8.3833553e-05
-6.9964294e-05
-7.5018452e-05
-6.2471078e-05
-6.7260773e-05
-5.5916291e-05
-6.0531466e-05
-4.9781081e-05
-5.4110641e-05
-4.4547959e-05
-4.8130861e-05
-3.9432665e-05
-4.2806773e-05
-3.4921073e-05
-3.8083927e-05
-3.0940663e-05
-3.3895450e-05
-2.7424142e-05
-3.0175015e-05
-2.4311450e-05
-2.6864817e-05
-2.1552123e-05
-2.3916618e-05
-1.9104871e-05
-2.1291059e-05
-1.6936753e-05
-1.8957029e-05
-1.5022834e-05
-1.6891618e-05
-1.3346547e-05
-1.5080674e-05
-1.1900826e-05
-1.3519617e-05
-1.0697707e-05
-1.2275144e-05
-9.5123118e-06
-1.0998501e-05
-8.5843287e-06
-9.7474348e-06
-7.5545151e-06
-8.6084136e-06
-6.6314414e-06
-7.5949695e-06
-5.8182256e-06
-6.7013635e-06
-5.1061270e-06
-5.9156418e-06
-4.4835132e-06
-5.2253031e-06
-3.9393221e-06
-4.6192077e-06
-3.4641669e-06
-4.0881743e-06
-3.0507522e-06
-3.6253145e-06
-2.6943428e-06
-3.2266221e-06
-2.3937852e-06
-2.8921719e-06
-2.1538604e-06
-2.6278900e-06
-1.9986466e-06
-2.5008428e-06
-1.8309434e-06
-2.3438207e-06
-1.7674181e-06
-2.1713256e-06
-1.6312799e-06
-2.0060450e-06
-1.5019314e-06
-1.8607494e-06
-1.3888608e-06
-1.7385587e-06
-1.2934910e-06
-1.6382357e-06
#!/bin/bash
src=$1
dst=${2:-}
if [ -z $dst ]; then
b=$(basename $src .wav)
d=$(dirname $src)
dst="$d/${b}.aw.wav"
fi
echo sox $src $dst fir ~/local/etc/a_weight_fir_16k.txt
sox $src $dst fir ~/local/etc/a_weight_fir_16k.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment