def _ambisonics_channel_count_from_order(order, three_dim=True):
    """
    Helper function that computes the number of channels for a given ambisonics order.
    """
    return (order + 1)**2 if three_dim else (2 * order + 1)