Learn R Programming

seewave (version 2.2.3)

scd: Soundcape chord diagram

Description

Computes and displays a chord diagram of a set of audio files or of a set segments extracted from a single audio file.

Usage

scd(input, f,  sl, wl = 512, wn = "hanning", ovlp = 0, flim = NULL,
rmoffset = TRUE, threshold = NULL, HCA = TRUE,
grid.col = terrain.colors, names, plot = TRUE, verbose = TRUE, ...)

Value

THe function returns a list of two items:

m

spectral similarity matrix

resHCA

the classification result of the HCA, if HCA is TRUE

Arguments

input

a character vector, either (i) the path to the directory where .wav files are stored, (ii) directly the names of the .wav files to be processed, or (iii) a single .wav file to be segmented by the duration set with the argument sl.

f

sampling frequency of wave (in Hz). Does not need to be specified if embedded in the .wav files contained in input.

sl

segment length in duration if input is a single file.

wl

window length for the analysis spectral (even number of points) (by default = 512).

wn

window name for the spectral analysis, see ftwindow (by default "hanning").

ovlp

overlap between two successive windows (in %) for the spectral analysis.

flim

a numeric vector of length 2 to select a frequency band (in kHz).

rmoffset

a logical to sepcify whether DC offset should be removed. By default TRUE.

threshold

a numeric value in ]0,1[ to be applied to the similarity distance. All similairty distances below this threshold will not depicted.

HCA

logical, if TRUE the sectors are colored according to clusters automatically obtained with a hierarchical cluster analysis (HCA).

grid.col

name of color palette to color the sectors and the links). By default terrain.colors.

names

names of the sectors, if empty then the names of the .wav files or the time stamps of the segments.

plot

logical, if TRUE plots the chord diagram.

verbose

logical, if TRUE prints the computation progress of the mean spectra.

...

other chordDiagram parameters.

Author

Adèle de Baudouin, Jérôme Sueur

Details

The soundscape chord diagram (SCD) aims at representing similarities between audio files or audio segments extracted from a single audio file. The mean frequency spectrum of each file/segment is computed using a STFT. These frequency spectra are then (1) pairwised compared using a similarity distance (see function diffcumspec, and (2) automatically clustered with a hierarchical cluster analysis (HCA) (see function HCPC of FactoMiner). The resulting similarity matrix is then given as an input to the function chordDiagram. The width of the sectors and the links are based on the spectral similarity matrix. The color of the sectors and the links follow the HCA classification.

References

de Baudouin, A, Couprie P, Michaud F, Haupert S, Sueur J -- Similarity visualization of nature and music soundscapes, in prep.

See Also

diffcumspec