How to find the variance of the coefficients in each subband using Bayes Shrink method.
Afficher commentaires plus anciens
I'm performing compression on an image using bayes shrink method. so i first added gaussian noise to my image and applied 2D discrete wavelet transform.
So I found the variance of the HH subband using the following Matlab code.
sigma=median(abs(cH))/0.6475;
But I cant square this value because it says it has to be a square matrix.
Next in order to find variances in each subband I'm stuck. I have to find a summation of all coefficients in the subband. But I'm not quite sure how to do this for greater than 1 level of decompostion. Please help with a sample code.
Réponse acceptée
Plus de réponses (2)
Audrey
le 1 Mar 2012
0 votes
1 commentaire
Walter Roberson
le 1 Mar 2012
Sorry, I have not studied wavelets.
bushra khan
le 10 Oct 2017
Modifié(e) : Walter Roberson
le 10 Oct 2017
N=1024;
L= 4;
t=0:1:N-1;
signal=wnoise(2,10);
figure;
snr=2;
y = awgn(signal,snr,'measured');
noisy = signal + y; %noisy signal
plot(t,noisy);
title('noisy signal');
[c,l] = wavedec(noisy,L,'db1'); %wavelet
A1 = appcoef(c,l,'db1');
d1 = detcoef(c,l,1);
sig=median(abs(d1))/0.6745;
ct=[];
for r = 1:L
cdr = detcoef(c,l,r); %detailed coefficients
sigy=var(cdr);
sigx=sigy-sig^2;
z=sqrt(sigx);
T=(sig^2)/sigx;
cdr=cdr-T; %soft thresholding
cdr(cdr<=T)=0;
ct=[cdr ct];
end
ct=[A1 ct];
X = waverec(ct,l,'db1');
figure;
%hold on
plot(X);
title('reconstruction using hard thresholding');
Catégories
En savoir plus sur Continuous Wavelet Transforms dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!