| DSP Blockset | ![]() |
Output ones or zeros for a specified number of sample times
Library
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 is selected in the Active level parameter) until a reset event occurs or the simulation terminates.
The output is always sample based.
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. The rate of the reset signal must be a positive integer multiple of the rate of the data signal input. This block supports triggered subsystems when the Reset input check box is selected.
The triggering event is specified by the Trigger type pop-up menu, and can be one of the following:
Rising edge -- Triggers a reset operation when the Rst input does one of the following:
Falling edge -- Triggers a reset operation when the Rst input does one of the following:
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.
Note
When running simulations in the Simulink MultiTasking mode, sample-based reset signals have a one-sample latency, and frame-based reset signals have one frame of latency. Thus, there is a one-sample or one-frame delay between the time the block detects a reset event, and when it applies the reset. For more information on latency and the Simulink tasking modes, see Excess Algorithmic Delay (Tasking Latency) and the topic on The Simulation Parameters Dialog Box in the Simulink documentation.
|
Dialog Box
Opening this dialog box causes a running simulation to pause. See Changing Source Block Parameters in the online Simulink documentation for details.
0 or 1. Tunable.
Rst input port. The rate of the reset signal must be a positive integer multiple of the rate of the data signal input.
Rst port is enabled. Nontunable.
=Ts*(N+1).
Logical and Boolean options of this parameter, see Effects of Enabling and Disabling Boolean Support.
Supported Data Types
Rst port, which is enabled when you set the Reset input parameter. The block may output Boolean values depending on the Output data type parameter setting, as described in Effects of Enabling and Disabling Boolean Support. To learn how to disable Boolean output support, see Steps to Disabling Boolean Support.
To learn how to convert your data types to the above data types in MATLAB and Simulink, see Supported Data Types and How to Convert to Them.
See Also
| Counter |
DSP Blockset |
| N-Sample Switch |
DSP Blockset |
Also see Creating Signals Using Signal Generator Blocks for how to use this and other blocks to generate signals.
| Multiport Selector | N-Sample Switch | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |