A model-based approach for in-situ automatic defect detection in welds using ultrasonic phased array