Learn R Programming

seewave (version 2.1.6)

deletew: Delete a section of a time wave

Description

This function selects and delete a section of data describing a time wave. Original section and section after deletion can be plotted as oscillograms for comparison.

Usage

deletew(wave, f, channel = 1, from = NULL, to = NULL, choose = FALSE, plot = FALSE,
marks = TRUE, output = "matrix", ...)

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

from

start position (in s).

to

end position (in s).

choose

logical, if TRUE start (=from) and end (=to) points can be graphically chosen with a cursor on the oscillogram.

plot

logical, if TRUE returns an oscillographic plot of original and cut sections (by default FALSE).

marks

logical, if TRUE shows the start and end mark on the plot (by default TRUE).

output

character string, the class of the object to return, either "matrix", "Wave", "Sample", "audioSample" or "ts".

other oscillo graphical parameters.

Value

If plot is FALSE, a new wave is returned. The class of the returned object is set with the argument output.

Details

If plot is TRUE returns a two-frame plot with both original and resulting sections.

See Also

oscillo, addsilw,cutw, fadew, mutew, pastew, revw, zapsilw

Examples

Run this code
# NOT RUN {
# deletion a 0.4 s section in a bird song
data(tico)
a<-deletew(tico,f=22050,from=0.5,to=0.9)
oscillo(a,22050)
# a direct way to see what has been cut
deletew(tico,f=22050,from=0.5,to=0.9,plot=TRUE)
# }

Run the code above in your browser using DataLab