|
6 | 6 | "source": [
|
7 | 7 | "# Analyzing Passive Acoustic Data with MHKiT\n",
|
8 | 8 | "\n",
|
9 |
| - "The following example illustrates how to read and analyze some basic parameters for passive acoustics data. Functionality to analyze .wav files recorded using hydrophones has been integrated into MHKiT to support analysis based on the IEC-TS 62600-40 standard.\n", |
| 9 | + "The following example illustrates how to read and analyze some basic parameters for passive acoustics data. Functionality to analyze .wav files recorded using hydrophones has been integrated into MHKiT to support analysis based on the IEC TS 62600-40 standard.\n", |
10 | 10 | "\n",
|
11 | 11 | "The standard workflow for passive acoustics analysis is as follows:\n",
|
12 | 12 | "\n",
|
|
133 | 133 | "\n",
|
134 | 134 | "After the .wav file is read in, either in units of pressure or voltage, we calculate the mean square sound pressure spectral density (SPSD) of the timeseries using `sound_pressure_spectral_density`. This splits the timeseries into windows and uses fast Fourier transforms to convert the raw measurements into the frequency domain, with units of $Pa^2/Hz$ or $V^2/Hz$, depending on the input. The function takes the original datafile, the hydrophone's sampling rate (\"fs\"), which is stored as an attribute of the measurement timeseries, and a window size (\"bin_length\") in seconds as input.\n",
|
135 | 135 | "\n",
|
136 |
| - "The IEC-40 considers an acoustic sample to have a length of 1 second, so we'll set the bin length as such here." |
| 136 | + "The IEC TS 62600-40 considers an acoustic sample to have a length of 1 second, so we'll set the bin length as such here." |
137 | 137 | ]
|
138 | 138 | },
|
139 | 139 | {
|
|
152 | 152 | "source": [
|
153 | 153 | "### Applying Calibration Curves\n",
|
154 | 154 | "\n",
|
155 |
| - "For conducting scientific-grade analysis, it is critical to use calibration curves to correct the SPSD calculations. Hydrophones should be calibrated (i.e., a sensitivity calibration curve should be generated for a hydrophone) every few years. The IEC-40 asks that a hydrophone be calibrated both before and after the test deployment.\n", |
| 155 | + "For conducting scientific-grade analysis, it is critical to use calibration curves to correct the SPSD calculations. Hydrophones should be calibrated (i.e., a sensitivity calibration curve should be generated for a hydrophone) every few years. The IEC TS 62600-40 asks that a hydrophone be calibrated both before and after the test deployment.\n", |
156 | 156 | "\n",
|
157 | 157 | "A calibration curve consists of the hydrophone's sensitivity (in units of $dB$ rel $1$ $V^2/uPa^2$) vs frequency and should be applied to the spectral density we just calculated.\n",
|
158 | 158 | "\n",
|
|
235 | 235 | "cell_type": "markdown",
|
236 | 236 | "metadata": {},
|
237 | 237 | "source": [
|
238 |
| - "Now that the SPSDL is calculated, we can create spectrograms, or waterfall plots, using the `plot_spectrogram` function in the graphics submodule. While spectrograms aren't required by the IEC-40, they are useful to do quality control so we can avoid using contaminated soundbytes in further analysis (like the boat noise shown in this one).\n", |
| 238 | + "Now that the SPSDL is calculated, we can create spectrograms, or waterfall plots, using the `plot_spectrogram` function in the graphics submodule. While spectrograms aren't required by the IEC TS 62600-40, they are useful to do quality control so we can avoid using contaminated soundbytes in further analysis (like the boat noise shown in this one).\n", |
239 | 239 | "\n",
|
240 |
| - "To do this, we'll give the function the minimum and maximum frequencies to plot, as well as keyword arguments supplied to the matplotlib `pcolormesh` function. For these measurements, we're setting fmin = 10 Hz, the minimum specified by the IEC-40, and fmax = 48,000 Hz, the Nyquist frequency for these data. \n", |
| 240 | + "To do this, we'll give the function the minimum and maximum frequencies to plot, as well as keyword arguments supplied to the matplotlib `pcolormesh` function. For these measurements, we're setting fmin = 10 Hz, the minimum specified by the IEC TS 62600-40, and fmax = 48,000 Hz, the Nyquist frequency for these data. \n", |
241 | 241 | "\n",
|
242 |
| - "Note, the IEC-40 requires a maximum frequency of 100,000 Hz, so a hydrophone capable of sampling faster than 200,000 Hz should be used for IEC testing." |
| 242 | + "Note, the IEC TS 62600-40 requires a maximum frequency of 100,000 Hz, so a hydrophone capable of sampling faster than 200,000 Hz should be used for IEC testing." |
243 | 243 | ]
|
244 | 244 | },
|
245 | 245 | {
|
|
315 | 315 | "cell_type": "markdown",
|
316 | 316 | "metadata": {},
|
317 | 317 | "source": [
|
318 |
| - "### IEC-40 Stats\n", |
| 318 | + "### IEC TS 62600-40 Stats\n", |
319 | 319 | "\n",
|
320 |
| - "The IEC-40 requires a few aggregate statistics for characterizing the sound of marine energy devices. For the first, the IEC-40 asks for plots showing the 25%, 50%, and 75% quantiles of the SPSDL during specific marine energy device states. For current energy devices, the IEC-40 requires 10 SPSDL samples at a series of turbine states (braked, freewheel, 25% power, 50% power, 75% power, 100% power). For wave energy devices, the spec requires 30 SPSDL samples in each wave height and period bin observed.\n", |
| 320 | + "The IEC TS 62600-40 requires a few aggregate statistics for characterizing the sound of marine energy devices. For the first, the IEC TS 62600-40 asks for plots showing the 25%, 50%, and 75% quantiles of the SPSDL during specific marine energy device states. For current energy devices, the IEC TS 62600-40 requires 10 SPSDL samples at a series of turbine states (braked, freewheel, 25% power, 50% power, 75% power, 100% power). For wave energy devices, the spec requires 30 SPSDL samples in each wave height and period bin observed.\n", |
321 | 321 | "\n",
|
322 | 322 | "For this example notebook we'll keep it simple and use a random set of 30 samples and collate them together. Otherwise one can pick and choose which to use. Then we can find the median and quantiles of those 30 samples."
|
323 | 323 | ]
|
|
519 | 519 | "cell_type": "markdown",
|
520 | 520 | "metadata": {},
|
521 | 521 | "source": [
|
522 |
| - "Another plot that is useful for IEC-40 compliance are decidecade boxplots of the SPSDL. We can also use the aggregate methods to apply plotting functions, like matplotlib's native boxplot. In this case, we supply the \"map\" function and an iterable of the custom function inputs, in this case the figure axes we want to use to plot.\n", |
| 522 | + "Another plot that is useful for IEC TS 62600-40 compliance are decidecade boxplots of the SPSDL. We can also use the aggregate methods to apply plotting functions, like matplotlib's native boxplot. In this case, we supply the \"map\" function and an iterable of the custom function inputs, in this case the figure axes we want to use to plot.\n", |
523 | 523 | "\n",
|
524 | 524 | "This plot shows significant spread in sound measurements due to the vessel noise, with whiskers stretching to the 1st and 99th quantiles. Generally any significant spread in a frequency band is caused by sound generated by an external source, and not the ambient soundscape."
|
525 | 525 | ]
|
|
610 | 610 | "source": [
|
611 | 611 | "### Sound Pressure Level\n",
|
612 | 612 | "\n",
|
613 |
| - "The IEC-40 has two requirements considering calculations of sound pressure level (SPL). We'll first calculate the SPL over the full frequency range of the turbine and/or hydrophone. The IEC-40 asks that the range be set from 10 to 100,000 Hz, though the lower limit can be increased due to flow noise or low frequency signal loss due to shallow water. \n", |
| 613 | + "The IEC TS 62600-40 has two requirements considering calculations of sound pressure level (SPL). We'll first calculate the SPL over the full frequency range of the turbine and/or hydrophone. The IEC TS 62600-40 asks that the range be set from 10 to 100,000 Hz, though the lower limit can be increased due to flow noise or low frequency signal loss due to shallow water. \n", |
614 | 614 | "\n",
|
615 | 615 | "#### Shallow water cutoff frequency\n",
|
616 | 616 | "Low frequency sound is absorbed into the seabed in shallow water depths. We can use the function `minimum_frequency` to get an approximation of what our minimum frequency should be. This approximation uses the water depth, estimates of the in-water sound speed and sea/riverbed sound speed to determine what the cutoff frequency will be. The difficult part with this approximation is figuring out the speed of sound in the bed material, which generally ranges from 1450-1800 m/s. \n",
|
|
650 | 650 | "cell_type": "markdown",
|
651 | 651 | "metadata": {},
|
652 | 652 | "source": [
|
653 |
| - "Though the IEC-40 says we should default to a minimum frequency of 10 Hz, as you can see above, unless we're measuring from a depth of around 80 +/- 10 m, our minimum frequency should be higher. One can play around with the bed soundspeed to see how these change with varying bed densities/compositions." |
| 653 | + "Though the IEC TS 62600-40 says we should default to a minimum frequency of 10 Hz, as you can see above, unless we're measuring from a depth of around 80 +/- 10 m, our minimum frequency should be higher. One can play around with the bed soundspeed to see how these change with varying bed densities/compositions." |
654 | 654 | ]
|
655 | 655 | },
|
656 | 656 | {
|
|
713 | 713 | "source": [
|
714 | 714 | "### Decidecade Sound Pressure Levels\n",
|
715 | 715 | "\n",
|
716 |
| - "The last stat that IEC-40 requests are the decidecade SPLs. Note that the IEC-40 incorrectly labels these as synonymous with the third-octave SPLs, following the relevant (and also incorrect) ANSI specifications. \n", |
| 716 | + "The last stat that IEC TS 62600-40 requests are the decidecade SPLs. Note that the IEC TS 62600-40 incorrectly labels these as synonymous with the third-octave SPLs, following the relevant (and also incorrect) ANSI specifications. \n", |
717 | 717 | "\n",
|
718 |
| - "To explain, an octave is a frequency band where the upper frequency is double (2^1) that of the lower frequency. The one-third octave is a frequency band where the upper frequency is 2^(1/3) times the lower frequency. The decidecade is a frequency band with a bandwidth of 2^(1/10), which means it's the tenth octave, not the third. Wherever the IEC-40 says third octave they actually mean the decidecade band.\n", |
| 718 | + "To explain, an octave is a frequency band where the upper frequency is double (2^1) that of the lower frequency. The one-third octave is a frequency band where the upper frequency is 2^(1/3) times the lower frequency. The decidecade is a frequency band with a bandwidth of 2^(1/10), which means it's the tenth octave, not the third. Wherever the IEC TS 62600-40 says third octave they actually mean the decidecade band.\n", |
719 | 719 | "\n",
|
720 | 720 | "We can calculate the SPL in each decidecade band using the function `decidecade_sound_pressure_level`. This function uses the same calculation as `sound_pressure_level` above and runs it on each tenth octave band. It returns 1 SPL in each frequency band every timestamp, so our boxplots show 5 minutes worth of SPL measurements in each decidecade band. You'll notice a similar spread as in the SPSDL boxplots, especially in the upper quantile. Boats are loud."
|
721 | 721 | ]
|
|
0 commit comments