There are two alternative methods to compute DCT and its inverse in MATLAB. One is dct2
/idct2
and the other is the transformation matrix computed by dctmtx
. Why is there an alternative way based on matrix multiplications making use of dctmtx
?
Asked
Active
Viewed 3,705 times
1 Answers
4
"If A is square, the two-dimensional DCT of A can be computed as D*A*D'. This computation is sometimes faster than using dct2, especially if you are computing a large number of small DCTs, because D needs to be determined only once."
Where D = dctmtx(n)
Source: http://www.mathworks.com/help/toolbox/images/ref/dctmtx.html

Adam27X
- 889
- 1
- 7
- 16
-
3The weird thing is, it is not completely true. Using matlab `dct2` and the `D*I*D'` method gives slightly different results. – Maurits Nov 28 '12 at 20:03