mutilsSDF             package:ifultools             R Documentation

_S_D_F _e_v_a_l_u_a_t_i_o_n _o_v_e_r _a _d_i_s_c_r_e_t_e _u_n_i_f_o_r_m _g_r_i_d _o_f _f_r_e_q_u_e_n_c_i_e_s

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

     MUTILS is a C library used for certain '.Call' functions. This
     function evaluates an input SDF function over frequencies on the
     interval [0, Nyquist], i.e., normalized frequencies [0, 1/2].

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

     mutilsSDF(sdf=NULL, sdfargs=NULL, n.freq=1024, sampling.interval=1)

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

  n.freq: a positive integer (greater than one) defining the number of
          frequencies to use in evaluating the SDF. The frequencies are
          uniformly distributed over the interval [0, Nyquist] ala
          f=[0, 1/P , 2/P, 3/P, ..., (n.freq-1)/P] where
          P=2*(n.freq-1)/sampling.interval. Default: '1024'.

sampling.interval: a positive numeric scalar representing the sampling
          interval of the time series associated with the input SDF.
          This argument is used only develop the set of frequencies
          over which the input SDF is evaluated (see documentation for
          'n.freq' argument for more details). Default: '1'.

     sdf: the input SDF. If 'sdf=NULL', a negative numeric scalar is
          returned and serves as a flag the MUTILS C code to ignore
          relevant SDF calculations. Otherwise, this input must be a
          function whose first argument is 'f' (representing
          frequency). At a minimum, the SDF must be defined over
          frequencies [0, Nyquist] where
          'Nyquist=1/(2*sampling.interval)'. Additional arguments that
          are needed to calculate the SDF should be passed via the
          'sdfargs' parameter. Default: 'NULL'.

 sdfargs: a list of named additional SDF arguments. For example, if the
          input SDF requires additional arguments (other than 'f'): 'y'
          and 'z', then specify this input ala 'sdfargs=list(y=1,
          z=pi)'. Default: 'NULL' (no additional inputs).

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

     a numeric vector containing the values of the input SDF evaluated
     over frequencies uniformly distributed on the interval [0,
     Nyquist]. The corresponding frequencies are assigned to the output
     object as the named attribute '"frequency"'. If 'sdf=NULL', a
     negative numeric scalar is returned and serves as a flag to MUTILS
     C code that the SDF is missing or undefined.

_S_e_e _A_l_s_o:

     'mutilsDistanceMetric', 'mutilsFilterType',
     'mutilsFilterTypeContinuous', 'mutilsTransformPeakType',
     'mutilsTransformType', 'mutilsWSShrinkageFunction',
     'mutilsWSThresholdFunction'.

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

     ## create a faux SDF 
     S <- function(f, phi)  1/(1 + phi^2 - 2*phi*cos(2*pi*f))

     ## specify additional input arguments needed to 
     ## evaluate the SDF 
     sdfargs <- list(phi=0.9)

     ## evaluate the SDF over frequencies on the 
     ## interval [0, 1/2] 
     Sx <- mutilsSDF(sdf=S, sdfargs=sdfargs)

     ## plot the result 
     f <- attr(Sx,"frequency")
     plot(f, Sx, type="l")

