def _sigma_est_dwt(detail_coeffs, distribution='Gaussian'):
 detail_coeffs = detail_coeffs[np.nonzero(detail_coeffs)]
 if (distribution.lower() == 'gaussian'):
  denom = scipy.stats.norm.ppf(0.75)
  sigma = (np.median(np.abs(detail_coeffs)) / denom)
 else:
  raise ValueError('Only Gaussian noise estimation is currently supported')
 return sigma

def _sigma_est_dwt ( detail_coeffs , distribution = 'Gaussian' ) : detail_coeffs = detail_coeffs [ np . nonzero ( detail_coeffs ) ] if ( distribution . lower ( ) == 'gaussian' ) : denom = scipy . stats . norm . ppf ( 0.75 ) sigma = ( np . median ( np . abs ( detail_coeffs ) ) / denom ) else : raise ValueError ( 'Only Gaussian noise estimation is currently supported' ) return sigma
calculate the robust median estimator of the noise standard deviation .