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)
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)
Change frequency limits
template <- makeCorTemplate('btnw.wav', frq.lim = c(3, 7))
plot(template)
Change selection density
template <- makeCorTemplate('btnw.wav', dens = 0.4)
plot(template)
Change FFT parameters
template <- makeCorTemplate('btnw.wav', wl = 1024, ovlp = 75)
plot(template)
Change template name
template <- makeCorTemplate('btnw.wav', name='btnw_typeB_5kHz')
plot(template)
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)