  We present an advanced thermal response model for micro- and nanomechanical
systems in photothermal sensing, designed to balance speed and precision. Our
model considers the two time constants of the nanomechanical element and the
supporting chip, triggered by photothermal heating, enabling precise
photothermal input signal estimation through Kalman filtering. By integrating
heat transfer and noise models, we apply an adaptive Kalman filter optimized
for FPGA systems in real-time or offline. This method, used for photothermal
infrared (IR) spectroscopy with nanomechanical resonators and a quantum cascade
laser (QCL) in step-scan mode, enhances response speed beyond standard low-pass
filters, reducing the effects of drift and random walk. Analytical calculations
show the significant impact of the thermal expansion coefficients' ratio on the
frequency response. The adaptive Kalman filter, informed by the QCL's input
characteristics, accelerates the system's response, allowing rapid and precise
IR spectrum generation. The use of the Levenberg-Marquardt algorithm and PSD
analysis for system identification further refines our approach, promising fast
and accurate nanomechanical photothermal sensing.
