h=tconv(f,g);
tconv(f,g) computes the twisted convolution of the square matrices f and g.
Let h=tconv(f,g) for f,g being \(L \times L\) matrices. Then h is given by
where \(m-k\) and \(n-l\) are computed modulo L.
If both f and g are of class sparse then h will also be a sparse matrix. The number of non-zero elements of h is usually much larger than the numbers for f and g. Unless f and g are very sparse, it can be faster to convert them to full matrices before calling tconv.
The routine spreadinv can be used to calculate an inverse convolution. Define h and r by:
h=tconv(f,g); r=tconv(spreadinv(f),h);
then r is equal to g.