ptolemy.domains.sdf.lib.vq
Class VQDecode

java.lang.Object
  extended byptolemy.kernel.util.NamedObj
      extended byptolemy.kernel.InstantiableNamedObj
          extended byptolemy.kernel.Entity
              extended byptolemy.kernel.ComponentEntity
                  extended byptolemy.actor.AtomicActor
                      extended byptolemy.actor.TypedAtomicActor
                          extended byptolemy.actor.lib.Transformer
                              extended byptolemy.domains.sdf.lib.vq.VQDecode
All Implemented Interfaces:
ptolemy.actor.Actor, ptolemy.kernel.util.Changeable, java.lang.Cloneable, ptolemy.kernel.util.Debuggable, ptolemy.kernel.util.DebugListener, ptolemy.kernel.util.Derivable, ptolemy.actor.Executable, ptolemy.kernel.util.Instantiable, ptolemy.kernel.util.ModelErrorHandler, ptolemy.kernel.util.MoMLExportable, ptolemy.kernel.util.Nameable, java.io.Serializable, ptolemy.actor.TypedActor

public class VQDecode
extends Transformer

This actor decompresses a vector quantized signal. This operation is simply a table lookup into the codebook.

Since:
Ptolemy II 0.2
Version:
$Id: VQDecode.java,v 1.59 2004/04/13 05:13:02 cxh Exp $
Author:
Steve Neuendorffer
See Also:
HTVQEncode, Serialized Form
Accepted Rating:
Red
Proposed Rating:
Yellow (neuendor)

Nested Class Summary
 
Nested classes inherited from class ptolemy.kernel.Entity
ptolemy.kernel.Entity.ContainedObjectsIterator
 
Field Summary
 ptolemy.data.expr.Parameter blockCount
          The number of blocks to be decoded during each firing.
 ptolemy.data.expr.Parameter blockHeight
          The width, in integer pixels, of the block to decode.
 ptolemy.data.expr.Parameter blockWidth
          The width, in integer pixels, of the block to decode.
 ptolemy.data.expr.Parameter codeBook
          A Parameter of type String, giving the location of the codebook data file relative to the root classpath.
 ptolemy.data.expr.Parameter input_tokenConsumptionRate
          The input rate
 ptolemy.data.expr.Parameter output_tokenProductionRate
          The output rate
 
Fields inherited from class ptolemy.actor.lib.Transformer
input, output
 
Fields inherited from class ptolemy.actor.AtomicActor
_stopRequested
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Fields inherited from interface ptolemy.actor.Executable
COMPLETED, NOT_READY, STOP_ITERATING
 
Constructor Summary
VQDecode(ptolemy.kernel.CompositeEntity container, java.lang.String name)
          Construct an actor in the specified container with the specified name.
 
Method Summary
 void fire()
          Fire this actor.
 void initialize()
          Initialize this actor.
 
Methods inherited from class ptolemy.actor.TypedAtomicActor
_addPort, attributeTypeChanged, clone, newPort, typeConstraintList
 
Methods inherited from class ptolemy.actor.AtomicActor
_createReceivers, clone, connectionsChanged, getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, iterate, newReceiver, outputPortList, postfire, prefire, preinitialize, pruneDependencies, removeDependency, setContainer, stop, stopFire, terminate, wrapup
 
Methods inherited from class ptolemy.kernel.ComponentEntity
_adjustDeferrals, _checkContainer, _getContainedObject, _propagateExistence, getContainer, instantiate, isAtomic, isOpaque, propagateExistence, setName
 
Methods inherited from class ptolemy.kernel.Entity
_description, _exportMoMLContents, _removePort, connectedPortList, connectedPorts, containedObjectsIterator, getAttribute, getPort, getPorts, linkedRelationList, linkedRelations, portList, removeAllPorts, setClassDefinition, uniqueName, validateSettables
 
Methods inherited from class ptolemy.kernel.InstantiableNamedObj
_setParent, exportMoML, getChildren, getElementName, getParent, getPrototypeList, isClassDefinition
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, getAttribute, getAttributes, getChangeListeners, getClassName, getDerivedLevel, getDerivedList, getFullName, getModelErrorHandler, getName, getName, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, message, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setModelErrorHandler, setPersistent, setSource, toplevel, toString, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ptolemy.actor.Actor
getDirector, getExecutiveDirector, getFunctionDependency, getManager, inputPortList, newReceiver, outputPortList
 
Methods inherited from interface ptolemy.actor.Executable
iterate, postfire, prefire, preinitialize, stop, stopFire, terminate, wrapup
 
Methods inherited from interface ptolemy.kernel.util.Derivable
getDerivedLevel, getDerivedList, propagateValue
 
Methods inherited from interface ptolemy.kernel.util.Nameable
description, getFullName, getName, getName
 

Field Detail

codeBook

public ptolemy.data.expr.Parameter codeBook
A Parameter of type String, giving the location of the codebook data file relative to the root classpath.


blockCount

public ptolemy.data.expr.Parameter blockCount
The number of blocks to be decoded during each firing. The default value is one, which will always work, but using a higher number (such as the number of blocks in a frame) will speed things up. This should contain an integer.


blockWidth

public ptolemy.data.expr.Parameter blockWidth
The width, in integer pixels, of the block to decode.


blockHeight

public ptolemy.data.expr.Parameter blockHeight
The width, in integer pixels, of the block to decode.


input_tokenConsumptionRate

public ptolemy.data.expr.Parameter input_tokenConsumptionRate
The input rate


output_tokenProductionRate

public ptolemy.data.expr.Parameter output_tokenProductionRate
The output rate

Constructor Detail

VQDecode

public VQDecode(ptolemy.kernel.CompositeEntity container,
                java.lang.String name)
         throws ptolemy.kernel.util.IllegalActionException,
                ptolemy.kernel.util.NameDuplicationException
Construct an actor in the specified container with the specified name.

Parameters:
container - The container.
name - The name of this adder within the container.
Throws:
ptolemy.kernel.util.IllegalActionException - If the actor cannot be contained by the proposed container.
ptolemy.kernel.util.NameDuplicationException - If the name coincides with an actor already in the container.
Method Detail

fire

public void fire()
          throws ptolemy.kernel.util.IllegalActionException
Fire this actor. Consume a number of tokens on the input port, each representing a VQ codeword. Index into the appropriate codebook given by the blockWidth and blockHeight parameters to find the decoded vector for each codeword. Output an IntMatrixToken representing each decoded vector on the output port.

Throws:
ptolemy.kernel.util.IllegalActionException - If the input or output are not connected
ArrayOutOfBoundsException - If the input codewords are not between 0 and 255.

initialize

public void initialize()
                throws ptolemy.kernel.util.IllegalActionException
Initialize this actor. Load the codebooks and lookup tables from the file given by the parameter "codeBook".

Throws:
ptolemy.kernel.util.IllegalActionException - If the parameters do not have legal values, or the codebook file cannot be read.