Computing the ACF of an ARMA process

If the roots of the denominator polynomial are inside the unit circle, the ACF of the ARMA process, $r_t$, will go to zero for $t>L$ for some $L$. Let $A_k$ and $B_k$ be the DFT of $a_i$ and $b_i$ padded to length $2L$. Then the circular power spectrum of size $2L$ is

$\displaystyle \rho_k = \sigma^2 \; \frac{\vert B_k\vert^2}{\vert A_k\vert^2}, \;\;\;\; 0\leq k \leq 2L.$ (10.14)

Then,

$\displaystyle r_t = \frac{1}{N} \sum_{k=0}^{2L} \; \rho_k \; e^{j2\pi k t / (2L)}.$ (10.15)

The first $L$ values of $r_t$ will be accurate approximations to the true ACF. In MATLAB:
    A=fft([a(:); zeros(2*L-P-1,1)]);
    B=fft([b(:); zeros(2*L-Q-1,1)]);
    A2=msq(A);
    B2=msq(B);
    h = B2./A2;
    rho = sig2 * h;
    r = real(ifft(rho));
One only needs to increase $L$ until the condition is met that the ACF dies to zero before $L$. See figure 10.2.
Figure: Computing ACF with the DFT. Upper panel, $N$ too small. Lower panel $N$ large enough.
\includegraphics[width=4.5in,height=3.0in, clip]{acf_arma.eps}