Products & Services Solutions Academia Support User Community Company

Learn more about Signal Processing Blockset   

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:

  • Select Same as input to force the data type of the output to be the same as the data type of the input to the block.

  • Select one of the built-in data types from the list.

  • Select Fixed-point to specify the output data type and scaling in the Signed, Word length, Set fraction length in output to, and Fraction length parameters.

  • Select 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.

  • Select Inherit via back propagation to set the output data type and scaling to match the next block downstream.

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:

  • Select Best precision to have the output scaling automatically set such that the output signal has the best possible precision.

  • Select User-defined to specify the output scaling in the Fraction length parameter.

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

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

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