Constant Ramp - Generate ramp signal with length based on input dimensions

Library

Signal Operations

dspsigops

Description

The Constant Ramp block generates the constant ramp signal

y = (0:L-1)*m + b

where m is the slope specified by the scalar Slope parameter, and b is the y-intercept specified by the scalar Offset parameter.

For a 1-D vector input, L is equal to the length of the input vector. For an N-D array input, the length L of the output ramp is equal to the length of the input in the dimension specified by the Ramp length equals number of or Dimension parameter. The output, y, is always a 1-D vector.

Dialog Box

The Main pane of the Constant Ramp block dialog appears as follows.

Ramp length equals number of

Specify whether the length of the output ramp is the number of rows, number of columns, or the length of the specified dimension of the input.

Dimension

Specify the one-based dimension of the input array that determines the length of the output ramp.

This parameter is only visible when you select Elements in specified dimension for the Ramp length equals number of parameter.

Slope

Specify the scalar slope of the ramp.

Offset

Specify the scalar y-intercept of the ramp.

The Data types pane of the Constant Ramp block dialog appears as follows.

Output data type

Specify the output data type in one of the following ways:

This block differs from other Signal Processing Blockset blocks in that unless you choose Same as input for this parameter, the data types of the input and the output do not need to be the same.

Signed

Select to output a signed fixed-point signal. Otherwise, the signal is unsigned. This parameter is only visible when you select Fixed-point for the Output data type parameter.

Word length

Specify the word length, in bits, of the fixed-point output data type. This parameter is only visible when you select Fixed-point 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 following Simulink Fixed Point functions: sfix, ufix, sint, uint, sfrac, and ufrac. This parameter is only visible when you select User-defined for the Output data type parameter.

Set fraction length in output to

Specify the scaling of the fixed-point output by either of the following two methods:

This parameter is only visible when you select Fixed-point for the Output data type parameter, or when you select User-defined and the specified output data type is a fixed-point data type.

Fraction length

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 when you select Fixed-point or User-defined for the Output data type parameter and User-defined for the Set fraction length in output to parameter.

Supported Data Types

This block differs from other Signal Processing Blockset blocks in that unless you choose Same as input for the Output data type parameter, the data types of the input and the output do not need to be the same.

See Also

Create Diagonal MatrixSignal Processing Blockset
ConstantSimulink
Identity MatrixSignal Processing Blockset

  


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