def _asmStopCrit(matchIndices, nSamples, window=0.1, threshold=0.95):
    """ returns true if thresh proportion of xpads are in the middle
    window proportion of pLength
    """
    n0 = nSamples / 2.0 - nSamples * window
    n1 = nSamples / 2.0 + nSamples * window
    passes = ((n0 <= matchIndices) & (matchIndices <= n1)).sum()
    passFrac = float(passes) / len(matchIndices)
    if passFrac > threshold:
        return True, passFrac
    else:
        return False, passFrac
