Automatic filter code generator