Learn R Programming

seewave (version 2.2.3)

oscilloEQ: Oscillogram 'equalizer'

Description

A multipanel plot of a time wave displaying the oscillogram of a bank of frequency filters like in an 'equalizer'.

Usage

oscilloEQ(wave, f, channel = 1, flim = NULL, colwave = 1,
xlab = "Time (s)", ylab = "Frequency band (kHz)",
cexlab = 1, collab = 1, fontlab = 1,
savedir = ".", plot = TRUE, ...)

Value

If plot is FALSE then a series of .wav files are saved. Each file corresponds to a frequency filter.

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).

flim

a numeric vector giving the ordered limites of the frequency filters to be applied. By default, 1 kHz frequency filters.

colwave

colour of the oscillogram.

xlab

label of the x axis.

ylab

label of the y axis.

cexlab

character size for axes labels.

collab

color for axes labels.

fontlab

font for axes labels.

savedir

the path were the .wav files will be stored if plot is FALSE. By default, the working directory.

plot

a logical, if TRUE a plot is created, if FALSE then a series of .wav files are saved. Each file corresponds to a frequency band.

...

other oscillo graphical parameters.

Author

Jerome Sueur

Details

The function applies a bank of filters as delimited with the argument flim. If plot is TRUE, then the function displays the wave on a multiframe plot so that the time*amplitude dynamics of each frequency filter can be estimated. The filtered waves are generated using the function fir. If plot is FALSE, then the corresponding waves are saved as separated .wav file. Each file corresponds to a frequency filter.

See Also

oscillo, oscilloST

Examples

Run this code
data(peewit)
## default 1 kHz frequency filter
oscilloEQ(peewit)
## change de frequency filter limits
oscilloEQ(peewit, flim=c(0, 4, 8, 10))
oscilloEQ(peewit, flim=seq(2, 10, by=0.5))
## play with colors
oscilloEQ(peewit, colwave=c(1,2))
oscilloEQ(peewit, colwave=heat.colors)
blue.gray  <- colorRampPalette(c("darkblue", "lightgrey"))
oscilloEQ(peewit, colwave=blue.gray)
## save files instead of visualizing them
if (FALSE) {
oscilloEQ(peewit, plot=FALSE)
}

Run the code above in your browser using DataLab