With an audio .wav file (sampled at 44.1 or 96 Khz), I would like to filter out everything outside the 20 - 20000 Hz range.
I tried a Butterworth bandpass filter and there were unstability issues, but the choice of a Butterworth was completely random among lots of filtering methods:
we could also use a Butterworth low-pass filter at 20000hz, followed by another Butterworth high-pass filter at 20hz
we could choose other IIR filters (Chebyshev, etc.)
or FIR filters, etc.
So many solutions!
What would you choose to filter out everything outside the 20 - 20000 Hz range of an audio file? (Python code welcome)
Additional notes about transition bandwidth: on the 20 Hz side, I would like no low-frequency rumble, so having some 18 Hz component is ok, but having DC component or 5 Hz rumble is unwanted. On the 20000 Hz side, idem: having 20.1 Khz component is ok, but there should be very few left at 21 Khz.
______________________ 0 dB / \ / \ ___/ \______ -100 dB 0 10 20 20k 21k