Julia port of Dan Ellis's rastamat package (only in part)