Separated out filter, used signed values everywhere
Bug in python script
Implemented clipping before filtering