Ultrasonic velocity and attenuation of longitudinal waves in rocks