Documentation Center

  • Trial Software
  • Product Updates

Edge Detector

Detect transition from zero to nonzero value

Library

Signal Management / Switches and Counters

dspswit3

Description

The Edge Detector block generates an impulse (the value 1) in a given output channel when the corresponding channel of the input transitions from zero to a nonzero value. When the input does not transition from zero to a nonzero value, the block generates a zero in the corresponding output channel.

The output has the same dimension and sample rate as the input. When you set the Input processing parameter to Columns as channels (frame based), the block counts an edge that is split across two consecutive frames in the frame that contains the nonzero value. For example, if there is a zero at the bottom of the first frame and a nonzero value at the top of the second frame, the block counts the edge in the second frame.

Examples

In the ex_edgedetector_refex_edgedetector_ref model, the Input processing parameter of the Edge Detector block is set to Columns as channels (frame based). Thus, the block interprets the 3-by-2 input as a multichannel signal with a frame size of 3. The Matrix Concatenate block concatenates the two input channels of the original signal with the two output channels of the Edge Detector block to create the four-channel workspace variable sp_examples_yout.

As shown in the following figure, the block finds edges at sample 7 in channel 1, and at samples 2, 5, and 9 in channel 2.

Dialog Box

Input processing

Specify how the block should process the input. You can set this parameter to one of the following options:

  • Columns as channels (frame based) — When you select this option, the block treats each column of the input as a separate channel.

  • Elements as channels (sample based) — When you select this option, the block treats each element of the input as a separate channel.

    Note:   The Inherited (this choice will be removed - see release notes) option will be removed in a future release. See Frame-Based Processing in the DSP System Toolbox™ Release Notes for more information.

Supported Data Types

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed and unsigned)

  • Boolean — The block might output Boolean values depending on the input data type, and whether Boolean support is enabled or disabled.

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

  • Enumerated

See Also

CounterDSP System Toolbox
Event-Count ComparatorDSP System Toolbox

Was this topic helpful?