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
The short answer is: yes, of course it's possible to design non-causal filters. Consider a simple first order IIR filter:
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
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.