function blmask = BLWmask(blsig, th)

m1 = zeros(size(blsig));
blp = find(abs(blsig)>=th);
m1(blp) = 1;

covMask = ones(100,1);

convVal = conv(m1,covMask);
convVal(1:50) = [];
convVal(end-50:end) = [];

blmask = ones(size(blsig));
id = find(convVal>0);
blmask(id) = 0;

end