Learn R Programming

seewave (version 2.1.6)

specflux: Spectral flux

Description

Compute spectral flux

Usage

specflux(wave, f, channel = 1,
         wl = 512, ovlp = 0, wn = "rectangle", flim = NULL,
         norm = FALSE,  p = 2,
         plot = TRUE, xlab = "Times (s)", ylab = "Flux", type = "l", ...)

Arguments

wave

an R object.

f

sampling frequency of wave (in Hz). Does not need to be specified if embedded in wave.

channel

channel of the R object, by default left channel (1).

wl

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

ovlp

overlap between two successive windows (in %).

wn

window name, see ftwindow (by default "rectangle").

flim

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

norm

if is TRUE then the normalised spectra are used. The spectra are normalised by their sum.

p

the norm type, by default = 2.

plot

logical, if TRUE the spectral flux is displayed against time (s) (by default TRUE).

xlab

title of the x axis.

ylab

title of the y axis.

type

if plot is TRUE, type of plot that should be drawn. See plot for details (by default "l" for lines).

other plot parameters.

Value

When plot is FALSE, specflux returns a two-column matrix, the first column being time in seconds (x-axis) and the second column being the spectral flux (y-axis) computed along time.

Details

The spectral flux (\(F\)) is the sum of the time (\(t\)) derivative of the columns -- that is the successive spectra -- (\(s\)) of the normalized short-term Fourier transform (\(z\)). F is then computed according to: $$F = (\sum |s(t+1) - s(t)|^{p})^{\frac{1}{p}}$$

References

Scheirer E, Slaney M (1997). Construction and evaluation of a robust multifeature speech/music discriminator. IEEE International Conference on Acoustics, Speech, and Signal Processing, 2, 1221-1224.

See Also

spectro, ACI

Examples

Run this code
# NOT RUN {
## default use
data(tico)
specflux(tico)
## norm 1
specflux(tico, p = 1)
## frequency limit between 2 and 4 kHz
specflux(tico, flim = c(2,4))
## index computation
sum(specflux(tico, plot=FALSE)[,2])
# }

Run the code above in your browser using DataLab