Library: | wavelet |
See also: | fwt invfwt stein sure2d |
Quantlet: | sure | |
Description: | Sure denoises wavelet coefficients so that the mean squared error is minimized. MSE is estimated by Stein's unbiased risk estimator based on the variance of the coefficients. Sure computes the optimal threshold for the father wavelets and each level of mother wavelets. The input arrays can be obtained by the function 'fwt'. |
Usage: | {at, bt} = sure (a, b) | |
Input: | ||
a | p x 2 array, indices and coefficients of the father wavelet | |
b | q x 3 array, indices and coefficients of mother wavelet | |
Output: | ||
at | p x 2 array, thresholded father wavelet coefficients | |
bt | q x 3 array, thresholded mother wavelet coefficients |
; loads the library wavelet library("wavelet") n = 128 x = grid(0, 1./n, n) ; computes a noisy step function y = 0.1*(x.<=0.4) + 2*(abs(x-0.5).<0.1) y = y + 0.5*(abs(x- 0.7)<0.1) y = y + normal(n)/sqrt(n) ; computes the wavelet coefficients {a, b} = fwt(y, 2, daubechies2) ; thresholds the coefficients {at, bt} = sure(a, b) ; computes the inverse wavelet transform ys = invfwt(at, bt, n, 2, daubechies2) d = createdisplay(1,1) tdat = x~ys setmaskl(tdat,(1:rows(tdat))', 4, 1, 3) show(d,1,1, tdat, x~y)
ys denoised estimate of y