I'm trying to design the highpass filter in Python for my accelerometer data in order to integrate them. I need to preserve low frequencies. For example, data with a sampling frequency of 2 kHz need to have a highpass filter with a cutoff frequency of 1 Hz, maybe even 0.5 Hz. Unfortunately, scipy signal filters (I tried all of them) cannot design the highpass filter so low. In the image below you can see that under 10 Hz nothing changes even with different order. I tried web filter designs (e.g. https://fiiir.com/ ) and have the same result - not possible to go lower. On the other hand, when using the same filter in LabVIEW, the filter works great even for lower frequencies. Where's the mistake? And how can I solve it? Here's the code in case it's not a theoretical issue:
data=TDMS_reader(folder,file,ch_lst=ch_lst) fs=1/(data[1,0]-data[0,0]) #sampling frequency cutoff=[0.5,1,10] #freq in Hz order=[2,4] for i in range(len(cutoff)): for j in range(len(order)): sosv=signal.butter(order[j], cutoff[i], 'highpass',fs=fs,output="sos") w, h = signal.sosfreqz(sosv, fs=fs)
Thanks for all your help.