DSP Blockset    
N-Sample Switch

Switch between two inputs after a specified number of sample periods.

Library

Signal Management / Switches and Counters

Description

The N-Sample Switch block outputs the signal connected to the top input port during the first N sample times after the simulation begins or the block is reset, where N is specified by the Switch count value. Beginning with output sample N+1, the block outputs the signal connected to the bottom input until the next reset event or the end of the simulation.

The sample period of the output is specified by the Sample time parameter (i.e., the output sample period is not inherited from the sample period of either input). The block applies a zero-order hold at the input ports, so the value the block reads from a given port between input sample times is the value of the most recent input to that port.

Both inputs must have the same dimension, except in the following two cases:

The inputs must either both be frame-based or both be sample-based.

The Reset input check box enables the Rst input port. At any time during the count, a trigger event at the Rst port resets the counter to zero. The triggering event is specified by the Trigger type pop-up menu, and can be one of the following:

Dialog Box

Switch count
The number of sample periods, N, for which the output is connected to the top input before switching to the bottom input.
Reset input
Enables the Rst input port when selected.
Trigger type
The type of event at the Rst port that resets the block's counter. This parameter is enabled when Reset input is selected. Tunable.
Sample time
The sample period, Ts, for the block's counter. The block switches inputs at t=Ts*(N+1).

See Also

Counter
DSP Blockset
N-Sample Enable
DSP Blockset


 N-Sample Enable Normalization