cdactvm commited on
Commit
3fdf8ae
·
verified ·
1 Parent(s): 76f58dd

Update highPassFilter.py

Browse files
Files changed (1) hide show
  1. highPassFilter.py +2 -2
highPassFilter.py CHANGED
@@ -1,8 +1,8 @@
1
  # Function to apply a high-pass filter
2
- from scipy.signal import butter
3
  def high_pass_filter(audio, sr, cutoff=300):
4
  nyquist = 0.5 * sr
5
  normal_cutoff = cutoff / nyquist
6
  b, a = butter(1, normal_cutoff, btype='high', analog=False)
7
- filtered_audio = filter(b, a, audio)
8
  return filtered_audio
 
1
  # Function to apply a high-pass filter
2
+ from scipy.signal import butter, lfilter
3
  def high_pass_filter(audio, sr, cutoff=300):
4
  nyquist = 0.5 * sr
5
  normal_cutoff = cutoff / nyquist
6
  b, a = butter(1, normal_cutoff, btype='high', analog=False)
7
+ filtered_audio = lfilter(b, a, audio) # ✅ Correct function
8
  return filtered_audio