% T = dctmtx (n) % Return the DCT transformation matrix of size n x n. % % If A is an n x n matrix, then the following are true: % T*A == dct(A), T'*A == idct(A) % T*A*T' == dct2(A), T'*A*T == idct2(A) % % A dct transformation matrix is useful for doing things like jpeg % image compression, in which an 8x8 dct matrix is applied to % non-overlapping blocks throughout an image and only a subblock on the % top left of each block is kept. During restoration, the remainder of % the block is filled with zeros and the inverse transform is applied % to the block. % % See also: dct, idct, dct2, idct2