Pretty close. In both cases sound waves are projected through the skin and soft tissues and bounce back. The result is an image of the structures underneath the skin. Ultrasound can be used to look at unborn babies, heart defects, tumors, and gallstones.
The frequency of the sound wave varies depending on its use and the tissue being examined. A broad-bandwidth frequency between five and 13 MHz (mega-hertz) is used to look at the rotator cuff around the shoulder. Extremely high frequency cleans dental and surgical tools.