function Wf=WCT(P,z,a,b)

P=P/max(P);

for ja=1:length(b)
    Wf(ja)=(1/a)*trapz(z,P.*haar(z,a,b(ja)));
end
return
end

function H=haar(z,a,b)
H=zeros(size(z));
ind1= find(z>=(b-.5*a) & z<b);
H(ind1)=1;
ind2=find(z>b & z<=b+0.5*a)
H(ind2)=-1;
end