pwelch is for single signal trace only; mv_pwelch
is for multiple traces. Currently mv_pwelch is experimental and
should not be called directly.
pwelch(
x,
fs,
window = 64,
noverlap = 8,
nfft = 256,
col = "black",
xlim = NULL,
ylim = NULL,
main = "Welch periodogram",
plot = 0,
log = c("xy", "", "x", "y"),
...
)# S3 method for pwelch
print(x, ...)
# S3 method for pwelch
plot(
x,
log = c("xy", "x", "y", ""),
se = FALSE,
xticks,
type = "l",
add = FALSE,
col = graphics::par("fg"),
col.se = "orange",
alpha.se = 0.5,
lty = 1,
lwd = 1,
cex = 1,
las = 1,
main = "Welch periodogram",
xlab,
ylab,
xlim = NULL,
ylim = NULL,
xaxs = "i",
yaxs = "i",
xline = 1.2 * cex,
yline = 2 * cex,
mar = c(2.6, 3.8, 2.1, 0.6) * (0.5 + cex/2),
mgp = cex * c(2, 0.5, 0),
tck = -0.02 * cex,
grid = TRUE,
...
)
mv_pwelch(x, margin, fs, nfft)
A list with class 'ravetools-pwelch' that contains the
following items:
freqfrequencies used to calculate the 'periodogram'
specresulting spectral power for each frequency
windowwindow function (in numerical vector) used
noverlapnumber of overlapping time-points between two adjacent windows
nfftnumber of basis functions
fssample rate
x_leninput signal length
methoda character string 'Welch'
'pwelch' instance returned by pwelch function
sample rate, average number of time points per second
window length in time points, default size is 64
overlap between two adjacent windows, measured in time points; default is 8
number of basis functions to apply
parameters passed to plot.default
integer, whether to plot the result or not; choices are 0, no plot; 1 plot on a new canvas; 2 add to existing canvas
indicates which axis should be log10-transformed, used by the plot function. For 'x' axis, it's log10-transform; for 'y' axis, it's 10log10-transform (decibel unit). Choices are "xy", "x", "y", and "".
will be passed to plot.pwelch or ignored
logical or a positive number indicating whether to plot standard error of mean; default is false. If provided with a number, then a multiple of standard error will be drawn. This option is only available when power is in log-scale (decibel unit)
ticks to show on frequency axis
logical, whether the plot should be added to existing canvas
controls the color and opacity of the standard error
controls how close the axis labels to the corresponding axes
whether to draw rectangular grid lines to the plot; only
respected when add=FALSE; default is true
the margin in which pwelch should be applied to
x <- rnorm(1000)
pwel <- pwelch(x, 100)
pwel
plot(pwel, log = "xy")
Run the code above in your browser using DataLab