Measurement of gas composition using ultrasonic sensors