def METHOD_NAME(ch):
    stft = Stft(
        n_fft=8,
        win_length=None,
        hop_length=2,
        center=True,
        window="hann",
        normalized=False,
        onesided=True,
    )
    torch.random.manual_seed(0)
    x = random_speech[..., :ch]
    ilens = torch.LongTensor([16, 12])
    # (B, T, C, F) -> (B, F, C, T)
    X = torch.complex(*torch.unbind(stft(x, ilens)[0], dim=-1)).transpose(-1, -3)
    # (B, F, C, C)
    Phi_X = torch.einsum("...ct,...et->...ce", [X, X.conj()])
    is_singular = True
    while is_singular:
        N = torch.randn_like(X)
        Phi_N = torch.einsum("...ct,...et->...ce", [N, N.conj()])
        is_singular = not torch.linalg.matrix_rank(Phi_N).eq(ch).all()
    # Phi_N = torch.eye(ch, dtype=Phi_X.dtype).view(1, 1, ch, ch).expand_as(Phi_X)
    # e_val: (B, F, C)
    # e_vec: (B, F, C, C)
    e_val, e_vec = generalized_eigenvalue_decomposition(Phi_X, Phi_N)
    e_val = e_val.to(dtype=e_vec.dtype)
    assert torch.allclose(
        torch.matmul(Phi_X, e_vec),
        torch.matmul(torch.matmul(Phi_N, e_vec), e_val.diag_embed()),
    )