Open joelle-o-world opened 4 years ago
def preemphasis(signal, coeff=0.95):
"""perform preemphasis on the input signal.
:param signal: The signal to filter.
:param coeff: The preemphasis coefficient. 0 is no filter, default is 0.95.
:returns: the filtered signal.
"""
return numpy.append(signal[0], signal[1:] - coeff * signal[:-1])
js translation:
function preemphasis(signal, coeff=0.95){
let arr = [signal[0]];
for(let i=1; i<signal.length; ++i)
arr.push( signal[i] - coeff * signal[i-1] );
return arr
}
Tentatively closing this issue having added a Preemphasis transform stream....
python function, fbank, shows that preemphasis is applied before the signal is divided into frames.