Truncate vectors by removing or keeping beginning or ending values
Signal Operations
dspsigops
The Offset block removes or keeps values from the beginning or end of the input vectors. You specify the length of the output vectors using the Output port length parameter. The inputs to the In ports (In1, In2, ...) can be scalars or vectors, but they must be the same size and data type. The offset values are the inputs to the O ports (O1, O2, ...); they must be scalar values with the same data type. These offset values should be integer values because they determine the number of values the block discards or retains from each input vector. The block rounds any offset value that is a noninteger value to the nearest integer value. There is one output port for each pair of In and O ports.
Use the Mode parameter to determine which values the block
discards or retains from the input vector. To discard the initial values of the vector,
select Remove beginning samples
. To discard the final values
of the vector, select Remove ending samples
. To retain the
initial values of the vector, select Keep beginning samples
.
To retain the final values of a vector, select Keep ending
samples.
Use the Number of input dataoffset pairs parameter to specify
the number of inputs to the block. The number of input ports is twice the scalar value
you enter. For example, if you enter 3
, ports In1, O1, In2, O2, In3,
and O3 appear on the block.
The block uses the Output port length parameter to determine the
length of the output vectors. If you select Same as input
,
the block outputs vectors that are the same length as the input to the In ports. If you
select Userdefined
, the Output length
parameter appears. Enter a scalar that represents the desired length of the output
vectors. If your desired output length is greater than the number of values you
extracted from your input vector, the block zeropads the end of the vector to reach the
length you specified.
Use the Action for out of range offset value parameter to
determine how the block behaves when an offset value is not in the range 0 ≤ offset value ≤ N, where N is the input vector length. Select
Clip
if you want any offset values less than 0 to be set
to 0 and any offset values greater than N to be set to
N. Select Clip and warn
if you want to
be warned when any offset values less than 0 are set to 0 and any offset values greater
than N are set to N. Select
Error
if you want the simulation to stop and display an
error when the offset values are out of range.
Use this parameter to determine which values the block discards or retains
from the input vector. Your choices are Remove beginning
samples
, Remove ending samples
,
Keep beginning samples
, and Keep
ending samples
.
Specify the number of inputs to the block. The number of input ports is twice the scalar value you enter.
Use this parameter to specify the length of the output vectors. If you
select Same as input
, the output vectors are the
same length as the input vectors. If you select
Userdefined
, you can enter the desired
length of the output vectors.
Enter a scalar that represents the desired length of the output vectors.
This parameter is visible if, for the Output port
length parameter, you select
Userdefined
.
Use this parameter to determine how the block behaves when an offset value
is not in the range such that 0 ≤ offset value ≤ N, where N is the input vector length.
When you want any offset values less than 0 to be set to 0 and any offset
values greater than N to be set to N,
select Clip
. When you want to be warned when any
offset values less than 0 are set to 0 and any offset values greater than
N are set to N, select
Clip and warn
. When you want the simulation
to stop and display an error when the offset values are out of range, select
Error
.
Port  Supported Data Types 

In 

O 

Out 
