DSP Blockset Previous page   Next Page
Sample and Hold

Sample and hold an input signal

Library

Signal Operations

Description

The Sample and Hold block acquires the input at the signal port whenever it receives a trigger event at the trigger port (marked by ). The block then holds the output at the acquired input value until the next triggering event occurs. If the acquired input is frame based, the output is frame based; otherwise, the output is sample based.

The trigger input must be a sample-based scalar with sample rate equal to the input frame rate at the signal port. The trigger event is specified by the Trigger type pop-up menu, and can be one of the following:

The block's output prior to the first trigger event is specified by the Initial condition parameter. If the acquired input is an M-by-N matrix, the Initial condition can be an M-by-N matrix, or a scalar to be repeated across all elements of the matrix. If the input is a length-M 1-D vector, the Initial condition can be a length-M row or column vector, or a scalar to be repeated across all elements of the vector.

Dialog Box

Trigger type
The type of event that triggers the block to acquire the input signal.
Initial condition
The block's output prior to the first trigger event.

Supported Data Types

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

Downsample
DSP Blockset
N-Sample Switch
DSP Blockset


Previous page  RMS Scalar Quantizer Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS