Wastewater treatment plants consist of many biological reactors and a settler, representing an example of large-scale, nonlinear systems. The wastewater treatment plant in this study operates using an activated sludge system, which relies on biological processes to treat wastewater effectively. It is for this reason that iterative process modeling was used through the implementation of an Extended Kalman Filter (EKF) to predict the height of the sludge layer in secondary clarifiers, where the accumulation of activated sludge occurs during the sedimentation process. This technique consists of maximum likelihood estimation that works more consistently in various noise scenarios. As a result of the evaluation of the model estimated by the Extended Kalman Filter (EKF), the suitability of the process tends to be concluded on. In this sense, the prediction of the height in the sludge layer in sewage systems represents a complicated and heteroscedastic process, which can be understood as a phenomenon that can be influenced by a variety of factors. Therefore, this study does not identify problems in estimates through a thorough examination of residuals. It is concluded that the implementation of state-space modeling increases the adaptability and adjustability of the process to achieve structural optimization in a treatment plant. This approach is a viable and effective solution for the efficient management of polluting sludge levels and minimizing the possible environmental impact in out-of-control situations in wastewater treatment plants.