Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Event-Count Comparator

Detect threshold crossing of accumulated nonzero inputs

Library

Signal Management / Switches and Counters

dspswit3

Description

The Event-Count Comparator block records the number of nonzero inputs to the Data port during the period that the block is enabled by a high signal (the value 1) at the Int port. Both inputs must be scalars.

When the number of accumulated nonzero inputs first equals the Event threshold setting, the block waits one additional sample interval, and then sets the output high (1). The block holds the output high until recording is restarted by a low-to-high (0-to-1) transition at the Int port.

The Event-Count Comparator block accepts real and complex floating-point and fixed-point inputs. However, because the block has discrete state, it does not support constant or continuous sample times. Therefore, at least one input or output port of the Event-Count Comparator block must be connected to a block whose Sample time parameter is discrete. The Event-Count Comparator block inherits this non-infinite discrete sample time.

Examples

In the ex_eventcountcomp_ref model, the Event-Count Comparator block (Event threshold = 3) detects two threshold crossings in the input to the Data port, one at sample 4 and one at sample 12.

All inputs and outputs are multiplexed into the workspace variable yout, whose contents are shown in the figure below. The two left columns in the illustration show the inputs to the Data and Int ports, the center column shows the state of the block's internal counter, and the right column shows the block's output.

Parameters

Event threshold

Specify the value against which to compare the number of nonzero inputs. Tunable.

Supported Data Types

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed and unsigned)

  • Boolean

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

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

  • Enumerated

See Also

CounterDSP System Toolbox
Edge DetectorDSP System Toolbox

Introduced before R2006a

Was this topic helpful?