DSP Blockset
  Go to block:
    Search    Help Desk 

Initial State of Buffer Blocks

The Buffer and Rebuffer Blocks

The Buffer and Rebuffer blocks are initialized to the value specified by the Initial condition parameter, which they output at the first simulation step. At the same sample time that the initial buffer is output, the Buffer and Rebuffer blocks read the first input sample into the next buffer. Once a Buffer or Rebuffer block has acquired Mo-L samples (where Mo is the Buffer size and L is the Buffer overlap), it outputs those samples in the second buffer at time Tsi*(Mo-L).

Note
The first output buffer (at t=0) is specified by the Initial condition parameter, whose default is zero. Inputs to the Buffer and Rebuffer blocks only begin appearing in the second output buffer. If the blocks that are generating the input to a Buffer or Rebuffer block also output zeros at the first simulation step, you may see two or more buffers of zeros before the first nonzero output.

For example, consider the scalar input series 1, 2, 3, ..., with sample period Ts. Given a Buffer size of 4, a Buffer overlap of 2, and the default Initial condition of 0:

Time
Buffer output
Notes
0
    0 0 0 0
    
The first output - all zeros
2*Ts
    0 0 1 2
    

4*Ts
    1 2 3 4
    
The first full buffer
6*Ts
    3 4 5 6
    

8*Ts
    5 6 7 8
    

For a Buffer size of 5 and a Buffer overlap of 3:

Time
Buffer output
Notes
0

    0 0 0 0 0
    
The first output - all zeros
2*Ts

    0 0 0 1 2
    

4*Ts

    0 1 2 3 4
    

6*Ts

    2 3 4 5 6
    
The first full buffer

The Unbuffer and Partial Unbuffer Blocks

The Unbuffer and Partial Unbuffer blocks are initialized with the buffer specified by the Initial condition parameter, which they begin unbuffering at the first simulation step. (The Partial Unbuffer block unbuffers the initial buffer in the usual manner, beginning with element M1 and ending with element M2, where M1 is the First output index parameter value and M2 is the Last output index parameter value.) At the same sample time that the first value (or M1) from the initial buffer is output, the Unbuffer and Partial Unbuffer blocks receive and store the first input buffer. When the last value (or M2) in the initial buffer is output, the Unbuffer and Partial Unbuffer blocks begin unbuffering the first input buffer. Unbuffer and Partial Unbuffer blocks therefore delay inputs by one buffer length, or Tsi seconds (the input sample period).

Note
If the blocks that are generating the input to an Unbuffer or Partial Unbuffer block output zeros at the first simulation step, you may see a large number of zeros in the unbuffered output at the start of a simulation.

For example, consider the input series

with frame period Tfi. The output of the Unbuffer block with zero initial conditions is then

with sample period Tfi/3.



[ Previous | Help Desk | Next ]