Main Content

N-Ratio Unbuffer

Unbuffer input data into integer-factor-sized frames

Since R2026a

  • N-Ratio Unbuffer block

Libraries:
DSP System Toolbox / Signal Management / Buffers

Description

The N-Ratio Unbuffer block unbuffers data into blocks of length equal to integer N factors of the input frame length. The integer ratio N between the input frame length and the output frame length is given by the Input-to-output frame length ratio parameter.

Here is an illustration that shows how the block unbuffers the data into the specified size.

Schematic showing input frames of length 5 being converted into data of frame length 1.

The N-Ratio Unbuffer block optimizes the memory used in the generated code for P- to P/N- frame conversion.

Examples

expand all

Use the N-Ratio Unbuffer block to unbuffer multichannel signals of frame length N into multichannel signals of frame length 1, where N is a positive integer greater than 1.

This figure is a graphical representation of the unbuffering process.

In this example, a two-channel signal with 4 samples per frame is unbuffered into a two-channel signal with 1 sample per frame using the N-Ratio Unbuffer block.

Open the ex_nratiounbuffer_tut model. In this model, the parameters of the Signal From Workspace block have the following values:

  • Signal = [1:10;-1:-1:-10]'

  • Sample time = 1

  • Samples per frame = 4

  • Form output after final data value by = Setting to zero

Based on these parameters, the Signal From Workspace block outputs a two-channel signal with a frame length of 4. Save these parameters and close the dialog box by clicking OK.

Double-click the N-Ratio Unbuffer block and set the Input-to-output frame length ratio to 4. The N-Ratio Unbuffer block outputs a signal with a frame length of 1.

Run the model.

The following figure is a graphical representation of what happens when you simulate the model.

Ports

Input

expand all

Specify the data input as a scalar, vector, or a matrix of size P-by-Q.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point
Complex Number Support: Yes

Output

expand all

Output of the N-ratio unbuffer, returned as a scalar, vector, or a matrix of size P/N-by-Q, where N is the value you specify in the Input-to-output frame length ratio parameter.

Data Types: single | double | int8 | int16 | int32 | int64 | uint8 | uint16 | uint32 | uint64 | Boolean | fixed point
Complex Number Support: Yes

Parameters

expand all

To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.

Specify the ratio of the input frame length to the output frame length, N, as a positive integer.

Block Characteristics

Data Types

Boolean | double | fixed point | integer | single

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

Extended Capabilities

expand all

Version History

Introduced in R2026a