# How to analyse anti-causal discrete transfer function using matlab?

Consider a discrete transfer function that represents an anti causal filter such as a derivative filter: $$H(z) = (-z^{-2} -2z^{-1} +2z +z^2) (1/8T)$$

Where T is the sampling period. Normally in MATLAB, I use fvtool and enter coefficients but these coefficients are relevant to negative exponentials only, i.e. for a causal filter.

I want to view the magnitude response, phase response, pole zero map of an anti-causal filter in MATLAB. How is that possible?

• what is $1/8T$ ? – AlexTP Jul 24 '17 at 8:10
• T is the sampling period – D.Cohen Jul 30 '17 at 11:24

The transfer function $$H(z)=-z^{-2} -2z^{-1} +2z +z^2$$ can be written as \begin{align} H(z)&=z^2z^{-2}\left(-z^{-2} -2z^{-1} +2z +z^2\right)\\ &=z^2\left(-z^{-4} -2z^{-3} +2z^{-1} +1\right)\\ &=H_1(z)H_2(z) \end{align} It can now be seen more easily that

• $H_1(z)$ has two zeros at $z=0$ (and two poles at $\pm\infty$) .

• $H_2(z)$ has four poles at $z=0$ and four zeros: one at $z=1$ and three at $z=-1$. What can be said about pole-zero map of $H(z)$ overall?

• Since $|H_1(e^{j\omega})|=1$, we cnclude that $|H(e^{j\omega})|=|H_2(e^{j\omega})|$

• Since $\angle H_1(e^{j\omega})=2\omega$, we cnclude that $\angle H(e^{j\omega})=\angle H_2(e^{j\omega})+2\omega$

• That is a good mathematical interpretation of the filter, yet the implementation in Matlab is still unclear. The coefficients of H2(z) can be extracted as they have negative exponentials only, but how do you find the coefficients of the entire system? I want to filter a signal with this system. – D.Cohen Jul 30 '17 at 11:21
• $H_1(z)H_2(z)$ is the cascade of two systems: Shift the whole input by two samples to the left and then apply $H_2$ on the result (or apply $H_2$ on the input signal, then shift the result to the left by two samples). So you only need to implement the coefficients of $H_2$ which is straightforward. Is that clear? – msm Jul 30 '17 at 14:07
• Consider an input signal , x[n], by shifting to the left you mean implementing a time shift to the signal, x[n+2] ,that is the inverse z transform of X(z)*H1(z) = X(z)*z^2? – D.Cohen Jul 30 '17 at 14:26
• Precisely! $~~~~~$ – msm Jul 30 '17 at 14:29