Sonar uses sound waves in order to detect and locate objects in the water. The speed and detectable range of sound waves are impacted by the medium they are travelling through. Ocean water, the medium that sonar travels through, includes characteristics such as temperature, density, and salinity. These elements affect the nature of the medium, and thus affect the sound waves used for sonar detection.