def __test_isfir(gorig, M):
    """ Internal function that tests if original window is FIR.

    Dual window is FIR if length of the original window is <= M. This is true
    if the length was not explicitly defined and gorig is a string.

    - Input parameters:

    :param gorig: window parameters
    :type gorig: dict (with parameters of the window as keywords)
    :param int M: the number of channels.

    - Output parameters:

    :rtype: boolean
    """
    if isinstance(gorig, dict) and gorig:
        if 'M' in gorig and gorig['M'] <= M:
            return True
    if isinstance(gorig, str):
        return True
    return False
