# Direct form I and Direct form II

I was studying about realization structures of digital filters. Is it mandatory to have the order of numerator must be less than that of denominator of transfer function for realization of filter using direct form I and II?

• and it doesn't matter if it's DF1 or DF2 or Lattice or some other form of realization. the controlling issue is that the "realizable" filter must be causal. Dec 28 '17 at 8:00

no. but, for a causal LTI digital filter with a rational transfer function, it is necessary that the number of zeros, $M$, not exceed the number of poles, $N$.

\begin{align} \\ H(z) \triangleq \frac{Y(z)}{X(z)} & = H_0 \frac{(z-q_1)(z-q_2)(z-q_3)...(z-q_M)}{(z-p_1)(z-p_2)(z-p_3)...(z-p_N)} \\ \\ & = H_0 \frac{z^M (1-q_1 z^{-1})(1-q_2 z^{-1})(1-q_3 z^{-1})...(1-q_M z^{-1})}{z^N (1-p_1 z^{-1})(1-p_2 z^{-1})(1-p_3 z^{-1})...(1-p_N z^{-1})} \\ \\ & = z^{M-N} \ \frac{H_0 \ (1-q_1 z^{-1})(1-q_2 z^{-1})(1-q_3 z^{-1})...(1-q_M z^{-1})}{(1-p_1 z^{-1})(1-p_2 z^{-1})(1-p_3 z^{-1})...(1-p_N z^{-1})} \\ \\ & = z^{M-N} \ \frac{b_0 + b_1 z^{-1} + b_2 z^{-2} + b_3 z^{-3} + ... + b_M z^{-M} }{ 1 + a_1 z^{-1} + a_2 z^{-2} + a_3 z^{-3} + ... + + a_N z^{-N} } \end{align}

this gets manipulated:

\begin{align} Y(z) & \left( 1 + a_1 z^{-1} + a_2 z^{-2} + ... + a_N z^{-N} \right) \\ & \quad = X(z) z^{M-N} \left( b_0 + b_1 z^{-1} + b_2 z^{-2} + ... + b_M z^{-M} \right) \end{align}

or

\begin{align} Y(z) = \ & b_0 z^{M-N} X(z) + b_1 z^{M-N-1} X(z) + b_2 z^{M-N-2} X(z) + ... \\ & \quad ... + b_M z^{-N} X(z) - a_1 z^{-1}Y(z) - a_2 z^{-2}Y(z) - ... - a_N z^{-N}Y(z) \end{align}

inverting the Z Transform, this becomes

\begin{align} y[n] = \ & b_0 \ x[n+M-N] + b_1 \ x[n+M-N-1] + b_2 \ x[n+M-N-2] + ... \\ & \quad ... + b_M \ x[n-N] - a_1 \ y[n-1] - a_2 \ y[n-2] - ... - a_N \ y[n-N] \end{align}

for a causal system or filter, we cannot look into the future for any input sample $x[n]$. that means $M \le N$ so that there is no negative delay on the $x[n+M-N]$ term. a negative delay means the LTI filter is peeking into the future, which is not causal.

but if you remove that leading delay factor and have this:

$$H(z) = \frac{b_0 + b_1 z^{-1} + b_2 z^{-2} + b_3 z^{-3} + ... + b_M z^{-M} }{ 1 + a_1 z^{-1} + a_2 z^{-2} + a_3 z^{-3} + ... + + a_N z^{-N} }$$

there is no reason that $M$ cannot be larger than $N$. but the number of poles will still be as large as $M$. if $M>N$, then some of the poles will have to be at the origin $z=0$. in fact, if $N=0$, then you have an FIR filter and all of the poles are at the origin.