Original commit of James Lewis's SNR estimation code.