Learn R Programming

spectral (version 1.3)

Windowfunctions: Windowfunctions

Description

Some typical windowfunctions are defined below:

Arguments

Value

All window functions return a wighting vector with the same length as the provided data vector.

Details

win.cos()

cosine window

win.tukey()

the tukey window

A window function weights a given dataset in a way, that the new data set is coerced to be periodic. This method reduces the leakage effects of the Fourier transform.

Examples

Run this code
# NOT RUN {
y <- 1:100
y_cos <- y * win.cos(y)
y_tuk <- y * win.tukey(y)

# Plot the original data
plot(y,main="Effect of window functions")
legend("topleft",c("original","cos","tukey"),pch=c(16,17))
points(y_cos,pch=16)
points(y_tuk,pch=17)


# }

Run the code above in your browser using DataLab