Punjabi_ASR_Demo / highPassFilter.py
cdactvm's picture
Update highPassFilter.py
b579841 verified
raw
history blame
306 Bytes
# Function to apply a high-pass filter
from scipy.signal import butter
def high_pass_filter(audio, sr, cutoff=300):
nyquist = 0.5 * sr
normal_cutoff = cutoff / nyquist
b, a = butter(1, normal_cutoff, btype='high', analog=False)
filtered_audio = filter(b, a, audio)
return filtered_audio