image thumbnail

Calculate the harmonic mean sound speed through a profile

version (2.95 KB) by Val Schmidt
Given a vertical sound speed profile, calculate the harmonic mean speed of sound to some depth.


Updated Wed, 03 Jun 2020 15:57:00 +0000

View License

In ocean acoustics one often wants to calculate the distance a sound pulse will travel in a given amount of time. When the pulse is sent directly down, we can neglect the effect of refraction of the sound pulse and need only consider the mean sound speed. Dividing the mean sound speed by the travel time gives the distance the pulse traveled. [This is the calculation that must be performed when operating a single-beam echo-sounder directed vertically down into the water column. The two-way travel time must be divided by two first.]

Suppose one is given a sound speed profile (sound speeds [ssp] and the associated depths [z] at which they were measured.). Most will realize that one cannot simply average the sound speeds to obtain the proper mean sound speed for this calculation. However many will incorrectly assume that a depth-weighted mean sound will produce the correct answer.
Unfortunately it does not.

One must instead divide the total depth by the sum of the time it takes
to the sound to pass through each layer of constant sound speed. This is
called the 'harmonic mean'. Given a sound speed profile and a depth to which to consider, sndsped_mean.m performs this calculation.

Cite As

Val Schmidt (2022). Calculate the harmonic mean sound speed through a profile (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!