An algorithm for strongly correlated noise