pylops.utils.signalprocessing.convmtx#

pylops.utils.signalprocessing.convmtx(h, n, offset=0)[source]#

Convolution matrix

Makes a dense convolution matrix \(\mathbf{C}\) such that the dot product np.dot(C, x) is the convolution of the filter \(h\) centered on offset and the input signal \(x\).

Equivalent of MATLAB’s convmtx function for: - mode='full' when used with offset=0. - mode='same' when used with offset=len(h)//2 (after truncating the rows as C[:n])

Parameters
hnp.ndarray

Convolution filter (1D array)

nint

Number of columns of convolution matrix

offsetint

Index of the center of the filter

Returns
Cnp.ndarray

Convolution matrix of size \(\text{len}(h)+n-1 \times n\)