Engee documentation

Buffer

Buffer the input sequence to a smaller or larger frame size.

buffer

Description

The Buffer block performs frame processing. The block redistributes the data in each column of the input signal to produce an output signal with a different frame size.

Buffering the signal to a larger frame size results in an output signal with a lower frame rate than the input. An example for scalar input is shown in the figure below:

buffer 1

Buffering the signal to a smaller frame size gives the output a higher frame rate than the input. Example for scalar output in the figure below:

buffer 2

Ports

Input

Port_1 - input signal
scalar | vector | matrix

To buffer multichannel signals, a string vector or matrix is introduced. To buffer single-channel signals it is necessary to enter a scalar or vector-column with the size by 1, where is the size of the input frame.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128, Bool.

Support for complex numbers: Yes

Output

Port_1 - output signal
scalar | vector | matrix

Buffered input signal returned as a scalar, vector or matrix.

If the input signal is single-channel:

  • scalar - the output signal is a vector of dimension by 1.

  • vector of length - the output signal is a vector of dimension by 1.

    where

    • - input frame size

    • - output buffer size parameter value, if - output signal is a scalar

    Input frame period is equal to , where is the input sampling period. The output frame period is equal to , where is the value of the Buffer overlap parameter. When Buffer overlap is set to , the output frame period is equal to the input sampling period.

If a multi-channel signal is input:

  • matrix 1 to - the output signal is a matrix of dimension to .

  • matrix to - the output signal is a matrix of dimension to .

    where

    • - number of channels in the signal

    • - input frame period

    • - is the value of the Output buffer size parameter, which may be larger or smaller than the input frame size . The block buffers each of the input channels independently.

    The input frame period is equal to . The output frame period is , which is equal to the sequence sampling period when the Buffer overlap parameter is set to . Thus, the output sampling period of is related to the input sampling period of as follows:

The output data has the same type and complexity as the input data.

Data types: Float16, Float32, Float64, Int8, Int16, Int32, Int64, Int128, UInt8, UInt16, UInt32, UInt64, UInt128, Bool.

Support for complex numbers: Yes

Parameters

Output buffer size (per channel) - buffer size
64 (by default) | ` positive integer`

Specify the number of consecutive samples, , from each channel to be buffered to the output frame.

Buffer overlap - buffer overlap
0 (by default) | ` integer`.

Specify the number of samples, , which determines the amount of overlap or incomplete overlap in each subsequent output frame.

To overlap the data in the buffer, specify the value in the range , where is the value of the Output buffer size parameter.

The block takes samples (lines) from the current output frame and repeats them in the next output frame. In case of overlap, the block receives new input samples before propagating the buffered data to the output.

When , an incomplete overlap signal is buffered. The block discards input samples after the buffer is full and outputs the buffer with a period , which is longer than in the case of zero overlap.

The period of the output frame is , which is equal to the sampling period of the input sequence , when the value of the Buffer overlap parameter is equal to .

Initial conditions - initial value
0.0 (by default) | scalar | vector | matrix

Specify the value with which the block is initialised for non-zero wait time cases as a scalar, vector or matrix.

For all cases of single-task operations, the Buffer block is initialised with the value(s) specified in the Initial conditions parameter. The block reads data from this buffer to generate the first output samples, where

The dimensionality of the Initial conditions parameter depends on the Buffer overlap, , and whether the input is single-channel or multi-channel:

  • If , then the Initial conditions parameter must be a scalar.

  • If , then the Initial conditions parameter can be a scalar or a vector with one of these constraints:

    • For single-channel inputs, the initial conditions parameter can be a vector of length , if is 1, or a vector of length , if is 1.

    • For multi-channel inputs, the Initial conditions parameter can be a vector of length , if is 1, or a vector of length , if is 1.

For general buffering between frames of arbitrary size, the Initial conditions parameter must be a scalar, which is then repeated over all elements of the initial output(s). But, in the special case where the input is a vector of rows 1 to , and the block output is a matrix to , the initial conditions may be:

  • Matrix to .

  • A vector of length , repeated over all columns of the original output(s).

  • A scalar repeating in all elements of the original output(s).

In the special case where the output is a vector-row 1 at , which is the result of unbuffering the matrix by , the initial conditions may be:

  • A vector containing samples for consecutive output on each channel during the first samples.

  • A scalar to be repeated for all elements of the initial output(s).

Read More

Zero delay

Zero delay means that the first input sample received at , appears as the first output sample. In single-task mode, the Buffer block has zero delay for these cases:

  • Scalar input and output ( ) with zero or negative Buffer overlap ( ).

  • The input frame size is an integer multiple of the output frame size (with zero value of Buffer overlap parameter ( )).

    where

    • - is an integer.

      Notable cases of this include:

      • Any input frame size with scalar output ( ) and zero Buffer overlap ( );

      • Equal input and output frame sizes ( ) with zero Buffer overlap parameter value ( ).