wasp {seewave} | R Documentation |
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 |
d |
depth (m) when |
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:
Speed of sound in fresh-water is computed according to Marczak equation:
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:
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:
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)