wiener1               package:RTisean               R Documentation

_W_i_e_n_e_r _f_i_l_t_e_r

_D_e_s_c_r_i_p_t_i_o_n:

     Tools for producing the periodogram from a time series and
     generating a filtered sequence.

_U_s_a_g_e:

     wiener1(series, f, w, l, x = 0, c = 1)
     wiener2(series, f, w, o, l, x = 0, c = 1)

_A_r_g_u_m_e_n_t_s:

  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. 

_V_a_l_u_e:

     'wiener1' produces the periodogram matrix, 'wiener2' generates the
     filtered time series.

_E_x_a_m_p_l_e_s:

     ## 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)

