Coding wavelets the easy way

function u = InvWaveTransform(WT,rh,rg,scale)
% reconstructs signal using the filters rh and rg
for i = scale:-1:1
lopart = zeroinsert(WT.LoRes);
lopart = myconv(lopart,rh);
hipart = zeroinsert(WT.Details{i});
hipart = myconv(hipart,rg);
WT.LoRes = addSignals(lopart,hipart);
end
u = WT.LoRes;