Skip to content

edgeDetect

  edgeDetect

  Detects rising or falling edges of a signal whenever the signal crosses
  the threshold.


  Use timestamps = edgeDetect(signal, threshold, type)

  Variables fname and threshold are optional.

    signal:       Name of the file to be opened. If the fname is omitted
                  the user will be prompted to select a file. 

    threshold:    The value used for threshold crossings. This function
                  will detect when the signal crosses this value.
                  DEFAULT: It will automatically choose the threshold at
                  80% of the maximum value in the signal.


    type:         Contains the points in the signal where the threshold
                  crossing occurs.
                  DEFAULT: It will find the rising edges.

    Example 1: 
    timestamps = edgeDetect(signal, 1000);

    In the example above, the points where signal crosses value 1000 
    (rising edge) is detected and returned in variable timestamps.

    timestamps = edgeDetect(signal, 1000, 'falling');

    In the example above, the points where signal crosses value 1000 
    (falling edge) is detected and returned in variable timestamps.

    Kian Torab
    kian@blackrockmicro.com
    Blackrock Microsystems
    Version 1.1.0.0

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  Version History

  1.0.0.0:
    - Initial release.

  1.1.0.0:
    - Added automatic edge detection.
    - Updated help.

 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  Validations