import math


def bellangerord(delta1, delta2, fs, deltaf):
    """Estimate filter order.

    Uses equation (5.32) from Bellanger to estimate filter order.

    Args:
        delta1: Passband ripple
        delta2: Stopband ripple
        fs: Sample rate
        deltaf: transition bandwidth

    Returns:
        Filter order
    """
    return int(math.ceil(2/3*math.log(1/(10*delta1*delta2))*fs/deltaf))