12
$\begingroup$

I need to include spectrograms in a manuscript and was wondering what peoples' preferred R packages/code settings/etc. were for high-quality spectrogram plots? I know there are a bunch of options in terms of R packages, e.g., signal, seewave, warbleR and then tons of different spectrogram plotting options for each; what are your preferences? Even down to things like palettes/color scales, etc. Obviously exact spectrogram settings will be dependent on the specific signal, but I'm more thinking about like the plotting settings for spectrogram functions in the aforementioned packages. Any insights on this would be much appreciated!

$\endgroup$

1 Answer 1

5
$\begingroup$

Here are the spectrogram settings I have come to like the best (for a synthetic rainforest rocket frog call):

library(seewave)
library(viridis)

spectro(Rf_synth,
        wl = 512,
        ovlp = 90,
        osc = TRUE,
        grid = FALSE,
        palette = turbo,
        coly0 = "black",
        collevels = seq(-30, 0, 0.5),
        heights = c(1,1),
        flim = c(5, 8),
        tlim = c(0, 0.2))
rug(x = seq(5, 8 ,0.1), ticksize = 0.01, side = 2)

Like you say, windows lengths and overlaps will depend on your signal. The colours in the 'viridis' library are color-blind friendly, and 'turbo' looks the best in my opinion ('magma' or 'inferno' are also visually pleasant, in my opinion). The rug() function just add little ticks on the frequency axis. It looks like this:

Spectrogram of synthetic Silverstoneia flotator note

I would like very much to see other people's spectrograms and settings too!

$\endgroup$
1
  • 1
    $\begingroup$ Are you using these same settings for other signals? Especially those that might be longer in duration and cover broader frequency bands? I'm trying to figure out the same thing as Carly but primarily focusing on soundscape-level recordings $\endgroup$
    – dtsavage
    Nov 2, 2022 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.