Generalized Titarenko's stripe removal algorithm