How to find the variance of the coefficients in each subband using Bayes Shrink method.
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (2)
Audrey
am 1 Mär. 2012
0 Stimmen
1 Kommentar
Walter Roberson
am 1 Mär. 2012
Sorry, I have not studied wavelets.
bushra khan
am 10 Okt. 2017
Bearbeitet: Walter Roberson
am 10 Okt. 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');
Kategorien
Mehr zu Discrete Multiresolution Analysis finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!