I have an array of date whose sampling rate is 160GHz, and I wish to apply 30kHz-100kHz bandpass filter to the data. I write as follows:
import scipy.signal as dsp
import numpy as np
fs=160e9
data=np.random.rand(int(1e-4*fs))
b, a = dsp.butter(5, [30e3/(fs/2),100e3/(fs/2)],btype='band')
result=dsp.filtfilt(b,a,data)
However, result is nan. But if I reduce the sampling rate like this, it works:
import scipy.signal as dsp
import numpy as np
fs=160e9
data=np.random.rand(int(1e-4*fs))
data=data[::10000] # 100 does not work
fs=fs/10000
b, a = dsp.butter(5, [30e3/(fs/2),100e3/(fs/2)],btype='band')
result=dsp.filtfilt(b,a,data)
In this way I can get correct result, but the analysis is really rough. So it seems while filter frequency is much lower than sampling rate, the Butterworth filter cannot work correctly. How can I solve this problem?