### Bring the noise - for school! dBSea as a teaching tool.

dBSea can serve as a great tool for learning acoustics. It is safer, faster, cheaper and easier than going out to sea to do actual measurements. (The field biologist in me hated that sentence). But truth is that for preparing to got out in the field, or for understanding what factors affect a sound field, dBSea can provide that link between formulated theory and output that greatly increases understanding for many of us.
(If you're not involved in teaching/facilitating read on anyway, as I present a couple of nifty tricks in dBSea).

For basic acoustics the complicated bathymetry, clines and currents of the real world can be too irregular for showing simpler correlations between e.g. speed of sound and salinity or pressure.

First I want an open (uncomplicated) field for my testing, so I made a BIG open volume of water.

_____________________________________________

# Simple csv generator.

# Create matrix with value "10,000" at 1000 by 1000 places in matrix
# A big puddle of 10km*1km*1km
Depth_model=matrix(10000,1000,1000)

write.table(Depth_model, file="file location", sep=",", row.names=FALSE, col.names=FALSE)
# using "write.table" instead of "write.csv" gives more control over titles.

# File will be ~5Mb, 1000*1000=1,000,000 positions in matrix
_____________________________________________

(Update 23/09/2015)
I've learned that for simple open spaces there's a simpler way than to create it in R.
Just create a ten by ten matrix of the desired depth in a spreadsheet and save it as .csv.
After importing this to dBSea, set the scale as desired, and dBSea will extrapolate.
You learn something new (from your programmer friend) every day...

In other words this'll be another one of my more techy posts...

The created csv file is "only" 1 x 1 km, not really big enough, but as a bigger csv will be slow, and take up a lot of space (10 km x 10 km would be ~500Mb), we'll make do.
 Figure 1. Press "New" in upper left corner, and then "Load Bathymetry" in the right panel.
After import in dBSea press the "Set World Scale" button in the "Setup Project" page, and set the diagonal to sqrt(1,000,000^2+1,000,000^2)=1,414,214 m. This will give you a working area of 1,000 km^2
 Figure 2. Set the world scale via "Set From Diagonal".
I want to have a look at what frequency-dependent attenuation looks like as different frequencies are dampened/absorbed at different rates. I've used the probe function to export the frequency spectra from different distances, to try and get a better (more intuitive) view on this. Here could be a wonderful spring board for talking about relaxation frequencies of boric acid and magnesium sulphide
 Figure 3. Left, a spectrum of a flat 100dB noise from 7.5 km away, notice how higher frequencies are greatly attenuated. In the plot on the bottom right the contributors to attenuation are shown individually, with the dBSea graph shown above it..
This data can be extracted using the "Table to Clipboard" button in the "Probe" menu shown in Figure 3. When plotted in e.g. excel one can see the result of the frequency-specific attenuation (Figure 4). It is immediately clear that the high-frequency part of the noise doesn't make it very far compared to the lower frequencies
 Figure 4. Frequency content with increasing distance from source (100 dB flat spectrum). Notice that frequency and distance axes are logarithmic. The two plots represent the same data but while the left plot gives an intuitive understanding of how each 3rd octave band is attenuated with distance, the right plot shows the frequency content of the noise at a given distance.
The clever reader might notice that there's not a 6 dB decline in sound pressure level (SPL) per doubling of distance in the above figure. This is due to me using an approximate line source (see Figure 2) instead of a point source. For line sources SPL only decreases 3 dB per doubling of distance (in the actual plot we only see a decrease of 2 dB per doubling of distance, this is due to reflections from surface and bottom).

This was a very brief post, but notice that it included a bit of both programming (R), chemistry and physics. Doing this as an exercise for students forces them to understand the principles involved, but also introduces them to transferring data between platforms (R, dBSea and spreadsheet software), a genuinely very useful skill.

To be continued...