<< upsample | FOSSEE_Signal_Processing_Toolbox | validate_filter_bands >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > upsamplefill

# upsamplefill

Upsample a vector by interleaving given values or copies of the vector elements.

### Syntax

    y = upsamplefill(x, w, cpy)

### Parameters

x:

  Scalar, vector, or matrix of real or complex numbers.

w:

  Scalar or vector of real or complex values. Specifies the values to be interleaved between the elements of `x`.

cpy:

  Boolean (`%t` or `%f`). If `%t`, `w` must be scalar, and each value in `x` is repeated `w` times. Default is `%f`.

y:

  Upsampled vector or matrix with interleaved values or repeated elements.

### Description

The `upsamplefill` function upsamples a vector or matrix by interleaving specified values or repeating elements. If `cpy` is `%f`, the values in `w` are interleaved between the elements of `x`. If `cpy` is `%t`, each value in `x` is repeated `w` times.

### Examples

    // Upsample a vector by repeating elements:
    x = [1, 3, 5]
    y = upsamplefill(x, 2, %f)
    // Output: y = [1, 1, 1, 3, 3, 3, 5, 5, 5]

    // Upsample a vector by interleaving values:
    x = [1, 3, 5]
    y = upsamplefill(x, 2, %t)
    // Output: y = [1, 2, 3, 2, 5, 2]

Report an issue
<< upsample | FOSSEE_Signal_Processing_Toolbox | validate_filter_bands >>