Temperature compensation of ultrasonic velocity