Repeat - Resample input at higher rate by repeating values

Library

Signal Operations

dspsigops

Description

The Repeat block upsamples each channel of the Mi-by-N input to a rate L times higher than the input sample rate by repeating each consecutive input sample L times at the output. You specify the integer L in the Repetition count parameter.

This block supports triggered subsystems if, for Frame-based mode, you select Maintain input frame rate.

Sample-Based Operation

When the input is sample based, the block treats each of the M*N matrix elements as an independent channel, and upsamples each channel over time. The Frame-based mode parameter must be set to Maintain input frame size. The output sample rate is L times higher than the input sample rate (Tso = Tsi/L), and the input and output sizes are identical.

Frame-Based Operation

When the input is frame based, the block treats each of the N input columns as a frame containing Mi sequential time samples from an independent channel. The block upsamples each channel independently by repeating each row of the input matrix L times at the output. The Frame-based mode parameter determines how the block adjusts the rate at the output to accommodate the repeated rows. There are two available options:

Zero Latency

The Repeat block has zero-tasking latency for all single-rate operations. The block is single-rate for the particular combinations of sampling mode and parameter settings shown in the table below.

Sampling ModeParameter Settings

Sample based

Repetition count parameter, L, is 1.

Frame based

Repetition count parameter, L, is 1, or

Frame-based mode parameter is Maintain input frame rate.

The block also has zero latency for all multirate operations in the Simulink® single-tasking mode.

Zero tasking latency means that the block repeats the first input (received at t=0) for the first L output samples, the second input for the next L output samples, and so on. The Initial condition parameter value is not used.

Nonzero Latency

The Repeat block has tasking latency only for multirate operation in the Simulink multitasking mode:

Examples

Construct the frame-based model shown below.

Adjust the block parameters as follows.

This model is multirate because there are at least two distinct sample rates, as shown by the two Probe blocks. To run this model in the Simulink multitasking mode, in the Solver pane of the Configuration Parameters dialog box, set the Type list to Fixed-step and set the Solver list to discrete (no continuous states). For the Tasking mode for periodic sample times parameter, select MultiTasking. Also set the Stop time to 30.

Run the model and look at the output, yout. The first few samples of each channel are shown below.

yout =
    11   -11
    11   -11
    12   -12
    12   -12
    13   -13
    13   -13
    14   -14
    14   -14
     1    -1
     1    -1
     2    -2
     2    -2
     3    -3
     3    -3
     4    -4
     4    -4
     5    -5
     5    -5

Since we ran this frame-based multirate model in multitasking mode, the block repeats each row of the initial condition matrix for L output samples, where L is the Repetition count of 2. The first row of the first input matrix appears in the output as sample 9 ,that is, sample MiL+1, where Mi is the input frame size.

Dialog Box

Repetition count

The integer number of times, L, that the input value is repeated at the output. This is the factor by which the output frame size or sample rate is increased.

Initial conditions

The value with which the block is initialized for cases of nonzero latency; a scalar or matrix.

Frame-based mode

For frame-based operation, the method by which to implement the repetition (upsampling): Maintain input frame size that is, increase the frame rate, or Maintain input frame rate, that is, increase the frame size. The Frame-based mode parameter must be set to Maintain input frame size for sample-base inputs.

Supported Data Types

PortSupported Data Types

Input

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed and unsigned)

  • Boolean

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

Output

  • Double-precision floating point

  • Single-precision floating point

  • Fixed point (signed and unsigned)

  • Boolean

  • 8-, 16-, and 32-bit signed integers

  • 8-, 16-, and 32-bit unsigned integers

See Also

FIR InterpolationSignal Processing Blockset
UpsampleSignal Processing Blockset

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS