Sol-gel derived titanium carboxylate thin films for optical detection of analytes