RT journal article T1 Enhancing the Swanepoel method: precise envelope detection of thin-film transmission spectra A1 Ballester, Manuel A1 Márquez Lozano, Almudena del Pilar A1 López-Tapia, Santiago A1 Fernández, Susana A1 Bass, John A1 Minkov, Dorian A1 Márquez Navarro, Emilio José A1 Katsaggelos, Aggelos K. A1 Willomitzer, Florian A1 Wuersch, Christoph A2 Física de la Materia Condensada A2 Matemáticas K1 Refractive index K1 Transmission measurements K1 root mean squared error K1 Swanepoel method AB The Swanepoel method is a widely used optical technique for characterizing thin films through normal-incidence transmission measurements. A critical step in this approach involves extracting the upper and lower envelopes of the measured oscillatory spectrum. By analyzing the transmission spectrum and its corresponding envelopes, the Swanepoel procedure enables precise determination of the film refractive index and extinction coefficient. However, even minor inaccuracies in envelope construction can propagate significant errors into the final characterization results. To address this challenge, we present what we believe to be a novel physics-informed optimization algorithm for envelope detection. Our mathematical model reformulates the envelope detection problem as a global optimization task that enforces the physical properties of the Swanepoel envelopes. Extensive validation on fifty randomly generated transmission spectra demonstrates unprecedented accuracy: the method achieves root-mean-square errors (RMSE) below 0.10% for the upper envelope and 0.06% for the lower envelope (more than doubling the accuracy of current state-of-the-art approaches). Furthermore, the proposed model has been assessed with two experimental transmission spectra, demonstrating its robustness and accuracy with real noisy data. We have developed an open-source Python software package (see text below). This software includes not only our innovative envelope construction algorithm but also additional envelope drawing algorithms for comparison and an efficient implementation of the Swanepoel method, enabling complete optical characterization of thin films. PB Optica Publishing Group SN 1094-4087 YR 2025 FD 2025 LK http://hdl.handle.net/10498/37911 UL http://hdl.handle.net/10498/37911 LA eng DS Repositorio Institucional de la Universidad de Cádiz RD 10-may-2026