| DSP Blockset | Search  Help Desk |
| Buffer | See Also |
Buffer a sequence of scalar inputs into a frame.
Library
Buffers, in General DSPDescription
The Buffer block acquires a sequence of input samples into a frame, which is an efficient format for many DSP applications. The frame-based output generally has a slower rate than the input.
To rebuffer frame-based inputs to a larger or smaller frame size, use the Rebuffer block.
The block coordinates the output frame size and frame rate so that the sequence sample period (i.e., the sample-to-sample interval) is the same at both the input and output, Tso=Tsi. Scalar Inputs. Scalar inputs are buffered into a frame vector (top illustration). The length of the output frame, Mo, is determined by the Buffer size parameter. The Buffer overlap parameter specifies the number of samples, L, from the previous buffer to include in the current buffer. The number of new input samples the block acquires before propagating the buffered data to the output is the difference between the Buffer size and Buffer overlap, Mo-L.
The output frame period is (Mo-L)*Tsi, which is equal to the sequence sample period, Tsi, when the Buffer overlap is Mo-1. For negative Buffer overlap values, the block simply discards L input samples after the buffer fills, and outputs the buffer with period (Mo-L)*Tsi, which is slower than the zero-overlap case.
Note
Note that the input sample vectors do not begin appearing at the output until the second row of the second matrix. The first output matrix (all zeros in this example) reflects the block's initial buffer, while the first row of zeros in the second output is a result of the one-sample overlap between consecutive output frames.
Matrix inputs. An M-by-N matrix input is treated as a single vector with M*N elements. In other words, the matrix inputu is reshaped to the vector input u(:).

Initial Conditions
The Buffer block's buffer is initialized to the value specified by the Initial condition parameter, and the block always outputs this buffer 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. NoteDialog Box

See Also
Distributor