A method for analyzing gaseous or liquid samples is provided. Samples are interacted
with pores of a porous thin film. A time-varying response of reflectivity is obtained
from the surface of the porous thin film during the interaction. One or more analytes
forming the sample or a part of the sample are identified based upon the time-varying response.