Modified the function getLWandSNR.m