www.gusucode.com > dsp 案例源码程序 matlab代码 > dsp/CreateABufferExample.m

    %% Create a Buffer
%%
% *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.
hreader = dsp.SignalSource(randn(1024,1),128);
hbuff = dsp.Buffer(256,128);

for i=1:8
    y = hbuff(hreader());
end

%%
% y is of length 256 with 128 samples from previous input.