MATLAB: Can anyone tell what windowfilt and “w” is doing in this program

dtdwtw

function y = dtdwt(x)
windowsize = 7;
windowfilt = ones(1,windowsize)/windowsize;
% Number of Stages
J = 6;
I=sqrt(-1);
L = length(x);
N = L+2^J;
x = symextend(x,2^(J-1));
load nor_dualtree
[Faf, Fsf] = AntonB;
[af, sf] = dualfilt1;
W = dual2D(x, J, Faf, af);
W = normcoef(W,J,nor);
% Noise variance estimation using robust median estimator..
tmp = W{1}{1}{1}{1};
Nsig = median(abs(tmp(:)))/0.6745;
for scale = 1:J-1
for dir = 1:2
for dir1 = 1:3
Y_coef_real = W{scale}{1}{dir}{dir1};
Y_coef_imag = W{scale}{2}{dir}{dir1};
Y_parent_real = W{scale+1}{1}{dir}{dir1};
Y_parent_imag = W{scale+1}{2}{dir}{dir1};
Y_parent_real = expand(Y_parent_real);
Y_parent_imag = expand(Y_parent_imag);
Wsig = conv2(windowfilt,windowfilt,(Y_coef_real).^2,'same');
Ssig = sqrt(max(Wsig-Nsig.^2,eps));
% Threshold value estimation
T = sqrt(3)*Nsig^2./Ssig;
% Bivariate Shrinkage
Y_coef = Y_coef_real+I*Y_coef_imag;
Y_parent = Y_parent_real + I*Y_parent_imag;
Y_coef = bishrink(Y_coef,Y_parent,T);
W{scale}{1}{dir}{dir1} = real(Y_coef);
W{scale}{2}{dir}{dir1} = imag(Y_coef);
end
end
end
% Inverse Transform
W = unnormcoef(W,J,nor);
y = idual2D(W, J, Fsf, sf);
% Extract the image ind = 2^(J-1)+1:2^(J-1)+L; y = y(ind,ind);

Best Answer

windowfilt is a lowpass filter that is being used a separable 2D filter here:
Wsig = conv2(windowfilt,windowfilt,(Y_coef_real).^2,'same');
The above line basically says filters the columns of (Y_coef_real).^2 with windowfilt, and then filter the rows of (Y_coef_real).^2 with windowfilt.
I don't see the variable, w, I see W (upper case). Be careful, MATLAB is case-sensitive. W is the dual-tree wavelet transform of the input image down to level J=6