block.dct.2d(x, n.levels=4, dct.type=2) block.cpt.2d(x, n.levels=4, taper="poly2", dct.type=2, boundary="periodic")
block.dct.2d is a special case of block.cpt.2d, in which the taper is always set to be "boxcar".
If only a single integer or string is given for arguments dct.type, taper or boundary, then the same function or rule is used for both rows and columns. Different taper functions, boundary rules, DCT types can be used for rows and columns by using a vector of length two for that argument. The first element of the vector applies to the rows and the second to the columns.
See dct for the algorithms for DCT-II and DCT-IV.
Algorithms are described in the S+WAVELETS User's Manual, in the section "Cosine Packet Algorithms". They are discussed in greater depth in Chapter 4 of Wickerhauser (1994).
All the default optional arguments can be reset using function wavelet.options, see wavelet.options for details.
xx <- phone-mean(phone) par(mfrow=c(1, 2)) bdct <- block.dct.2d(xx, n.levels=2) thresh1 <- quantile(unclass(bdct), 0.8) xx1 <- shrink(bdct, thresh1) # use top 20% coefficients image(reconstruct(xx1)) bcpt <- block.cpt.2d(xx, n.levels=2, taper="poly2") thresh2 <- quantile(unclass(bcpt), 0.8) xx2 <- shrink(bcpt, thresh2) # use top 20% coefficients image(reconstruct(xx2))