| wiener1 {RTisean} | R Documentation |
Tools for producing the periodogram from a time series and generating a filtered sequence.
wiener1(series, f, w, l, x = 0, c = 1) wiener2(series, f, w, o, l, x = 0, c = 1)
series |
a vector or a matrix. |
f |
sampling rate. |
w |
frequency resolution. |
o |
the output of a wiener1 call. |
l |
number of values to be read. |
x |
number of values to be skipped. |
c |
column to be read. |
wiener1 produces the periodogram matrix, wiener2 generates the filtered time series.
## Not run:
numdata <- 500
dat <- cos(1:numdata/25)+rnorm(numdata,0,0.1)
periodogramat<- wiener1(dat)
#edit periodogram as desired.
# clean all but the 4th period:
periodogramat[-4,] <- cbind(periodogramat[-4,1],0)
filteredat <- wiener2(dat, o=periodogramat)
plot(dat,xlab="Time",t="l",ylab="Cos Data",ylim=c(-1.5,1.2))
lines(filteredat,col=2,lwd=2)
legend(300,-1.2, c("Noisy Data","Filtered Data") ,fill=c(1,2), bty="n")
## End(Not run)