On-line pork carcass grading is currently performed by a grader using an electronic probe. However, the manual, invasive pork grading operation can be affected by such factors as human fallibility and fatigue as well as cross-contamination between carcasses. These drawbacks incited the development of an automated non-invasive pork grading system. After comparing several potential non-invasive technologies, ultrasound technology was chosen for de /eloping such a system. Since robot-based non-invasive ultrasonic scanning for grading of fresh pig carcasses has never been studied elsewhere, extensive experimentation related to the measurement principles and implementation methods had to be performed. Based on the data acquired, a real-time ultrasound signal processing algorithm was designed, developed and tested. The testing results show that the software can be used to identify reliably the echoes from the boundaries between adjacent tissue layers of pig carcasses in order to calculate on-line the depths of fat and lean as pan of the process of automatic non-invasive pork grading.