Description Usage Arguments Details Author(s) References See Also Examples

Create colorful spectrograms from a single object of class `"Wave"`

.

This function works similarly as `spectro`

(`seewave`

package), with spectrogram data actually computed by `spectro`

. However, the 3D plot is generated by `persp3D`

(`plot3D`

package).

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | ```
threeDspectro(
wave,
tlim = NULL,
flim = NULL,
samp.grid = FALSE,
plot.type = "surface",
x.length = 100,
y.length = 70,
lwd = 0.1,
plot.exp = FALSE,
log.scale = FALSE,
cex = 0.5,
cex.axis = 0.5,
cex.lab = 0.9,
cex.main = 1,
store.at = NULL,
plot.as = "jpeg",
color = seewave::spectro.colors(80),
f = 44100,
wl = 512,
ovlp = 70,
dBlevel = 30,
resfac = 1,
rotate.Xaxis = 60,
rotate.Yaxis = 40,
main = "Spectrogram 3D",
scalelab = expression("Amplitude (dB)"),
colkey = list(plot = TRUE, cex.clab = 0.8, cex.axis = 1, side = 4, length = 1, width
= 1, labels = TRUE, tick = TRUE, lty = 1, lwd = 1, lwd.ticks = 1)
)
``` |

`wave` |
an |

`tlim` |
modifications of the time limits (X-axis). Vector with two values in seconds. By default: |

`flim` |
modifications of the frequency limits (Y-axis). Vector with two values in kHz. By default: |

`samp.grid` |
a logical. If |

`plot.type` |
only applies when |

`x.length` |
only applies when |

`y.length` |
only applies when |

`lwd` |
only applies when |

`plot.exp` |
a logical. If |

`log.scale` |
only applies when |

`cex` |
only applies when |

`cex.axis` |
Similarly as in |

`cex.lab` |
Similarly as in |

`cex.main` |
Similarly as in |

`store.at` |
only applies when |

`plot.as` |
only applies when |

`color` |
Color palette to be used for the amplitude (Z-axis). Same default as |

`f` |
sampling frequency of |

`wl` |
length of the window for spectrogram calculation. By default: |

`ovlp` |
overlap between two successive windows (in %) for increased spectrogram resolution. By default: |

`dBlevel` |
absolute amplitude value to be used as relative background on 3D plot. Same as |

`resfac` |
resolution factor, in which an value > 1 will increase the resolution. Can be one value or a vector of two numbers, for the x and y values, respectively. |

`rotate.Xaxis` |
rotation of the X-axis. Same as |

`rotate.Yaxis` |
rotation of the Y-axis. Same as |

`main` |
main title of output plot. Should be presented between quotation marks. By default: |

`scalelab` |
Similarly as |

`colkey` |
Similarly as |

Similarly as `spectro`

(`seewave`

package), any colour pallete can be used to describe the amplitude (Z-axis). Some suggestions: `seewave::temp.colors, seewave::spectro.colors, seewave::reverse.heat.colors, seewave::reverse.cm.colors, seewave::reverse.topo.colors, grDevices::cm.colors, grDevices::grey.colors, grDevices::heat.colors, grDevices::topo.colors`

.

Pedro Rocha

MacLeod, N., Krieger, J. & Jones, K. E. (2013). Geometric morphometric approaches to acoustic signal analysis in mammalian biology. *Hystrix, the Italian Journal of Mammalogy, 24*(1), 110-125.

Rocha, P. & Romano, P. (*in prep*) The shape of sound: A new `R`

package that crosses the bridge between Bioacoustics and Geometric Morphometrics.

`spectro`

, `seewave`

, `eigensound`

, `align.wave`

, `persp3D`

, `plot3D`

, `align.wave`

Useful links:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | ```
# As simple as this
threeDspectro(centralis)
threeDspectro(cuvieri)
threeDspectro(kroyeri)
# Controling some arguments
threeDspectro(cuvieri, tlim=c(0, 0.5), flim=c(0, 4))
threeDspectro(cuvieri, tlim=c(0, 0.5), flim=c(0, 4), samp.grid=FALSE)
threeDspectro(cuvieri, tlim=c(0, 0.5), flim=c(0, 4), samp.grid=FALSE, dBlevel=60)
# Try different colors
threeDspectro(cuvieri, color=seewave::reverse.terrain.colors(80),
samp.grid=FALSE, tlim=c(0, 0.5), flim=c(0, 4))
threeDspectro(cuvieri, color=seewave::reverse.cm.colors(80),
samp.grid=FALSE, tlim=c(0, 0.5), flim=c(0, 4))
threeDspectro(cuvieri, color=grDevices::heat.colors(80),
samp.grid=FALSE, tlim=c(0, 0.5), flim=c(0, 4))
# Rotation
threeDspectro(cuvieri, tlim=c(0, 0.5), flim=c(0, 4), rotate.Xaxis=40, rotate.Yaxis=50)
# Export your graph
threeDspectro(cuvieri, plot.exp=TRUE, store.at=tempdir(), tlim=c(0,0.5), flim=c(0,4))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.