Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

wasp

WAve length and SPeed of sound


Description

This function returns the wavelength and the speed of sound of a given frequency in air, fresh-water or sea-water.

Usage

wasp(f, t = 20, c = NULL, s = NULL, d = NULL, medium = "air")

Arguments

f

frequency (Hz).

t

temperature (degree Celsius).

c

celerity (m/s) if a wavelength is to be found at a particular speed of sound.

s

salinity (parts per thousand) when medium is "sea".

d

depth (m) when medium is "sea".

medium

medium for sound propagation, either "air", "fresh" for fresh, or pure, water, "sea" for sea water.

Details

Speed of sound in air is computed according to:

c = 331.4+0.6*t

Speed of sound in fresh-water is computed according to Marczak equation:

c = 1.402385e3+5.038813*t-(5.799136e-2)*t^2

+(3.287156e-4)*t^3-(1.398845e-6)*t^4

+(2.787860e-9)*t^5

with t = temperature in degrees Celsius; range of validity: 0-95 degrees Celcius at atmospheric pressure.

Speed of sound in sea-water is computed according to Mackenzie equation:

c = 1448.96+4.591*t-(5.304e-2)*t^2

+(2.374e-4)*t^3+1.34*(s-35)+(1.63e-2)*d

+(1.675e-7)*d^2-(1.025e-2)*t*(s-35)

-(7.139e-13)*t*d^3

with t = temperature in degrees Celsius; s = salinity in parts per thousand; d = depth in meters; range of validity: temperature 2 to 30 degrees Celcius, salinity 25 to 40 parts per thousand, depth 0 to 8000 m.

Wavelength is obtained following:

lambda = c/f

with c = speed of sound in meters/second; f = frequency in Hertz.

Value

A list of two values is returned:

l

wavelength in meters

c

speed of sound in meters/second.

Author(s)

Jerome Sueur sueur@mnhn.fr

References

Examples

# wavelength (m) of a 2000 Hz air-borne sound at 20 degrees Celsius
wasp(f=2000)$l
# [1] 0.1717

# sound speed in sea at 0 and -500 m
# for a respective temperature of 22 degrees Celcius and 11 degrees Celcius
wasp(f=1000,s=30,d=c(0,500),t=c(22,11),medium="sea")$c
# [1] 1521.246 1495.414

# wavelength (m) of a 1000 Hz sound in a medium unspecified where c = 1497 m/s
wasp(f=1000,c=1497)$l
# [1] 1.497

# variation of wavelength according to frequency and air temperature
op<-par(bg="lightgrey")
a<-seq(1000,20000,by=100) ; na<-length(a)
b<-seq(-20,40,by=10) ; nb<-length(b)
res<-matrix(numeric(na*nb),nrow=na)
for(i in 1:nb) res[,i]<-wasp(a,t=b[i])$l
matplot(x=a,y=res,type="l",lty=1,col= spectro.colors(nb),
  xlab="Frequency (Hz)",ylab="Wavelength (m)")
title("Wavelength of air-borne sound at different temperatures (deg. C)")
legend(x=15000,y=0.3,c("-20","-10","0","10","20","30","40"),
  lty=1,col= spectro.colors(nb),bg="grey")
par(op)

seewave

Sound Analysis and Synthesis

v2.1.6
GPL (>= 2)
Authors
Jerome Sueur <sueur@mnhn.fr> [cre, au], Thierry Aubin [au], Caroline Simonis [au], Laurent Lellouch [main ctrb], Ethan C. Brown [ctrb], Marion Depraetere [ctrb], Camille Desjonqueres [ctrb], Francois Fabianek [ctrb], Amandine Gasc [ctrb], Eric Kasten [ctrb], Stefanie LaZerte [ctrb], Jonathan Lees [ctrb], Jean Marchal [ctrb], Andre Mikulec [ctrb], Sandrine Pavoine [ctrb], David Pinaud [ctrb], Alicia Stotz [ctrb], Luis J. Villanueva-Rivera [ctrb], Zev Ross [ctrb], Carl G. Witthoft [ctrb], Hristo Zhivomirov [ctrb].
Initial release
2020-06-28

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.