taper {sapa} | R Documentation |
Develop signal processing tapers or windows.
taper(type="rectangle", n.sample=100, n.taper=NULL, sigma=0.3, beta=4*pi*(n.sample-1)/n.sample, cutoff=floor(n.sample/2), sidelobedB=80, roughness=n.sample/2, flatness=0.3, bandwidth=4, normalize=TRUE)
bandwidth |
bandwidth for DPSS tapers.
See Details for more information. Default: 4. |
beta |
kaiser window shape factor (must be positive or zero).
See Details for more information. Default: 4*pi*(n.sample-1)/n.sample . |
cutoff |
parzen or Papoulis window cutoff (must be greater than unity).
See Details for more information. Default: floor(n.sample/2) . |
flatness |
raised cosine taper flatness fraction (must be on [0,1]).
See Details for more information. Default: 0.3. |
n.sample |
an integer denoting the number of samples. Default: 1000. |
n.taper |
an integer defining the multitaper order (number of orthogonal tapers) to use
in a multitaper scheme. The taper order directly impacts the quality of
the SDF estimate. Low taper orders are usually associated with SDF estimates with low bias and high variance,
while high taper orders attenuate the variance of the estimate at the risk of incurring a large bias.
This tradeoff between bias and variance is unavoidable but taper order allows you to tune the SDF
to meet the needs of your application. Studies show that a multitaper order of 5 typically provides a good balance
with reasonably low bias and variance properties (see the references for more details). Default: NULL ,
which serves as a flag to set the default taper order depending on the type of taper chosen for the analysis.
If sine or dpss multitapers are chosen, the default taper order is 5, otherwise is set to unity. |
normalize |
a logical value. If TRUE ,
the taper is normalized to have unit energy. Default: TRUE . |
roughness |
daniell windown roughness factor (must be positive).
See Details for more information. Default: n.sample/2 . |
sidelobedB |
chebyshev sidelobedB bandwidth in decibels
(must be positive).
See Details for more information. Default: 80. |
sigma |
standard deviation for Guassian taper. Default: 0.3. |
type |
a character string denoting the type of taper to create.
Supported types are "rectangle" , "triangle" , "raised cosine" ,
"hanning" , "hamming" , "blackman" , "nuttall" , "gaussian" ,
"kaiser" , "chebyshev" , "born jordan" , "sine" ,
"parzen" , "papoulis" , "daniell" , and "dpss" .
See Details for more information. Default: "rectangle" . |
Let w() and h(t) for t = 0, ..., N-1 be a lag window and taper, respectively. The following lag window or taper types are supported.
h(t) = h(N-t-1) = 0.5 * (1 - cos(B*(t+1))) for 0 <= t < floor(M/2) and
h(t) = 1 for floor(M/2) <= t < N - floor(M/2).
h(t) = h(N-t-1) = exp(-B*B/2) for 0 <= t < floor(N/2)
.
h(N/2)=1 if N is evenly divisible by 2
.
h(k,t) = sqrt(2/(N+1)) * sin((k+1)*pi*(t+1)/(N+1))
for t = 0, ..., N-1 and k = 0, ..., .. This simple equation defines a good approximation to the discrete prolate spheroidal sequences (DPSS) used in multitaper SDF estimation schemes.
w(t,m)= {1 - 6(t/m)^2 + 6(|t|/m)^3} for |t| <= m/2; {2(1 - |t|/m)^3} for m/2 < |t| <= m; and 0 otherwise
for -(N-1) <= t <= (N - 1). The variable m is referred to as the cutoff since all values beyond that point are zero.
w(t,m)= {(1/pi) * |sin(pi*t/m)| + (1 - |t|/m) * cos(pi*t/m)} for |t| < m; and 0 otherwise
for -(N-1) <= t <= (N - 1). The variable m is referred to as the cutoff since all values beyond that point are zero.
w(t,m)= {sin(pi*t/m)/(pi*t/m)} for |t| < N; and 0 for |t| >= N
for -(N-1) <= t <= (N - 1). The variable m is referred to as the roughness factor, since, in the context of spectral density function (SDF) estimation, it controls the degree of averaging that is performed on the preliminary direct SDF estimate. The smaller the roughness, the greater the amount of smoothing.
h(t,k) = C * I0( W' * sqrt(1 - (1 - g(t))^2) / I0(W')
for t=1,...,N, where C is a scaling constant used to force the normalization sum[t=0,...,N-1]{h(t,k)^2}=1; W'=pi*W*(N-1)*dt where dt is the sampling interval; g(t)=(2*t-1)/N; and I0() is the modified Bessel function of the first kind and zeroth order. The parameter W is related to the resolution bandwidth since it roughly defines the desired half-width of the central lobe of the resulting spectral window. Higher order DPSS tapers (i.e., h(t,k) for k > 0) can be calculated using a relatively simple tridiagonalization formulation (see the references for more information). Finally, we note that the sampling interval dt can be set to unity without any loss of generality.
an object of class taper
.
upperCase(attr(x,"type"))
.type
argument of the par
function). Default: "l".par
function).
A. T. Walden, ``Accurate Approximation of a 0th Order Discrete Prolate Spheroidal Sequence for Filtering and Data Tapering", Signal Processing, 18, 341–8 (1989).
Percival, Donald B. and Constantine, William L. B. (2005) ``Exact Simulation of Gaussian Time Series from Nonparametric Spectral Estimates with Application to Bootstrapping", Journal of Computational and Graphical Statistics, accepted for publication.
D.B. Percival and A. Walden (1993), Spectral Analysis for Physical Applications: Multitaper and Conventional Univariate Techniques, Cambridge University Press, Cambridge, UK.
S.K.Mitra, J. Kaiser (1993), Handbook for Digital Signal Processing, John Wiley and Sons, Inc.
## change plot layout gap <- 0.11 old.plt <- splitplot(4,4,1,gap=gap) ## create a plot of all supported tapers and ## windows nms <- c("rectangle", "triangle", "raised cosine", "hanning", "hamming", "blackman", "nuttall", "gaussian", "kaiser", "chebyshev", "born jordan", "sine", "parzen", "papoulis", "daniell", "dpss") for (i in seq(along=nms)){ if (i > 1) splitplot(4,4,i,gap=gap) plot(taper(type=nms[i])) } ## restore plot layout to initial state par(old.plt)