I have to analyze a dynamic signal but there is too much noise so I applied low pass filter but then there is too much phase shift.So what is the most reactive filter I can apply to my signal ?
Best regards
I have to analyze a dynamic signal but there is too much noise so I applied low pass filter but then there is too much phase shift.So what is the most reactive filter I can apply to my signal ?
Best regards
Technically, the most reactive filter is the all-pass filter with a gain of 1, this filter has no phase shift at all. But it is not a really useful filter.
Here's what you need to take in account :
1 - IIR versur FIR
An IIR filter will have less phase shift than a FIR filter for the same cut-off frequency
2 - Cut-off frequency
For an IIR low-pass filter, a filter with 0.1 Fs cut-off frequency will have a higher phase-shift than a with a 0.2 Fs cut-off frequency. An all-pass filter i.e. a gain of 1 has no phase shift.
3 - IIR filter order
For an IIR, the higher the order, the higher the phase shift.
4 - FIR number of taps
Assuming you a linear-phase low-pass FIR filter, the more taps you have the higher the phase shift. If you want a high cut-off frequency you can get by with less taps. If you want a really low cut-off frequency you will need more taps thus more phase shift.
5 - Minimum phase-filter
There is a class of filter called minimum-phase filter. They are the most reactive (fastest decay) for a given cut-off frequency according to this reference
https://www.dsprelated.com/freebooks/filters/Minimum_Phase_Filters.html
If you do offline processing then consider using sgolay filter in matlab or the filtfilt function which is supposed to give zero phase shift. I particularly like sgolayfilt with coefficient 3 and window size 11.
If you want zero phase filtering in real time then predictive filter such as the kalman filter is a good solution. Use a simple velocity filter or second order acceleration filter. If I have measurements of second derivative of the signal I like to use acceleration filter with jerk as the input. This gives me precise measurements of both first and second derivative of the measured signal as well as the signal itself with zero phase shift (or within +-0.2 deg is what I aim for)
Even though @Ben has already given a wonderful answer I would like to add that there's a technique called zero-phase filtering which allows you to have no phase delay at all. However, I must say that in order to implement this in a causal way you will have to work with a buffer of stored samples over which you apply zero-phase filtering. If your application can tolerate this initial delay then you could perform real time processing (process a buffer while the next is being filled with new samples) and you would get no output delay. See Matlab's filtfilt