Number of samples of delay introduced by buffering and unbuffering operations
d = rebuffer_delay(f,n,v)
d = rebuffer_delay(f,n,v,'mode')
d = rebuffer_delay(f,n,v)
returns the delay,
in samples, introduced by the Buffer or Unbuffer block in multitasking operations.
d = rebuffer_delay(f,n,v,'mode')
returns
the delay, in samples, introduced by the Buffer or Unbuffer block
in the specified tasking mode.
|
Frame size of the input to the Buffer or Unbuffer block. |
|
Size of the output buffer. Specify one of the following:
|
|
Amount of buffer overlap. Specify one of the following:
|
|
The tasking mode of the model. Specify one of the following options:
Default: |
Compute the delay introduced by a Buffer block in a multitasking model:
Open a model containing a Buffer block. For this example,
open the ex_buffer_tut4
model by typing ex_buffer_tut4 at the MATLAB® command
line.
Double-click the Buffer block to open the block mask. Verify that you have the following settings:
Output buffer size = 3
Buffer overlap = 1
Initial conditions = 0
Based on these settings, two of the required inputs to the rebuffer_delay
function
are as follows:
n = 3
v = 1
To determine the frame size of the input signal to the Buffer block, open the Signal From Workspace block mask. Verify that you have the following settings:
Signal = sp_examples_src
Sample time = 1
Samples per frame = 4
Because Samples per frame = 4
,
you know the f
input to the rebuffer_delay
function
is 4
.
After you verify the values of all the inputs to the rebuffer_delay
function,
determine the delay that the Buffer block introduces in this multitasking
model. To do so, type the following at the MATLAB command line:
d = rebuffer_delay(4,3,1) d = 8
Compute the delay introduced by an Unbuffer block in a multitasking model:
Open a model containing an Unbuffer block. For this
example, open the ex_unbuffer_ref1
model by
typing ex_unbuffer_ref1 at
the MATLAB command line.
To determine the frame size of the input to the Buffer block, open the Signal From Workspace block mask by double-clicking the block in your model. Verify that you have the following settings:
Signal = sp_examples_src
Sample time = 1
Samples per frame = 3
Because Samples per frame = 3
,
you know the f
input to the rebuffer_delay
function
is 3
.
Use the rebuffer_delay
function
to determine the amount of delay that the Unbuffer block introduces
in this multitasking model. To compute the delay introduced by the
Unbuffer block, use f = 3
, n = 1
and v
= 0
.
d = rebuffer_delay(3,1,0) d = 3