Wanted to know the feasibility and usefulness of implementing Zero-Phase Anti-Causal filters such as those mentioned at this link in modern embedded signal processing applications given the advancement of devices on which these applications are now running, resource wise it should not be difficult to implement.

I.e., something like Matlab's filtfilt, as opposed to a typical causal IIR filter (picture from the same page):

enter image description here

The question I want to ask is that if it they are indeed used in practical systems with the advantage of zero-phase distortions or are there other variables in play as well due to which the traditional causal FIR filters are still preferred if non-linear phase distortion is not acceptable?

  • $\begingroup$ Your question seems to be mixing the meanings of "anti-causal filter". Traditionally, FIR filters are usually symmetric around the midpoint, and are traditionally designed using a filter that's symmetric around zero that is then just translated until it is causal. In a tradition that makes me want to chew nails, these are often called "non-causal". They have a linear -- not zero phase response when used in real time, but the phase delays in the system can be easily lined up. Is this what you mean when you say "anti-causal"? $\endgroup$
    – TimWescott
    Commented Feb 1, 2023 at 19:24
  • $\begingroup$ @TimWescott, sorry If the question wording caused any confusion. "In a tradition that makes me want to chew nails, these are often called "non-causal"" I believe when the FIR filter has been translated then it is no longer "non-causal". However when I used the term 'anti-causal' in the question I referred to the technique shown here: mathworks.com/help/signal/ug/… $\endgroup$
    – malik12
    Commented Feb 2, 2023 at 7:58
  • $\begingroup$ @TimWescott, I'll edit the question as well, thank you for pointing out the mixup $\endgroup$
    – malik12
    Commented Feb 2, 2023 at 7:59
  • $\begingroup$ If I understand correctly, you want to know if it’s possible to implement 0-delay filters in real time ? In which case, the answer is no $\endgroup$
    – Jdip
    Commented Feb 2, 2023 at 15:32
  • $\begingroup$ The technique in the link you provided is only possible in offline processing (or in a block-based real time scenario, but will introduce a delay equal to at least the size of the input block). $\endgroup$
    – Jdip
    Commented Feb 2, 2023 at 15:37

1 Answer 1


It depends on your definition of "real time" and how you expect the filter to be used.

Can you implement a two-way, offline IIR filtering scheme like Matlab's filtfilt in an embedded system? Yes, absolutely.

Of necessity, you need to implement it in such a way that once you are done collecting a segment of data you can run it on that data after the fact.

So if you define "real time" as "for every filter input sample I immediately have a filter output sample" -- no, you can't do that. You cannot do that because the filtfilt function runs a perfectly ordinary filter forward through the data from beginning to end, then it runs the same filter backward through the data, from end to beginning. That second step means that you either need a system that sees into the future (that's the "anti-causal" part), or you need to do the filtering retrospectively, on a batch of data that's already been collected (at which point there's a lot of delay and phase shift).

But the definition of "real time" above is not the accepted definition of "real time".

If you define "real time" in the accepted manner -- that all delays are known and guaranteed, and that a system isn't broken if all promises are met -- then yes, you can do offline filtering of chunks of data in a real time system.

  • $\begingroup$ thank you for the detailed explanation and the last part of you answer is precisely what I had in mind that as long as delays are known and guaranteed, it should not be an issue. However, when such block wise processing is being done using IIR filters will the phase between multiple blocks remain maintained or would there be some offsets which would have to be adjusted to maintain coherency? $\endgroup$
    – malik12
    Commented Feb 3, 2023 at 5:41
  • $\begingroup$ That really should be asked as a separate question. Short answer: if you timestamp things very carefully, the phase between multiple blocks can be maintained, with effort. $\endgroup$
    – TimWescott
    Commented Feb 3, 2023 at 15:11
  • $\begingroup$ Ok, thanks for the response, I'll do some work on it and create a new question if and when I get stuck at that part.. $\endgroup$
    – malik12
    Commented Feb 4, 2023 at 8:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.