Handheld spectral analyzer turns smartphone into diagnostic tool