This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materials including this page, select Japan from the country navigator on the bottom of this page.

dsp.Buffer System object

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).

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.


Starting in R2016b, instead of using the step method to perform the operation defined by the System object, you can call the object with arguments, as if it were a function. For example, y = step(obj,x) and y = obj(x) perform equivalent operations.


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

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

buff = dsp.Buffer(LEN,OVRLAP,ICS,'PropertyName',...
returns a buffer object, buff, 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.


resetReset the internal states of a System object
stepBuffer input signal based on past values
Common to All System Objects

Create System object with same property values


Expected number of inputs to a System object


Expected number of outputs of a System object


Check locked states of a System object (logical)


Allow System object property value changes


expand all

Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For example, myObject(x) becomes step(myObject,x).

Create a buffer of 256 samples with 128 sample overlap.

reader = dsp.SignalSource(randn(1024,1),128);
buff = dsp.Buffer(256,128);

for i = 1:8
    y = buff(reader());

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.

Introduced in R2012a

Was this topic helpful?