I'm trying to design a lowpass IIR filter with 5Hz cutoff frequency (sample frequency is 200Hz). i know how to create it with fdatool, or with functions such as 'butter' or 'ellip'. However, i think that all the filters created are causal. Is it possible to create also noncausal filters? Thanks in advance
1 Answers
The short answer is: yes, of course it's possible to design non-causal filters. Consider a simple first order IIR filter:
$$y[n]=ay[n-1]+bx[n]\tag{1}$$
If implemented in the way as indicated in Eq. (1), this filter is causal. It is also stable if $|a|<1$. Now rewrite (1) as
$$y[n-1]=\frac{1}{a}y[n]-\frac{b}{a}x[n]\tag{2}$$
Implemented in this way, you compute $y[n-1]$ from the future samples $y[n]$ and $x[n]$, so the system is anti-causal. Note that it is stable if $|a|>1$. Similar considerations apply to higher-order filters.
One way of realizing non-causal IIR filters is implemented in Matlab's filtfilt function. How this works is described in this answer.
Non-causal FIR filters can always be implemented by appropriate buffering of the input signal and delaying the output signal.
Taking the oppurtunity..do you know how to design filters with minimum group delay?
– lorenzo0820 Dec 17 '14 at 20:08