# Denoising by Donoho algorithm

7 views (last 30 days)
Soum on 15 Jun 2013
Hello I'm trying to apply Donoho formula on my noisy image to get the threshold value and apply it on details coefficients which i get it by using wavedec function please someone help me to get a results if some one have another idea for make my code useful please just tell me I'm waiting
clear all
n = prod( size(I) );
I=double(I);
[C,S] = wavedec2(Ib,2,'bior3.7');
DH = detcoef2('all',C,S,1);% extract details coefficient from level 1
delta = median( abs(DH) ) / 0.6745;
thr = delta * sqrt(2*log(n));
NC = wthcoef2('bior3.7',C,S,DH,thr,s) % i use the soft threshold
X = waverec2(C, S, 'bior3.7'); % how can i get my image after threshold
figure(2)
imagesc(X);axis off;colormap(gray)

Wayne King on 15 Jun 2013
Edited: Wayne King on 15 Jun 2013
You want to use the thresholded coefficients in the reconstruction. You also made a couple other errors in your code.
n = prod( size(I) );
I = double(I);
[C,S] = wavedec2(Ib,2,'bior3.7');
DH = detcoef2('all',C,S,1);% extract details coefficient from level 1
DH = DH(:);
delta = median( abs(DH) ) / 0.6745;
thr = delta * sqrt(2*log(n));
NC = wthcoef2('t',C,S,1,thr,'s'); % i use the soft threshold
X = waverec2(NC, S, 'bior3.7');
figure;
imagesc(Ib); title('Noisy Image'); colormap gray;
figure;
imagesc(X); title('Denoised 1st level coeffs'); colormap gray;
Soum on 25 Jun 2013
Thanks Mr.Walter Yes I've read this http://www.mathworks.com/help/wavelet/ref/wthcoef2.html but my Problem is why we put the t ???? t is a literal string but what does it mean ?