Documentation

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 (0or1, whichever is not selected in theActive levelparameter) during the firstNsample times, whereNis theTrigger countvalue. Beginning with output sampleN+1, the block outputs the active value (1or0, whichever you select in theActive levelparameter) until a reset event occurs or the simulation terminates.

The output of the block is always a scalar.

TheReset inputcheck 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 theReset inputcheck box.

You specify the triggeringevent in theTrigger typepop-up menu:

  • Rising edge— Triggers a reset operation when theRstinput 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 theRstinput 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 theRstinput is aRising edgeorFalling edge(as described above).

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

Parameters

Trigger count

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

Active level

Specify the value to output after the firstNsample times,0or1.Tunable(Simulink).

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 att=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 theReset inputparameter.

See Also

Counter DSP System Toolbox
N-Sample Switch DSP System Toolbox

Introduced before R2006a

Was this topic helpful?