Direct Filtering: a new approach to optimal filter design for nonlinear systems