| DSP Blockset | Search  Help Desk |
| Repeat | See Also |
Repeat the input sample a specified number of times.
Library
Signal Operations, in General DSPDescription
The Repeat block upsamples the input signal by repeating each consecutive input sample L times at the output, where L is specified by the Repetition count parameter. The Frame-based inputs parameter allows you to choose between sample-based and frame-based operation.Sample-Based Operation
When the check box is not selected (default), the block assumes that the input is a 1-by-N sample vector or M-by-N sample matrix. Each of the N vector elements (or M*N matrix elements) is treated as an independent channel, and the block repeats the value in each channel L times at the output. The output sample rate is L times higher than the input sample rate, and the input and output sizes are identical. In sample-based mode, the Initial condition parameter specifies the value of the first L output samples, and can be a vector containing one value for each channel, or a scalar to be applied to all signal channels.Frame-Based Operation
When the Frame-based inputs check box is selected, the block assumes that the input is an M-by-N frame matrix. Each of the N frames in the matrix contains M sequential time samples from an independent signal. The illustration below shows a 6-by-4 matrix input:
The Number of channels parameter specifies the number of independent channels (columns), N, in the matrix. Frame-based operation provides substantial increases in throughput rates, at the expense of greater model latency.
In frame-based operation, the block upsamples each channel independently by repeating each row in the input matrix L times at the output. The Framing parameter determines how the block adjusts the rate at the output to accommodate the repeated rows. There are two available options:
The block generates the output at the faster (upsampled) rate by using a proportionally shorter frame period at the output port than at the input port. For L repetitions of the input, the output frame period is L times shorter than the input sample period, but the input and output frame sizes are equal.
The example below shows a single-channel input with a frame period of 1 second (Sample time = 1/64 and Samples per frame = 64 in the Signal From Workspace block) being upsampled through 4-times repetition to a frame period of 0.25 seconds. The input and output frame sizes are identical.

The block generates the output at the faster (upsampled) rate by using a proportionally larger frame size than the input. For L repetitions of the input, the output frame size is L times larger than the input frame size, but the input and output frame rates are equal.
The example below shows a single-channel input of frame size 64 being upsampled through 4-times repetition to a frame size of 256. The input and output rates are identical.

Dialog Box

See Also
FIR Interpolation