def _psd_from_mt(x_mt, weights):
 psd = (weights * x_mt)
 psd *= psd.conj()
 psd = psd.real.sum(axis=(-2))
 psd *= (2 / (weights * weights.conj()).real.sum(axis=(-2)))
 return psd

def _psd_from_mt ( x_mt , weights ) : psd = ( weights * x_mt ) psd *= psd . conj ( ) psd = psd . real . sum ( axis = ( - 2 ) ) psd *= ( 2 / ( weights * weights . conj ( ) ) . real . sum ( axis = ( - 2 ) ) ) return psd
compute psd from tapered spectra .