code: 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
docs: Compute the whitening matrix.
  
          Parameters
          ----------
  
          x : array
              An `(n_samples, n_channels)` array.