Sequence recognition with scanning N-tuple ensembles