Spaces:
Sleeping
Sleeping
Update highPassFilter.py
Browse files- 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 =
|
| 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
|