def fit(self, x, fudge=1e-18):
        assert x.ndim == 2
        ns, nc = x.shape
        x_cov = np.cov(x, rowvar=0)
        assert x_cov.shape == (nc, nc)
        d, v = np.linalg.eigh(x_cov)
        d = np.diag(1. / np.sqrt(d + fudge))
        # This is equivalent, but seems much slower...
        # w = np.einsum('il,lk,jk->ij', v, d, v)
        w = np.dot(np.dot(v, d), v.T)
        self._matrix = w
        return w
Helper function for representing the floating-point number s as
dataset/ETHPy150Open kwikteam/phy/phy/traces/filter.py/Whitening.fit--crossover with--dataset/ETHPy150Open fredrik-johansson/mpmath/mpmath/libmp/libmpf.py/to_digits_exp