Skip to content

conv

Discrete convolution.

w = conv(u, v)
w = conv(u, v, shape)

Returns the discrete convolution of vectors u and v — the linear combination of shifted, scaled copies. Result length is length(u) + length(v) - 1 for shape = 'full' (default).

The shape argument controls the output size:

  • 'full' — entire convolution (default)
  • 'same' — center section, same length as u
  • 'valid' — only points where the kernel fully overlaps u

When the first argument is a graph handle, returns the convolution of the graph’s data points (used in chart-context analysis).

conv([1 1 1], [1 2 3]) % [1 3 6 5 3]
conv([1 1 1], [1 2 3], 'same') % [3 6 5]
conv([1 0 0 0 0], [0.5 0.5]) % impulse → 2-tap moving average
  • filter — 1D digital filter (IIR / FIR).
  • fft — 1D Fast Fourier Transform.