C
C 
      SUBROUTINE YULEWALKER ( N, IP, L, X, P, A, ISTAT, R )
C
C  This subroutine determines the autoregressive coefficients by the
C  Yule-Walker algorithm.
C
C  Input Parameters:
C
C     N     - Number of data samples (integer)
C     IP    - Order of autoregressive process to be fitted (integer)
C     L     - Set this integer to 0 for unbiased lags, or 1 for biased
C     X     - Array of complex data values, X(1) to X(N)
C     R     - Working vector (length = N) for autocorrelation lags
C
C  Output Parameters:
C
C     P     - Driving noise variance (real)
C     A     - Array of complex autoregressive coefficients, A(1) to A(IP)
C     ISTAT - Status indicator.  Returns set to 0 for normal exit, else
C             1 if LEVINSON becomes ill-conditioned.
C
C  Notes:
C
C     External array X should be dimensioned .GE. N and array A .GE. IP
C     in the calling program.  Internal array R should be dimensioned
C     .GE. IP .  External subroutines used:  CORRELATION (Appendix 5.A)
C     and LEVINSON (Appendix 3.C) .
C
      COMPLEX  X(1), A(1), R0, R(1)
C
C    --------------------------------------------
      CALL CORRELATION ( N, IP, L, X, X, R0, R )
C    --------------------------------------------
C
      RZERO = REAL( R0 )
C
C    ---------------------------------------------
      CALL LEVINSON ( IP, RZERO, R, P, A, ISTAT ) 
C    ---------------------------------------------
C
      RETURN
      END
