fmpair is a sndkit algorithm, implemented as a literate program. A more up-to-date version can be found here.
fmpair
sndkit
literate program