library(waveslim)
Perform a separable two-dimensional discrete wavelet transform (DWT) on a matrix of dyadic dimensions (powers of 2).
data(xbox)
xbox.dwt <- dwt.2d(xbox, "haar", 3)
par(mfrow=c(1,1), pty="s")
plot.dwt.2d(xbox.dwt)
par(mfrow=c(2,2), pty="s")
image(1:dim(xbox)[1], 1:dim(xbox)[2], xbox, xlab="", ylab="",
main="Original Image")
image(1:dim(xbox)[1], 1:dim(xbox)[2], idwt.2d(xbox.dwt), xlab="", ylab="",
main="Wavelet Reconstruction")
image(1:dim(xbox)[1], 1:dim(xbox)[2], xbox - idwt.2d(xbox.dwt),
xlab="", ylab="", main="Difference")
The Daubechies wavelets are based on the work of Ingrid Daubechies.
data(dau)
dim(dau)
## [1] 256 256
hist(dau)
par(mfrow=c(1,1), pty="s")
image(dau, col=rainbow(128))
sum(dau^2)
## [1] 1049732962
dau.dwt <- dwt.2d(dau, "d4", 3)
plot.dwt.2d(dau.dwt)
sum(plot.dwt.2d(dau.dwt, plot=FALSE)^2)
## [1] 1049732962
Explanation of above image: How to apply DWT (Discrete Wavelet Transform) to Image?
References
Stephane Mallat. A Wavelet Tour of Signal Processing. Academic Press, 2008.
Martin Vetterli and Jelena Kovacevic. Wavelets and Subband Coding, Prentice Hall 1995.
Ramazan Gen?ay, Faruk Sel?uk, and Brandon Whitcher. An Introduction to Wavelets and Other Filtering Methods in Finance and Economics. Academic Press, 2001.
packageVersion("waveslim")
## [1] '1.7.5'
efg
2015-01-28 2141