dsp.Buffer System object

Package: dsp

Buffer input signal


The Buffer object buffers an input signal. The number of samples per channel in the input must equal the difference between the output buffer size and buffer overlap (i.e., Length - OverlapLength). When you set FrameBasedProcessing to true, the number of samples per channel equals the number of rows in the input. If you set FrameBasedProcessing to false, the number of samples per channel equals 1.

To buffer an input signal:

  1. Define and set up your buffer System object™. See Construction.

  2. Call step to buffer the input according to the properties of dsp.Buffer. The behavior of step is specific to each object in the toolbox.


H=dsp.Buffer returns a buffer System object, HBUFF, used to buffer input signals with overlap.

H=dsp.Buffer('PropertyName',PropertyValue,...) returns a buffer object, H, with each specified property set to the specified value.

returns a buffer object, H, with Length property set to LEN, OverlapLength property set to OVRLAP, InitialConditions property set to ICS and other specified properties set to the specified values.



Number of samples to buffer

Specify the number of consecutive samples from each input channel to buffer. You can set this property to any scalar integer greater than 0 of MATLAB® built-in numeric data type. The default is 64.


Amount of overlap between outputs

Specify the number of samples by which consecutive output frames overlap. You can set this property to any scalar integer greater than or equal to 0 of MATLAB built-in numeric data type. The default is 0.


Initial output

Specify the value of the object's initial output for cases of nonzero latency as a scalar, vector, or matrix. The default is 0.


Enable frame-based processing

If this property is set to true, each column of the input is treated as a separate channel for buffering. If the value of this property is false, each element of the input is treated as a separate channel. The default is true.


cloneCreate instance of an object with the same property values
getNumInputsNumber of expected inputs to step method
getNumOutputsNumber of outputs of step method
isLockedLocked status for input attributes and nontunable properties
releaseAllow property value and input characteristics changes
resetReset the internal states of a System object
stepBuffer input signal based on past values


Create a buffer of 256 samples with 128 sample overlap:


for i=1:8
     % y is of length 256 with 128 samples
     %   from previous input


This object implements the algorithm, inputs, and outputs described on the Buffer block reference page. The object properties correspond to the block properties, except as noted.

This object processes inputs as frames or as samples by setting the FrameBasedProcessing property. The corresponding block has a temporary Treat Mx1 and unoriented sample-based signals as parameter with One channel option for frame behavior and M channels option for sample behavior. See the Buffer block reference page and Set the FrameBasedProcessing Property of a System object for more information.

Was this topic helpful?