Main Content

Buffers, Switches, and Counters

R2026b
Change sample rate or frame rate of signals, count events, detect edges, perform actions when events occur

Convert signal rates and frame sizes in Simulink® using frame rebuffering blocks such as the Buffer, Unbuffer, and the Delay Line blocks. Implement FIFO and LIFO buffers using the Queue, Stack blocks in Simulink, and dsp.AsyncBuffer object in MATLAB®. You can also count events, detect edges, and perform actions when events occur using the switch and counter blocks in DSP System Toolbox™.

Objects

dsp.AsyncBufferFIFO buffer

Functions

rebuffer_delayNumber of samples of delay introduced by buffering and unbuffering operations

Blocks

expand all

Buffer blockBufferBuffer input sequence to smaller or larger frame size
N-Ratio Buffer blockN-Ratio BufferBuffer input data into integer-multiple-sized frames (Since R2026a)
Delay Line blockDelay LineRebuffer sequence of inputs
Queue blockQueueStore inputs in FIFO register
Stack blockStackStore inputs into LIFO register
Unbuffer blockUnbufferUnbuffer input frame into sequence of scalar outputs
N-Ratio Unbuffer blockN-Ratio UnbufferUnbuffer input data into integer-factor-sized frames (Since R2026a)
Counter blockCounterCount up or down through specified range of numbers
Edge Detector blockEdge DetectorDetect transition from zero to nonzero value
Event-Count Comparator blockEvent-Count ComparatorDetect threshold crossing of accumulated nonzero inputs
Multiphase Clock blockMultiphase ClockGenerate multiple binary clock signals
N-Sample Enable blockN-Sample EnableOutput ones or zeros for specified number of sample times
N-Sample Switch blockN-Sample SwitchSwitch between two inputs after specified number of sample periods

Topics