public class ArrayPeakSearch extends TypedAtomicActor
This actor outputs the indices and values of peaks in an input array.
The dip and squelch parameters control the sensitivity to noise. These are given either as absolute numbers or as relative numbers. If they are absolute numbers, then a peak is detected if a rise above dip is detected before the peak and a dip below dip is detected after the peak. If they are given as relative numbers, then a peak is detected when a rise by a factor dip above the most recently seen minimum (if there has been one) is seen before the peak, and if a dip by a factor dip relative to the peak is seen after the peak. Relative numbers can be either linear (a fraction) or in decibels. This is determined by the value of the scale parameter. For example, if dip is given as 2.0 and scale has value "relative linear", then a dip must drop to half of a local peak value to be considered a dip.
If squelch is given as 10.0 and scale has value "relative linear", then any peaks that lie below 1/10 of the global peak are ignored. Note that dip is relative to the most recently seen peak or valley, and squelch is relative to the global peak in the array, when relative values are used. If scale has value "relative amplitude decibels", then a value of 6.0 is equivalent to the linear value 2.0. If scale has value "relative power decibels", then a value of 3.0 is equivalent to the linear value 2.0. In either decibel scale, 0.0 is equivalent to 0.0 linear. Other parameters control how the search is conducted.
This actor is based on Matlab code developed by John Signorotti of Southwest Research Institute.
Red (cxh) |
Yellow (eal) |
Entity.ContainedObjectsIterator
Modifier and Type | Field and Description |
---|---|
Parameter |
dip
The amount that the signal must drop below a local maximum before a
peak is detected.
|
PortParameter |
endIndex
The end point of the search.
|
TypedIOPort |
input
The input port.
|
Parameter |
maximumNumberOfPeaks
The maximum number of peaks to report.
|
TypedIOPort |
peakIndices
The output port for the indices of the peaks.
|
TypedIOPort |
peakValues
The output port for the values of the peaks.
|
StringParameter |
scale
An indicator of whether dip and squelch should
be interpreted as absolute or relative, and if relative, then
on a linear scale, in amplitude decibels, or power decibels.
|
Parameter |
squelch
The value below which the input is ignored by the
algorithm.
|
PortParameter |
startIndex
The starting point of the search.
|
_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 |
---|
ArrayPeakSearch(CompositeEntity container,
java.lang.String name)
Construct an actor with the given container and name.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone(Workspace workspace)
Override the base class to set type constraints.
|
void |
fire()
Consume at most one array from the input port and produce
two arrays containing the indices and values of the identified
peaks.
|
_containedTypeConstraints, _customTypeConstraints, _defaultTypeConstraints, _fireAt, _fireAt, attributeTypeChanged, clone, isBackwardTypeInferenceEnabled, newPort, typeConstraintList, typeConstraints
_actorFiring, _actorFiring, _declareDelayDependency, addActorFiringListener, addInitializable, connectionsChanged, createReceivers, declareDelayDependency, getCausalityInterface, getDirector, getExecutiveDirector, getManager, initialize, inputPortList, isFireFunctional, isStrict, iterate, newReceiver, outputPortList, postfire, prefire, 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, attributeChanged, 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, postfire, prefire, stop, stopFire, terminate
addInitializable, initialize, preinitialize, removeInitializable, wrapup
description, getContainer, getDisplayName, getFullName, getName, getName, setName
getDerivedLevel, getDerivedList, propagateValue
public Parameter dip
public PortParameter endIndex
public TypedIOPort input
public Parameter maximumNumberOfPeaks
public TypedIOPort peakIndices
public TypedIOPort peakValues
public StringParameter scale
public Parameter squelch
public PortParameter startIndex
public ArrayPeakSearch(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 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, or
if sorting is not supported for the input array.