-
Notifications
You must be signed in to change notification settings - Fork 0
Home
What: Automatic acoustic energy detector for fin whale 20 Hz calls.
How: Calculates the difference in acoustic energy between the signal (22 Hz) and background noise levels (average energy between 10 and 34 Hz) from a long-term spectral average (LTSA) in Triton.
Why: Manual or automatic detection of fin whale 20 Hz calls is difficult when many animals are calling in an area at the same time. The calls overlap and it can be impossible to determine where one call ends and another begins. Because the calls appear as a band of energy, we detect average fin whale acoustic energy instead of individual calls.
Output: an XML file with the average ratio for each day of the timeseries.
- MATLAB basics
- Opening LTSAs in Triton
- MATLAB2013b or 2016b
- Triton
- XMLFin3PowerDetectDay.m
- Multiple_LTSA_daily_avg_calc.m
The TF will correspond to the particular preamplifier used during the deployment being analyzed. To identify the appropriate TF, check the deployment log and find out which preamp was used in the deployment:
-
Go to the shared google drive and locate the correct deployment sheet in MBARC_DeploymentMetadata
-
Go to the appropriate project, site, and deployment and download the deployment sheet.
💡 Tip: It's a good idea to compare the deployment and recovery sheets to make sure the Preamp S/Ns match
-
Open the deployment sheet and find the Preamp S/N (typically on the top right of the sheet)
-
Go to the shared google drive and locate the correct TF in MBARC_TF
-
Download the .tf file (with a name like 844_111028_invSensit.tf, where 844 is the preamp number you want) onto your machine
-
Start MATLAB
-
Add Triton, XMLFin3PowerDetectDay.m, and Multiple_LTSA_daily_avg_calc.m to your path
-
Open XMLFin3PowerDetectDay and modify as necessary
- Line 18: userid
- Line 29: output path (be sure to use double backslashes here)
- Line 33: output filename
- Line 57: path and filename of TF
- Lines 104-106: project, site, and deployment
-
Start Triton
-
Load appropriate LTSA
Now that you have your TF and have modified the code for the dataset you want to detect calls in, you're ready to run the detector!
-
Check that the LTSA is at the true start of the recording (not the start of the file where there may be data from a deck test)
-
Run XMLFin3PowerDetectDay.m (may take a minute or so to execute)
-
When finished, a line plot will appear with 20 Hz index values from the LTSA timeseries and file start and times will appear in the command window. Verify that this output makes sense.
- If output end time does not match the file end time, there may be a gap in the data. If you can locate this gap you can run the detector again (after changing the output file name!) starting just after the gap
- You may have to iterate the process above multiple times if there are multiple gaps
- The calculation for the last day’s acoustic index before the break may be off, so you should do one run with just the data for that day. Change the output filename appropriately and comment out line 124 and comment in line 121, where you will switch out number 2 for [number of fractional hours in that day with data]/2 (assuming your LTSA plot length is 2 h; if it’s 1 h, you don’t need to divide)
-
Repeat steps 1-3 for all LTSAs in the deployment
If you get the error
Undefined function or variable 'Detections'
make sure MATLAB is looking in the right place for nilus.jar by modifying your javaclasspath. If you don't know what nilus.jar is, follow the set up directions for the Bm-Bcall-Detector.
-
Open output files in your favorite XML editor (Notepad++ should work well)
-
Verify that deployment information (project, site, deployment #) and start/end dates look correct
-
If the deployment did not start at 00:00:00, change the start time of the first detection to match the deployment start time
-
If the deployment was broken up into multiple LTSAs, follow the steps below to adjust the start/end times between output files
-
If desired, your detections can now be uploaded to the Tethys database
If the deployment was broken up into multiple LTSAs, it is likely the output XML do not end on an even day. Since fin whale detection values are supposed to be daily averages, you will need to modify the index values for the last day and effort end time in files 1:(N-1), and you will need to modify effort start time and delete the first detection entry in files 2:N.
Example: If you have 2 LTSAs you had to run for a deployment and the first one ended on July 2, 2018 at 12:00:00, your XML output for that LTSA would have a final detection day that starts on July 2, 2018 at 00:00:00 and has and average index value for the day. However, when you run the next LTSA, the XML output for that LTSA will start on July 2, 2018 at 12:00:00 and will also have an index value for the day. We want to combine these two index values to be one value for July 2, 2018 and we want it to be the last detection in the first XML output file.
For each XML file:
-
Open Multiple_LTSA_daily_avg_calc.m
-
Type
format long
in the command window to see all the digits of the score in the next step -
Use the provided formula to calculate the appropriate index value for the last detection day in that section by averaging the bit that is in the next LTSA (let’s call it V2) with the value here (V1) as a weighted average. That formula is:
[(V1 * time) + (V2 * (24 - time))] / 24
where time is the time when the two files were split
-
Change file effort end time to 23:59:59 on the last day
-
In the next file, delete Detection entry for the first day
-
Change effort start time to the following day at 00:00:00