Engee documentation

Pad

The addition or truncation of a specified dimension or dimensions.

pad

Description

The Pad block augments the sequence with identical samples of a given or truncates it to a specified length by columns, rows, columns and rows, or any other dimension you specify.

The block truncates the input signal when you specify output dimensions that are smaller than the corresponding input dimensions. If the input and output dimensions are the same, the block acts as a pass-through block.

You can enter the value of the complemented samples in the Pad value parameter of the block or through the input port. You can enter the output dimension in a block parameter or tell the block to increment the specified dimension until its length is equal to the next power of two.

The Pad signal at parameter controls whether the block augments or truncates the input signal dimension at the beginning, end, or both. For odd values of the dimensionality of the add or truncate at the end of the signal, an additional dimensionality value is used. When the block is in `Specified dimensions' mode, you can specify either the output dimension or the complement dimension.

You can configure the block to generate an error when truncation of the input signal occurs using the Action when truncation occurs parameter.

Ports

Input

Input 1 - input signal
scalar | vector | matrix| multidimensional array

Input signal as a scalar, vector, matrix or multidimensional array.

  • Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Support for complex numbers: Yes

Output

Output 1 - augmented or truncated output signal
scalar | vector | matrix| multidimensional array

Augmented or truncated output signal. The size and dimensionality of the output data depend on whether the input signal has been augmented or truncated by a given dimensionality.

The type and complexity of the output data correspond to the input data.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Bool.

Support for complex numbers: Yes

Parameters

Pad over - type of dimension by which the addition or truncation will be performed
Columns (by default) | Rows | Columns and rows | None | Specified dimensions

The type of dimension by which the addition or truncation will be performed:

  • Columns - Columns.

  • Rows - rows.

  • Columns and Rows - columns and rows.

  • None - none.

  • Specified dimensions - specified by the user as a scalar for the number of columns, a two-element vector for the number of columns and rows and an n-element vector for the number of elements of the multidimensional array.

Dimensions to pad - dimension by which the addition or truncation will be performed
1 (By default) | scalar | vector

Specify the dimension(s) on which to perform addition or truncation. The value of this parameter can be a scalar or a vector:

  • 1 - complement columns.

  • (1 2) - to complement columns and rows.

  • (1 3 5) - to complement the first, third and fifth dimensions.

Dependencies

To use this parameter, set the Pad over parameter to Specified dimensions.

Pad value source - the source of the pad value
Specify via dialogue (by default) | Input port.

Sources of value for the add-on:

  • Specify via dialog - the value is entered in the Pad value field.

  • Input port - the value is supplied to the Pval port.

Pad value - value for addition
0 (by default) | scalar.

Specify a constant scalar value to be appended to the input.

Dependencies

To use this parameter, set the Pad value source parameter to Specify via dialogue.

Output column mode - output column length setting mode
User-specified | Next power of two

Methods of output column length formation:

User-specified - specified by the user. Next power of two - defined as the nearest power of two. The block augments the output columns until their length is the next greatest power of two. If the column length is already equal to the power of two, the block will not complement the columns.

Dependencies

To use this option, set the Pad over parameter to Columns or Columns and rows.

Column size - length of the column at the output
1 | scalar

Specify the length of the output data column. If the specified column length is greater than the input column length, the block augments the columns. If the specified column length is less than the input column length, the block truncates the columns.

Dependencies

To use this parameter, set the Output column mode parameter to User-specified.

Output row mode - output row length setting mode
User-specified (by default) | `Next power of two'.

Methods of output row length formation:

User-specified - specified by the user. Next power of two - defined as the nearest power of two. The block appends the output strings until their length is the next greatest power of two. If the string length is already equal to the power of two, the block will not complement the strings.

Dependencies

To use this parameter, set the Pad over parameter to Rows or Columns and rows.

Row size is the length of the output row
1 | scalar

Specify the length of the output data string. If the specified row length is greater than the input row length, the block appends rows. If the specified string length is less than the input string length, the block truncates the strings.

Dependencies

To use this parameter, set the Output row mode parameter to User-specified.

Specify - define the length of the sequence
Output size (by default) | Pad size.

Forms the length of the output sequence by:

  • Output size - specifying it directly;

  • Pad size - specifying the lengths of the additions at the beginning and end of the sequence.

Dependencies

To use this parameter, set the Pad over parameter to Specified dimensions.

Output size mode - mode of specifying the output sequence length
User-specified | Next power of two.

Methods of output sequence length formation:

User-specified - specified by the user. Next power of two - defined as the nearest power of two. The block complements the specified dimensions until their length is the next greatest power of two. If the length of the dimension is already equal to the power of two, the block will not complement these dimensions.

Dependencies

To use this parameter, set the Pad over parameter to Specified dimensions and the Specify parameter to Output size.

Output size is the length of the output sequence
1 | scalar | vector

Specify the output length by the specified dimension(s).

This parameter must be a scalar or vector with the same number of elements as the Dimensions to pad parameter.

Each element of the Output size vector gives the output length for the corresponding dimension in the Dimensions to pad vector.

If the specified length is greater than the input length for that dimension, then the block complements that dimension. If the specified length is less than the input length for this dimension, the block augments this dimension.

Dependencies

To use this parameter, set the Pad over parameter to Specified dimensions, the Specify parameter to Output size, and the Dimensions to pad parameter to a scalar value.

Pad size at beginning - number of values to add to the beginning of the input signal
0 | scalar | vector

Specify how many values to add to the beginning of the input signal along the specified dimensions. This parameter must be a scalar or vector with the same number of elements as the Dimensions to pad parameter. Each element of the Pad size at beginning parameter gives a value to add to the beginning of the corresponding dimension in the Dimensions to pad parameter. The values of this parameter must be non-negative integers.

Dependencies

To use this parameter, set the Pad over parameter to Specified dimensions, the Specify parameter to Pad size, and the Dimensions to pad parameter to a scalar value.

Pad size at end - number of values to add to the end of the input signal
0 | scalar | vector

Specify how many values to add to the end of the input signal along the specified dimensions. This parameter must be a scalar or vector with the same number of elements as the Dimensions to pad parameter. Each element of the Pad size at beginning parameter gives a value to add to the end of the corresponding dimension in the Dimensions to pad parameter. The values of this parameter must be non-negative integers.

Dependencies

To use this parameter, set the Pad over parameter to Specified dimensions, the Specify parameter to Pad size, and the Dimensions to pad parameter to a scalar value.

Pad signal at - where to insert or truncate the signal at
End (by default) | Beginning | Beginning and end.

Variants of augmentation with sequence counts:

  • End - at the end.

  • Beginning - at the beginning.

  • Beginning and end - at the beginning and at the end. In this case, half of the complement length is added to the beginning of the signal, and the other half to its end. If the length of the addition is odd, the additional value is added to the end of the signal. When specifying signal truncation in this mode, an equal number of values are truncated from the beginning and end of the signal. If the truncation length is odd, the extra value is removed from the end of the signal.

Dependencies

To use this parameter, set the Pad over parameter to Columns,Rows or Columns and rows.

Action when truncation occurs - action when truncation occurs
None | Error

Messages when sequence truncation occurs:

  • None - no message is output.

  • Error - an error message is output.

Dependencies

To use this parameter, set the Pad over parameter to Columns,Rows or Columns and rows.