mr2.utils.filters.dct_matrix
- mr2.utils.filters.dct_matrix(n: int, dtype: dtype = torch.float32) Tensor[source]
Create the orthonormal discrete cosine transform of type II.
The rows are cosine basis vectors, indexed by increasing frequency. For \(k,m=0,\ldots,n-1\),
\[C_{k,m} = \alpha_k\cos\!\left(\frac{\pi k(m+1/2)}{n}\right), \qquad \alpha_0 = n^{-1/2},\quad \alpha_{k>0} = (2/n)^{1/2}.\]C @ xcomputes the DCT-II of a length-nvector, andC.Tapplies its inverse. The first row is the constant (DC) basis vector.