def butter_lowpass_filter(data, cutoff, fs, order=2):
"""
This function designs a Butterworth lowpass filter and applies it to the data
:param data: Audio data to be lowpass filtered
:param cutoff: Cutoff frequency in Hz
:param fs: Samplerate of audio
:param order: Order of the filter, defaults to second order filter as required by timbral_metallic
:return: Returns the filtered signal
"""
b, a = butter_lowpass(cutoff, fs, order=order)
y = lfilter(b, a, data)
return y
评论列表
文章目录