cdactvm commited on
Commit
412403d
·
verified ·
1 Parent(s): fb9d859

Create highPassFilter.py

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