Documentation Center

  • Trial Software
  • Product Updates

N-Sample Enable

Output ones or zeros for specified number of sample times

Library

  • Sources

    dspsrcs4

  • Signal Management / Switches and Counters

    dspswit3

Description

The N-Sample Enable block outputs the inactive value (0 or 1, whichever is not selected in the Active level parameter) during the first N sample times, where N is the Trigger count value. Beginning with output sample N+1, the block outputs the active value (1 or 0, whichever you select in the Active level parameter) until a reset event occurs or the simulation terminates.

The output of the block is always a scalar.

The Reset input check box enables the Rst input port. At any time during the count, a trigger event at the input port resets the counter to its initial state. This block supports triggered subsystems when you select the Reset input check box.

You specify the triggering event in the Trigger type pop-up menu:

  • Rising edge — Triggers a reset operation when the Rst input does one of the following:

    • Rises from a negative value to a positive value or zero

    • Rises from zero to a positive value, where the rise is not a continuation of a rise from a negative value to zero (see the following figure)

  • Falling edge — Triggers a reset operation when the Rst input does one of the following:

    • Falls from a positive value to a negative value or zero

    • Falls from zero to a negative value, where the fall is not a continuation of a fall from a positive value to zero (see the following figure)

  • Either edge — Triggers a reset operation when the Rst input is a Rising edge or Falling edge (as described above).

  • Non-zero sample — Triggers a reset operation at each sample time that the Rst input is not zero.

Dialog Box

Trigger count

Specify the number of samples for which the block outputs the active value. Tunable.

Active level

Specify the value to output after the first N sample times, 0 or 1. Tunable.

Reset input

Select to enable the Rst input port.

Trigger type

Select type of event that triggers a reset when the Rst port is enabled.

Sample time

Specify the sample period, Ts, for the block's counter. The block switches from the active value to the inactive value at t=Ts*(N+1).

Output data type

Select the output data type.

Supported Data Types

  • Double-precision floating point

  • Boolean — The block accepts Boolean inputs to the Rst port, which is enabled when you select the Reset input parameter.

See Also

CounterDSP System Toolbox
N-Sample SwitchDSP System Toolbox

Was this topic helpful?