A system and method for analyzing a sample is described. The system may include, for example, a light source and a scanning probe microscope probe. The light source may generate a coherent laser beam that is modulated by a waveform of a lower frequency. The modulated laser beam is absorbed by the sample causing thermally induced expansion and resulting in an excitation of acoustic waves. The probe is locally deployed near the sample and detects, in real time, perturbations in the excited acoustic waves to detect surface and buried structures of the sample.