DSP Blockset
  Go to block:
    Search    Help Desk 
Shift Register    See Also

Buffer a sequence of inputs into a frame-based output with the same rate.

Library

Buffers, in General DSP

Description

The Shift Register block acquires a sequence of input samples into a frame. Each frame in the output sequence differs from the preceding output frame by only one sample, so the output frame period is the same as the input sample period.

Scalar Inputs.    Scalar inputs are buffered into a frame vector. The length of the output frame, Mo, is determined by the Register size parameter. At each sample time one new input sample is added to the output frame, so each output overlaps the previous output by Mo-1 samples, and the output frame period is the same as the input sample period (Tfo=Tsi).

Note that this block is similar to a Buffer block with Buffer size equal to Mo and Buffer overlap equal to Mo-1, except that the Shift Register block supports direct feedthrough (the current input appears in the output frame at the same simulation time step).

Vector Inputs.    Length-N vector inputs are buffered into a Mo-by-N matrix, where Mo is specified by the Register size parameter. Each of the N vector elements is treated as a distinct channel. The illustration below shows the operation for a four-channel input.

Matrix Inputs.    An M-by-N matrix input is treated as a single vector with M*N elements (channels). In other words, the matrix input u is reshaped to the vector input u(:).

Initial Conditions

The Shift Register block's buffer is initialized to the value specified by the Initial condition parameter. The block outputs this buffer, with the addition of the first input sample, at the first simulation step (t=0). If the block's output is a vector, the Initial condition can be a vector of the same size, or a scalar value to be repeated across all elements of the initial output. If the block's output is a matrix, the Initial condition can be a matrix of the same size, a vector (of length equal to the number of matrix rows) to be repeated across all columns of the initial output, or a scalar to be repeated across all elements of the initial output.

Note
If you expect to generate code for the Shift Register block using the Real-Time Workshop, you should ensure that inputs are contiguous in memory. See the Contiguous Copy block for more information.

Dialog Box

Register size
The length of the output frame (number of rows in output matrix), Mo.
Initial condition
The value of the block's initial output, a scalar, vector, or matrix.

See Also

Buffer
Triggered Shift Register
Unbuffer


[ Previous | Help Desk | Next ]