Class ArrayLevelCrossing

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

    public class ArrayLevelCrossing
    extends TypedAtomicActor

    Search an array from the specified starting index and report the index of the first item in the array that is below or above the specified threshold. If there is no such item, then -1 is returned. The threshold can be absolute or relative to the value at the starting index. If it is relative, it can be given on a linear scale or in decibels. If the threshold is relative and we are looking for values above the threshold, then values that are above the value at the starting index by more than the threshold are reported. If the threshold is relative and we are looking for values below the threshold, then values that are below the value at the starting index by more than the threshold are reported.

    This actor is a generalization of Matlab code developed by John Signorotti of Southwest Research Institute. The original function was called UFDipSearch.

    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Edward A. Lee, Steve Neuendorffer
    Pt.AcceptedRating:
    Red (cxh)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • above

        public Parameter above
        An indicator of whether to look for values above or below the specified threshold. This is a boolean that defaults to false, which specifies to find values below the threshold.
      • array

        public TypedIOPort array
        The array to search for a threshold crossing. This has type {double}.
      • forwards

        public Parameter forwards
        The direction to search from the start. If true, search forwards. Otherwise, search backwards. This is a boolean that defaults to true.
      • output

        public TypedIOPort output
        The output port producing the index of the first bin to break the threshold. This has type int.
      • scale

        public StringParameter scale
        An indicator of whether threshold should be interpreted as absolute or relative, and if relative, then on a linear scale, in amplitude decibels, or power decibels. If decibels are used, then the corresponding linear threshold is 10^(threshold/N), where N is 20 (for amplitude decibels) or 10 (for power decibels). This parameter is a string with possible values "absolute", "relative linear", "relative amplitude decibels" or "relative power decibels". The default value is "absolute".
      • start

        public PortParameter start
        The index from which to start looking for a threshold crossing. This is an integer that defaults to 0.
      • threshold

        public PortParameter threshold
        The threshold to look for. This is a double that can be interpreted on an absolute or relative scale, and if relative, on a linear or decibel scale, depending on the scale parameter. It defaults to 0.0.