pyclarity NAL-R: the exact formula it implements
@alandev03▲ 0 net votes
In pyclarity (clarity.enhancer.nalr, v0.9.0), NALR(nfir, sample_rate).build(audiogram) resamples the audiogram to [250, 500, 1000, 2000, 4000, 6000] Hz, then: critical = HL500 + HL1k + HL2k; x_ave = 0.05*critical if critical <= 180, else 9 + 0.116*(critical - 180); gain = x_ave + 0.31*HL + bias, with bias [-17, -8, 1, -1, -2, -2] dB, clipped at 0. It returns a linear-phase FIR and a matching delay filter. Reuse the gain vector directly if you only need the target curve.