View on GitHub Report a bug

monitoR

spectrogram cross-correlation, binary point matching, and manual annotation in R

Making Spectrogram Cross-correlation Templates

These examples explore function arguments. You can also read the article.

Get clip, write to file

data(btnw)
tuneR::writeWave(btnw, 'btnw.wav')

Automatic point selection

Automatic is the default because it does not require interactivity and allows the package vignette and examples to build. In general use it is unlikely that users will build the most effective templates with the “auto” option.

template <- makeCorTemplate('btnw.wav')
plot(template)

plot of chunk example1_2plot of chunk example1_2

Change select to ‘rectangle’

template <- makeCorTemplate('btnw.wav', select='rectangle')

Change select to ‘cell’

template <- makeCorTemplate('btnw.wav', select='cell')

Change time limits

template <- makeCorTemplate('btnw.wav', t.lim = c(0.75, 2.25))
plot(template)

plot of chunk corExample2plot of chunk corExample2

Change frequency limits

template <- makeCorTemplate('btnw.wav', frq.lim = c(3, 7))
plot(template)

plot of chunk corExample3plot of chunk corExample3

Change selection density

template <- makeCorTemplate('btnw.wav', dens = 0.4)
plot(template)

plot of chunk corExample5plot of chunk corExample5

Change FFT parameters

template <- makeCorTemplate('btnw.wav', wl = 1024, ovlp = 75)
plot(template)

plot of chunk corExample6plot of chunk corExample6

Change template name

template <- makeCorTemplate('btnw.wav', name='btnw_typeB_5kHz')
plot(template)

plot of chunk corExample6_1plot of chunk corExample6_1

Combine templates

template1 <- makeCorTemplate('btnw.wav', name='btnw_typeB_5kHz')
template2 <- makeCorTemplate('btnw2.wav', name='btnw_typeB_5.8kHz')
templates <- combineCorTemplates(template1, template2)
plot(templates, ask=FALSE)

plot of chunk corExample9_1plot of chunk corExample9_1