Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def filter(y, sr):
- low_stop = 60 # Hz
- low_pass = 80
- high_pass = 1400
- high_stop = 1600
- filter_order = 1001
- # High-pass filter
- nyquist_rate = sr / 2.
- desired = (0, 0, 1, 1, 0, 0)
- bands = (0, low_stop, low_pass, high_pass, high_stop, nyquist_rate)
- filter_coefs = signal.firls(filter_order, bands, desired, nyq=nyquist_rate)
- # Apply high-pass filter
- filtered_audio = signal.filtfilt(filter_coefs, [1], y)
- return filtered_audio
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement