public class Lattice extends Transformer
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.
FIR
,
LevinsonDurbin
,
RecursiveLattice
,
VariableLattice
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
protected double[] |
_backward
Backward prediction errors.
|
protected double[] |
_backwardCache
Cache of backward prediction errors.
|
protected double[] |
_forward
Forward prediction errors.
|
protected double[] |
_forwardCache
Cache of forward prediction errors.
|
protected int |
_order
The order of the filter (i.e. the number of reflection coefficients)
|
protected double[] |
_reflectionCoefficients
Cache of reflection coefficients.
|
Parameter |
reflectionCoefficients
The reflection coefficients.
|
input, output
_typesValid
_actorFiringListeners, _initializables, _notifyingActorFiring, _stopRequested
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
COMPLETED, NOT_READY, STOP_ITERATING
Constructor and Description |
---|
Lattice(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_doFilter()
Compute the filter, updating the caches, based on the current
values.
|
protected void |
_reallocate()
Reallocate the internal arrays.
|
void |
attributeChanged(Attribute attribute)
If the argument is the reflectionCoefficients parameter,
then reallocate the arrays to use.
|
java.lang.Object |
clone(Workspace workspace)
Clone the actor into the specified workspace.
|
void |
fire()
Consume one input token, if there is one, and produce one output
token.
|
void |
initialize()
Initialize the state of the filter.
|
boolean |
postfire()
Update the backward and forward prediction errors that
were generated in fire() method.
|
boolean |
prefire()
Check to see if this actor is ready to fire.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, preinitialize, pruneDependencies, recordFiring, removeActorFiringListener, removeDependency, removeInitializable, setContainer, stop, stopFire, terminate, wrapup
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, propagateExistence, setName
_addPort, _description, _exportMoMLContents, _removePort, _validateSettables, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition, isWithinClassDefinition
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _executeChangeRequests, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, addHierarchyListener, attributeDeleted, attributeList, attributeList, decorators, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, notifyOfNameChange, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, validateSettables, workspace
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
createReceivers, getCausalityInterface, getDirector, getExecutiveDirector, getManager, inputPortList, newReceiver, outputPortList
isFireFunctional, isStrict, iterate, stop, stopFire, terminate
addInitializable, preinitialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public Parameter reflectionCoefficients
protected int _order
protected double[] _backward
protected double[] _backwardCache
protected double[] _forward
protected double[] _forwardCache
protected double[] _reflectionCoefficients
public Lattice(CompositeEntity container, java.lang.String name) throws NameDuplicationException, IllegalActionException
container
- The container.name
- The name of this actor.IllegalActionException
- If the actor cannot be contained
by the proposed container.NameDuplicationException
- If the container already has an
actor with this name.public void attributeChanged(Attribute attribute) throws IllegalActionException
attributeChanged
in class NamedObj
attribute
- The attribute that changed.IllegalActionException
- If the base class throws it.public java.lang.Object clone(Workspace workspace) throws java.lang.CloneNotSupportedException
clone
in class TypedAtomicActor
workspace
- The workspace for the new object.java.lang.CloneNotSupportedException
- If a derived class contains
an attribute that cannot be cloned.NamedObj.exportMoML(Writer, int, String)
,
NamedObj.setDeferringChangeRequests(boolean)
public void fire() throws IllegalActionException
fire
in interface Executable
fire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If there is no director.public void initialize() throws IllegalActionException
initialize
in interface Initializable
initialize
in class AtomicActor<TypedIOPort>
IllegalActionException
- If a derived class throws it.public boolean postfire() throws IllegalActionException
postfire
in interface Executable
postfire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If there is no director.public boolean prefire() throws IllegalActionException
prefire
in interface Executable
prefire
in class AtomicActor<TypedIOPort>
IllegalActionException
- If there is no director.protected void _doFilter() throws IllegalActionException
IllegalActionException
- Not thrown in this base class.protected void _reallocate()