wf {seewave} | R Documentation |
This function returns a waterfall display of a short-term Fourier transform or of any matrix.
wf(wave, f = NULL, wl = 512, zp = 0, ovlp = 0, wn = "hanning", x = NULL, hoff = 1, voff = 1, col = heat.colors, xlab = "Frequency (kHz)", ylab = "Amplitude (dB)", xaxis = TRUE, yaxis = TRUE, density = NULL, border = NULL, lines = FALSE, ...)
wave |
a vector , a matrix (first column),
an object of class ts , Sample (left channel),
or Wave (left channel). |
f |
sampling frequency of wave (in Hz).
Does not need to be specified if wave is an object of class ts ,
Sample , or Wave . |
wl |
window length for the analysis (even number of points). (by default = 512) |
zp |
zero-padding (even number of points), see Details . |
ovlp |
overlap between two successive windows (in %). |
wn |
window name, see ftwindow (by default "hanning" ). |
x |
a matrix if wave is not provided. |
hoff |
horizontal 'offset' which shifts actual x-values slightly per row for visibility. Fractional parts will be removed. |
voff |
vertical 'offset' which separates traces. |
col |
a color or a color palette function to be used to assign colors in the plot |
xlab |
title of the frequency x-axis. |
ylab |
title of the amplitude y-axis. |
xaxis |
a logical, if TRUE adds the frequency x-axis
according to f . |
yaxis |
a logical, if TRUE adds the amplitude y-axis
according. |
density |
argument of polygon :
the density of shading lines, in lines per inch. The default
value of 'NULL' means that no shading lines are drawn. A zero
value of 'density' means no shading nor filling whereas
negative values (and 'NA') suppress shading (and so allow
color filling). |
border |
argument of polygon :
the color to draw the border. The default, 'NULL', means to
use 'par("fg")'. Use 'border = NA' to omit borders. |
lines |
a logical, if TRUE plots lines instead of surfaces
(polygons). |
... |
other graphical arguments to passed to plot |
Data input can be either a time wave (wave
) or a matrix
(x
). In that case, if xaxis
is set to TRUE
the
x-axis will follow the row index. To change it, turn xaxis
to
FALSE
and use axis
afterwards. See examples.
The function is well adapted to display short-term Fourier
transform. However, any matrix can be called using the argument
x
instead of wave
.
Carl G. Witthoft and Jerome Sueur sueur@mnhn.fr
data(tico) wf(tico,f=22050) # changing the display parameters jet.colors <- colorRampPalette(c("blue", "green")) wf(tico,f=22050, hoff=0, voff=2, col=jet.colors, border = NA) # matrix input instead of a time wave and transparent lines display m <- numeric() for(i in seq(-pi,pi,len=40)) {m <- cbind(m,10*(sin(seq(0,2*pi,len=100)+i)))} wf(x=m, lines=TRUE, col="#0000FF50",xlab="Time", ylab="Amplitude", main="waterfall display")