Learn R Programming

PAMmisc

PAMmisc is a collection of random utility functions that might be useful for anyone working in passive acoustics. If you have any useful tools you'd like to add, please contact Taiki Sakai: taiki.sakai@noaa.gov.

Installation

Install the latest version from GitHub:

# make sure you have Rtools installed
if(!require('devtools')) install.packages('devtools')
# install from GitHub
devtools::install_github('TaikiSan21/PAMmisc')

Functions

  • writeClickWave - Create synthetic delphinid click wav files

  • writeAMWave - Create synthetic amplitude modulated wav files

  • decimateWavFiles - Decimate .wav files to a new sample rate and write them

to a new folder. Works on either a single .wav file or an entire folder. Currently only works with single channel data, if multi-channel wav files are fed in it will only process and output the first channel.

  • squishList - A utility for compressing a list that has elements with the same

name. See examples.

  • peakTrough - Find multiple peaks and the troughs / valleys between those peaks

in the spectrum of a click. Also has a plotting feature so that you can easily see the values being chosen as peaks / troughs in the spectrum and adjust the search parameters. See help file for algorithm details.

  • wignerTransform - Compute the Wigner-Ville transform of a signal, and optionally

plot the result. This will zero-pad the input signal to the next power of two, and the result is an NxN matrix where N is the zero-padded length. Returns a list with the NxN matrix, as well as the values for the time and frequency axes.

  • addPgEvent - Add a new Event to a Pamguard database. Provide the database to

add the event to, the UIDs of the individual detections for this event, the binary files that these detections are found in, and an "eventType" name for the event. Existing events cannot be added to, so all detections for an event must be added at the same time. This function should only add to an existing database, it will not modify or remove existing entries in the database.

  • addPgGps - Add a gpsData table to a Pamguard database. Gps source can either be

a dataframe, SPOT csv file, or SPOT gpx file, or csv file with UTC, Longitude, and Latitude

  • Environmental data fetching functions to be described later

TODO

Rework decimateWavFiles to work with multi-channel data.

Copy Link

Version

Install

install.packages('PAMmisc')

Monthly Downloads

540

Version

1.12.4

License

GNU General Public License

Maintainer

Taiki Sakai

Last Published

February 24th, 2025

Functions in PAMmisc (1.12.4)

fastReadWave

Load Wave File
plotPresBar

plotPresBar
getEdinfo

Browse a List of Curated Environmental Datasets
formatURL

Format URL for Environmental Data Download
pwelch

Estimate Power Spectral Density Using Welch's Method
peakTrough

Find Peaks and Troughs in a Spectrum
soundtrapQAQC

Perform QA/QC on Soundtrap Files
raytrace

Raytrace Through a Soundspeed Profile
updateUID

Update Detection UIDs
varSelect

Utility for Selecting Variables to Download
matchEnvData

Match Data From an Existing Netcdf File or Download and Match
straightPath

Mark Straight Path Segments in GPS Track
trainSplitPermute

trainSplitPermute
hycomList

A list of edinfo objects from HYCOM data sources
readSpecAnno

Read Pamguard Spectrogram Annotation Table
readGPXTrack

Read Tracks from a GPX File
plotPresGrid

plotPresGrid
squishList

Compress a List by Name
wignerTransform

Calculate the Wigner-Ville Transform of a Signal
writeClickWave

Write Click Waveform
writeAMWave

Write Amplitude Modulated Waveform
browseEdinfo

Browse a List of Environmental Datasets
addPgGps

Add GPS to a Pamguard Database
edinfoToURL

Create a URL for Downloading Data from a edinfo Object
dataToRanges

Create List of the Ranges of Coordinates
addPgAnno

Add Spectrogram Annotations to Pamguard Database
createSSP

Create Sound Speed Profiles
addPgEvent

Add Pamguard Event to Database
erddapList

A list of edinfo objects from ERDDAP data sources
downloadEnv

Download Environmental Data
decimateWavFiles

Decimate Wave Files
erddapToEdinfo

Create an edinfo Object from an ERDDAP Dataset Id
getFigshareInfo

getFigshareInfo
findEchoTimes

Find Estimated Echo Times
ncToData

Match Data From a Netcdf File