Reduce sampling rate by averaging consecutive samples
Communications Toolbox / Sequence Operations
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.
In
— Input signalInput signal, specified as a scalar, vector, or matrix.
Data Types: double
Complex Number Support: Yes
Out
— Output signalOutput signal, returned as a scalar or column vector.
Data Types: double
Complex Number Support: Yes
For more information on the processing rates, see SingleRate Processing, and Multirate Processing.
Derepeat factor, N
— Derepeat factorDerepeat factor, specified as an integer. The derepeat factor is the number of consecutive input samples to average to produce each output sample.
Data Types: double
Input processing
— Input processing controlColumns as channels (frame based)
(default)  Elements as channels (sample based)
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.
Rate options
— Block processing rateAllow multirate
processing
(default)  Enforce singlerate processing
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 singlerate 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 singlerate
processing mode you can use this block in a triggered subsystem.
For more information, see SingleRate Processing
Initial condition
— Initial conditionInitial 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.
Data Types: double
Data Types 

Multidimensional Signals 

VariableSize Signals 

The block derepeats each frame, treating distinct channels independently. Each
element of the output is the average of N consecutive elements
along a column of the input matrix. N must
be less than the frame size. N represents the Derepeat
factor, N
parameter.
When you set the Rate options
parameter to
Enforce singlerate processing
, the input and output
of the block have the same sample rate. The block reduces the sampling rate by using
a proportionally smaller frame size than the input. To process
all input values, N must be an integer factor of the number of
rows in the input vector or matrix. For derepetition by a factor of
N, the output frame size is 1/N times the
input frame size, but the input and output frame rates are equal. When you use this
option, the Initial condition
parameter does not apply and the
block incurs no delay, because the input data immediately shows up in the
output.
For example, for a singlechannel input with 64 elements that is derepeated by a factor of 4, the block outputs 16 elements. The input and output frame periods are equal.
Also, in singlerate processing mode you can use this block in a triggered subsystem.
When you set the Rate options
parameter to Allow
multirate processing
, the input and output of the block are the
same size, but the sample rate of the output is N times slower
than the input. N represents the Derepeat factor,
N
parameter.
When you set the Input processing
parameter to
Elements as channels (sample based)
, the
block assumes that the input is a vector or matrix whose elements represent
samples from independent channels. The block averages samples from each
channel independently over time. The output period is N
times the input period, and the input and output sizes are identical. The
output is delayed by one output period, and the first output value is the
Initial condition
value. If you set Rate
options
to Enforce singlerate
processing
, the block generates an error message.
When you set the Input processing
parameter to
Columns as channels (frame based)
, the block
reduces the sampling rate by using a proportionally longer frame
period at the output port than at the input port.
For derepetition by a factor of N, the output frame
period is N times the input frame period, but the input
and output frame sizes are equal. The output is delayed by one output frame,
and the first output frame is the Initial condition
value. The block derepeats each frame, treating distinct channels
independently. Each element of the output is the average of
N consecutive elements along a
column of the input matrix. The derepeat factor
must be less than the frame size.
For example, for a singlechannel input with a frame period of 1 second that is derepeated by a factor of 4, the output has a frame period of 4 seconds. The input and output frame sizes are equal.
Repeat — This block is one possible inverse operation.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
Select web siteYou can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.