function output = BGthres(input, BG, BGstd)

output = abs(input-BG)>2*BGstd;
