Main Content

Derepeat

Reduce sampling rate by averaging consecutive samples

  • Derepeat block

Libraries:
Communications Toolbox / Sequence Operations

Description

The Derepeat block resamples the discrete input at a rate 1/N times the input sample rate by averaging N consecutive samples. N represents the Derepeat factor, N parameter.

Examples

expand all

In this example, the Derepeat block decreases the sample rate by averaging the consecutive samples.

Open the model. The input to the Derepeat block is a single-channel signal with a frame size of 64. In the block dialog box, set the Derepeat factor, M to 4, Input processing to Columns as channels (frame based), and Rate options to Allow single-rate processing.

Run the model. With a derepeat factor of 4, the output of the block has a frame size of 16. As the block operates in the single-rate processing mode, the input and output signals of the Derepeat block have the same frame rate.

In this example, the Derepeat block decreases the sample rate by averaging the consecutive samples.

Open the model. The input to the Derepeat block is a single-channel signal with a frame size of 64. In the block dialog box, set the Derepeat factor, M to 4, Input processing to Columns as channels (frame based), and Rate options to Allow multirate processing.

Run the model. With a derepeat factor of 4, the output of the block has a frame period of 4 seconds. As the block operates in the multirate processing mode, the input and output signals of the Derepeat block have the same frame size.

open_system('ex_derepeat_multirate.slx');
sim('ex_derepeat_multirate.slx');

Ports

Input

expand all

Input signal, specified as a scalar, vector, or matrix.

Data Types: double
Complex Number Support: Yes

Output

expand all

Output signal, returned as a scalar or column vector.

Data Types: double
Complex Number Support: Yes

For more information on the processing rates, see Single-Rate Processing, and Multirate Processing.

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.

Derepeat factor, specified as an integer. The derepeat factor is the number of consecutive input samples to average to produce each output sample.

Input processing control, specified as one of these options:

  • Columns as channels (frame based) — The block treats each column of the input as a separate channel.

  • Elements as channels (sample based) — The block treats each element of the input as a separate channel.

Block processing rate, specified as one of these options:

  • Allow multirate processing — The block downsamples the signal such that the output sample rate is Derepeat factor, N times slower than the input sample rate. For more information, see Multirate Processing.

  • Enforce single-rate processing — The block maintains the input sample rate by decreasing the output frame size by a factor equal to the Derepeat factor, N parameter value. Also, in single-rate processing mode you can use this block in a triggered subsystem. For more information, see Single-Rate Processing

Initial condition, specified as a scalar, vector, or matrix. This parameter specifies values that are output when it is too early for the input data to show up in the output. If the dimensions of the Initial condition parameter match the output dimensions, then the parameter represents the initial output value. If Initial condition is a scalar, then it represents the initial value of each element in the output. The block does not support empty matrices for initial conditions.

Block Characteristics

Data Types

double | single

Multidimensional Signals

no

Variable-Size Signals

no

More About

expand all

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Version History

Introduced before R2006a

See Also

Blocks