Optical measurement of transient ultrasonic shock waves