Buffer input signal
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.,
To buffer an input signal:
Starting in R2016b, instead of using the
to perform the operation defined by the System
object, you can
call the object with arguments, as if it were a function. For example,
= step(obj,x) and
y = obj(x) perform
buff = dsp.Buffer returns
a buffer System
buff, used to buffer
input signals with overlap.
buff = dsp.Buffer( returns
a buffer object,
buff, with each specified property
set to the specified value.
buff = dsp.Buffer(LEN,OVRLAP,ICS,
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
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
Specify the value of the object's initial output for cases of
nonzero latency as a scalar, vector, or matrix. The default is
|reset||Reset the internal states of a System object|
|step||Buffer input signal based on past values|
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()); end
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.