hislope = (freqs[2] - fftfreqs) / (freqs[2] - freqs[1])
// .. then intersect them with each other and zero
wts[i, :(1 + n_fft/2)] = np.maximum(0,
np.minimum(loslope, hislope))
// Slaney-style mel is scaled to be approx constant E per channel
enorm = 2.0 / (binfreqs[2:n_filts+2] - binfreqs[:n_filts])
After Change
upper = (freqs[i+2] - fftfreqs) / (freqs[i+2] - freqs[i+1])
// .. then intersect them with each other and zero
weights[i, :size] = np.maximum(0, np.minimum(lower, upper)) * enorm[i]
return weights