| DSP Blockset | ![]() |
Generate a discrete-time or continuous-time constant signal
Library
Description
The DSP Constant block generates a signal whose value remains constant throughout the simulation. The Constant value parameter specifies the constant to output, and can be any valid MATLAB expression that evaluates to a scalar, vector, or matrix.
When Sample mode is set to Continuous, the output is a continuous-time signal. When Sample mode is set to Discrete, the Sample time parameter is visible, and the signal has the discrete output period specified by the Sample time parameter.
You can set the output signal to Frame-based, Sample-based, or Sample-based (interpret vectors as 1-D) with the Output parameter.
Dialog Box
Opening this dialog box causes a running simulation to pause. See Changing Source Block Parameters in the online Simulink documentation for details.
Discrete for a discrete-time signal or Continuous for a continuous-time signal.
Sample-based (interpret vectors as 1-D), Sample-based, or Frame-based. When Sample-based is selected and the output is a vector, its dimension is constrained to match the Constant value dimension (row or column). If Sample-based (interpret vectors as 1-D) is selected, however, the output has no specified dimensionality.
Frame-based is selected for the Output parameter, this parameter is named Frame period, and is the discrete frame period for the frame-based output. This parameter is only visible when Discrete is selected for the Sample mode parameter.
Fixed-point, fixed-point data types for this block may be set by DSP Fixed-Point Attributes blocks in your model. If this parameter is unselected, the data types are always set by the parameters in the block mask.
Fixed-point to specify the output data type and scaling in the Word length, Set fraction length in output to, and Fraction length parameters.
User-defined to specify the output data type and scaling in the User-defined data type, Set fraction length in output to, and Fraction length parameters.
Inherit from `Constant value' to set the output data type and scaling to match the values of the Constant value parameter.
Inherit via back propagation to set the output data type and scaling to match the following block.
Fixed-point is selected for the Output data type parameter.
ufix, sint, uint, sfrac, and ufrac functions from the Fixed-Point Blockset. This parameter is only visible if User-defined is selected for the Output data type parameter.
Best precision to have the output scaling automatically set such that the output signal has the best possible precision.
User-defined to specify the output scaling in the Fraction length parameter.
Fixed-point or User-defined is selected for the Output data type parameter, and if the specified output data type is a fixed-point data type.
Fixed-point or User-defined is selected for the Output data type parameter, and if User-defined is selected for the Set fraction length in output to parameter.
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
| Constant |
Simulink |
| Signal From Workspace |
DSP Blockset |
Also see Creating Signals Using Constant Blocks for how to use this and other blocks to generate constant signals.
| Downsample | DSP Fixed-Point Attributes | ![]() |
Learn more about the latest releases of MathWorks products: |
| © 1994-2009 The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |