def recommended_overlap(name, nfft=None):
try:<EOL><INDENT>name = canonical_name(name)<EOL><DEDENT>except KeyError as exc:<EOL><INDENT>raise ValueError(str(exc))<EOL><DEDENT>try:<EOL><INDENT>rov = ROV[name]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise ValueError("<STR_LIT>" % name)<EOL><DEDENT>if nfft:<EOL><INDENT>return int(ceil(nfft * rov))<EOL><DEDENT>return rov<EOL>
Returns the recommended fractional overlap for the given window

    If ``nfft`` is given, the return is in samples

    Parameters
    ----------
    name : `str`
        the name of the window you are using

    nfft : `int`, optional
        the length of the window

    Returns
    -------
    rov : `float`, `int`
        the recommended overlap (ROV) for the given window, in samples if
        ``nfft` is given (`int`), otherwise fractional (`float`)

    Examples
    --------
    >>> from gwpy.signal.window import recommended_overlap
    >>> recommended_overlap('hann')
    0.5
    >>> recommended_overlap('blackmanharris', nfft=128)
    85