Working version of StftAlgorithm