<< diric | FOSSEE_Signal_Processing_Toolbox | dst1 >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > downsample

# downsample

Downsample the signal, selecting every nth element.

### Syntax

    y = downsample(x, n)
    y = downsample(x, n, phase)

### Parameters

x:

  Vector or matrix. The input signal to be downsampled.

n:

  Scalar. The downsampling factor. Selects every nth element.

phase:

  Scalar (optional). The starting offset for downsampling. Defaults to 0.

y:

  Vector or matrix. The downsampled signal.

### Description

This function downsamples the input signal `x` by selecting every nth element. If `x` is a matrix, the function downsamples every column. If the optional `phase` parameter is provided, the function starts downsampling at the specified offset.

### Examples

    downsample([1, 2, 3, 4, 5], 2)

Report an issue
<< diric | FOSSEE_Signal_Processing_Toolbox | dst1 >>