Observer-Based Residual Design for Nonlinear Systems