downsample

Downsample a signal by an integer factor.

📝 Syntax

  • Y = downsample(X, n)

  • Y = downsample(X, n, phase)

  • Y = downsample(X, n, phase, dim)

📥 Input argument

  • X - input sequence. Vector or matrix. If X is a matrix, columns are processed independently by default.

  • n - positive integer downsampling factor (n > 0).

  • phase - optional integer in the range 0..n-1 (default 0). The output starts at X(phase+1) and then takes every n-th sample.

  • dim - optional dimension along which to downsample. If omitted, downsampling is applied to columns for 2-D inputs.

📤 Output argument

  • Y - downsampled result: elements of X taken every n samples starting at index (phase + 1) along the specified dimension.

📄 Description

Thedownsample function returns every n-th sample of the input sequence X, beginning at sample index (phase + 1). For example,downsample(X, 2) returns the odd-indexed samples of X (1,3,5,...). If X is a matrix, the operation is applied column-wise by default unless a dimension is provided.

No anti-aliasing filtering is performed; if you need to reduce high-frequency content before decimation, consider usingdecimate or applying a low-pass filter first.

💡 Example

🔗 See also

interp1.

🕔 History

Version
📄 Description

1.15.0

initial version

Last updated

Was this helpful?