DSP Blockset    
DSP Constant

Generate a discrete-time or continuous-time constant signal.

Library

DSP Sources

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

Constant value
Specify the constant to generate. Tunable; values entered here can be tuned, but their dimensions must remain fixed.
If you specify any data type information in this field, it is overridden by the value of the Output data type parameter.
Sample mode
Specify the sample mode of the output, Discrete for a discrete-time signal or Continuous for a continuous-time signal.
Output
Specify whether the output is 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.
Sample time
Specify the discrete sample period for sample-based outputs. When 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.
Show additional parameters
If selected, additional parameters specific to implementation of the block become visible as shown.

Output data type
Specify the output data type in one of the following ways:
Word length
Specify the word length, in bits, of the fixed-point output data type. This parameter is only visible if Fixed-point is selected for the Output data type parameter.
User-defined data type
Specify any built-in or fixed-point data type. You can specify fixed-point data types using the sfix, 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.
Set fractional bits in output to
Specify the scaling of the fixed-point output by either of the following two methods:
Number of fractional bits in output
For fixed-point output data types, specify the number of fractional bits, or bits to the right of the binary point. This parameter is only visible if Fixed-point or User-defined is selected for the Output data type parameter, and if User-defined is selected for the Set fractional bits in output to parameter.

Supported Data Types

To learn how to convert 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 the following topics:


  Downsample DWT