Class Lattice

  • All Implemented Interfaces:
    java.lang.Cloneable, Actor, Executable, FiringsRecordable, Initializable, TypedActor, Changeable, Debuggable, DebugListener, Derivable, Instantiable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
    Direct Known Subclasses:
    GradientAdaptiveLattice, VariableLattice

    public class Lattice
    extends Transformer
    An FIR filter with a lattice structure. The coefficients of such a filter are called "reflection coefficients." Lattice filters are typically used as linear predictors because it is easy to ensure that they are minimum phase, and hence that their inverse is stable. A lattice filter is (strictly) minimum phase if its reflection coefficients are all less than unity in magnitude. To get the reflection coefficients for a linear predictor for a particular random process, you can use the LevinsonDurbin actor. The inputs and outputs are of type double.

    The default reflection coefficients correspond to the optimal linear predictor for an AR process generated by filtering white noise with the following filter:

                                1
     H(z) =  --------------------------------------
             1 - 2z-1 + 1.91z-2 - 0.91z-3 + 0.205z-4
     

    Since this filter is minimum phase, the transfer function of the lattice filter is H -1(z).

    Note that the definition of reflection coefficients is not quite universal in the literature. The reflection coefficients in reference [2] are the negative of the ones used by this actor, which correspond to the definition in most other texts, and to the definition of partial-correlation (PARCOR) coefficients in the statistics literature.

    The signs of the coefficients used in this actor are appropriate for values given by the LevinsonDurbin actor. The structure of the filter is as follows:

          y[0]              y[1]               y[n-1]           y[n]
     X(n) -------o-->-(+)-->----o-->-(+)-->-- ... ->---o-->-(+)------>  Y(n)
          |       \   /          \   /                  \   /
          |      +K1 /          +K2 /                  +Kn /
          |         X              X                      X
          V      -K1 \          -K2 \                  -Kn \
          |       /   \          /   \                  /   \
          \-[z]--o-->-(+)-[z]---o-->-(+)-[z]- ... ->---o-->-(+)
               w[0]         w[1]               w[n-1]           w[n]
     

    References

    [1] J. Makhoul, "Linear Prediction: A Tutorial Review", Proc. IEEE, Vol. 63, pp. 561-580, Apr. 1975.

    [2] S. M. Kay, Modern Spectral Estimation: Theory & Application, Prentice-Hall, Englewood Cliffs, NJ, 1988.

    Since:
    Ptolemy II 1.0
    Version:
    $Id$
    Author:
    Edward A. Lee, Christopher Hylands, Steve Neuendorffer
    See Also:
    FIR, LevinsonDurbin, RecursiveLattice, VariableLattice
    Pt.AcceptedRating:
    Yellow (cxh)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • reflectionCoefficients

        public Parameter reflectionCoefficients
        The reflection coefficients. This is an array of doubles with default value {0.804534, -0.820577, 0.521934, -0.205}. These are the reflection coefficients for the linear predictor of a particular random process.
      • _order

        protected int _order
        The order of the filter (i.e. the number of reflection coefficients)
      • _backward

        protected double[] _backward
        Backward prediction errors. The length is _order.
      • _backwardCache

        protected double[] _backwardCache
        Cache of backward prediction errors. The fire() method updates _forwardCache and postfire() copies _forwardCache to _forward so this actor will work in domains like SR. The length is _order.
      • _forward

        protected double[] _forward
        Forward prediction errors. The length is _order + 1.
      • _forwardCache

        protected double[] _forwardCache
        Cache of forward prediction errors. The fire() method updates _forwardCache and postfire() copies _forwardCache to _forward so this actor will work in domains like SR. The length is _order + 1.
      • _reflectionCoefficients

        protected double[] _reflectionCoefficients
        Cache of reflection coefficients. The length is _order.