iir                   package:Rsac                   R Documentation

_I_N_F_I_N_I_T_E _I_M_P_U_L_S_E _R_E_S_P_O_N_S_E _F_I_L_T_E_R_S

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

     Applies an IIR filter to an object of class '"rsac"'.

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

     iir(x, ord = 3, fl = NA, fh = NA,
         type = c("LP", "HP", "BP", "BR"),
         proto = c("BU", "BE", "C1", "C2"),
         zerophase = TRUE,
         ca = NA, ctr = NA)
     lp(x, c, n = 3, proto = "BU", zerophase = TRUE)
     hp(x, c, n = 3, proto = "BU", zerophase = TRUE)
     bp(x, c, n = 3, proto = "BU", zerophase = TRUE)

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

       x: an object of class '"rsac"'.

  ord, n: the number of poles for filter. Must be less than 10.

  fl, fh: low/high pass corner frequency.

       c: corner frequency/frequencies. Two are required for 'bp'.

    type: LP = lowpass, HP = highpass, BP = bandpass, BR =
          bandreject.

   proto: BU = Butterworth, BE = Bessel, C1 = Chebyshev Type I,
          C2 = Chebyshev Type II

zerophase: logical; TRUE for zerophase (two-pass) filtering should be
          applied; FALSE for single pass filtering.

      ca: Chebyshev stop band attenuation.

     ctr: Chebyshev transition bandwidth.

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

     same as input.

_A_u_t_h_o_r(_s):

     Jonathan M. Lees <jonathan.lees@unc.edu> and Eric M. Thompson
     <eric.thompson@tufts.edu>

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

     # Sine waves plus linear trend:
     t <- seq(0, 10, by = 0.02)
     x <- sin(2 * pi * 1 * t) + sin(2 * pi * 5 * t) + 0.2 * t
     sines <- vector(mode = "list")
     sines[[1]] <- list(amp = x, dt = 0.02, N = length(x), nzhour = 0,
                        nzmin = 0, nzsec = 0, nzmsec = 0, b = 0)
     class(sines) <- "rsac"
     plot(sines)
     f1 <- iir(sines, fl = 0.5, fh = 1.5, type = "BP", proto = "BU")
     lines(f1, col = "blue")
     f2 <- iir(sines, fl = 0.5, fh = 1.5, type = "BP", proto = "BU",
               zerophase = FALSE)
     lines(f2, col = "red")

     # Real data
     data(srosa)
     plot(srosa)
     spect(srosa, log = "no")
     testf <- lp(srosa, c = 2)
     spect(testf, log = "no")
     testf <- bp(srosa, c = c(2, 4))
     spect(testf, log = "no")

