Materials testing by ultrasonic spectroscopy