def test_multi_frequency_weighting(kinds): freq = np.linspace(2e1, 2e4) assert np.allclose(librosa.multi_frequency_weighting(freq, kinds), np.stack([ librosa.A_weighting(freq), librosa.Z_weighting(freq), librosa.C_weighting(freq), ]), 0, atol=1e-3)
def test_Z_weighting(min_db): # Check that 1KHz is around 0dB d_khz = librosa.Z_weighting(np.linspace(2e1, 2e4), min_db=min_db) assert np.allclose(d_khz, 0, atol=1e-3)