Optimal linear filter and its relation to singular optimal control