From data to diagnosis and control using generalized orthonormal basis filters. Part I: Development of state observers