Skip to contents

This function generates a 3D surface plot of a spectrogram from an audio wave object. It uses a fixed frequency resolution and allows setting a minimum amplitude threshold for the plot. Optionally, a cutoff plane can be added to the plot for better visualization of the amplitude floor.

Usage

spectrogram_3d(
  wave,
  freq.res = 100,
  min.amp = -60,
  add.cutoff = NULL,
  plot.title = NULL
)

Arguments

wave

A wave object (imported with the tuneR package) containing the audio data to be analyzed.

freq.res

Numeric value indicating the frequency resolution in Hz. Default is 100 Hz.

min.amp

Numeric value representing the minimum amplitude (in dB) to display. Amplitudes lower than this value will be clipped. Default is -60 dB.

add.cutoff

Optional numeric value specifying an amplitude cutoff plane to be added to the plot. If NULL, no cutoff plane is added.

plot.title

Optional string to set a custom title for the plot. If NULL, no title is added.

Value

A plotly object representing the 3D surface plot of the spectrogram.

Examples

# Assuming 'wave' is a wave object:
spectrogram_3d(wave, freq.res = 100, min.amp = -60, add.cutoff = -40, plot.title = "3D Spectrogram")
#> Error: object 'wave' not found