def pca_eig(x):
    """Calculate PCA using eigenvalue decomposition.
    
    Parameters
    ----------
    x : ndarray, shape (channels, samples)
        Two-dimensional input data.

    Returns
    -------
    w : ndarray, shape (channels, channels)
        Eigenvectors (principal components) (in columns).
    s : ndarray, shape (channels,)
        Eigenvalues.
    """
    s, w = np.linalg.eigh(x.dot(x.T))
    return w, s