Next: crosscor() Up: Time Series Macros Help Previous: compza()   Contents

costaper()

Usage:
 ```costaper(N, alpha), N > 0 an integer, 0 <= alpha <= .5 a REAL scalar. ```

Keywords: frequency domain, spectrum analysis, time domain
```costaper(N, alpha) returns a vector h containing a 100*alpha percent
cosine taper (data window) of length N, tapering approximately N*alpha
elements on each end.  N must be a positive integer and alpha a REAL
scalar with 0 <= alpha <= .5.

When alpha = 0, h = rep(1,N), a "taper" that does no tapering.

For 0 < alpha <= .5 and L = ceiling(alpha*N),
h[j] = .5*(1 - cos(PI*(j-.5)/L) = sin(.5*PI*(j-.5)/L)^2 , 1 <= j <= L
h[j] = 1, L + 1 <= j <= N - L
h[j] = h[N-j+1], N - L + 1 <= j <= N

A taper of length N is used to multiply a (usually) detrended time
series of length N before computing its discrete Fourier transform.

NOTE: The interpretation of tapering proportion alpha differs from that
used by some practitioners, for whom the tapering proportion is the
proportion of the entire series modified that is tapered.  To compute a
cosine taper to modify 100*P percent of a series of length N, use
costaper(N, P/2).
```

Gary Oehlert 2003-01-15