fftfilt                package:signal                R Documentation

_F_i_l_t_e_r_s _w_i_t_h _a_n _F_I_R _f_i_l_t_e_r _u_s_i_n_g _t_h_e _F_F_T

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

     Filters with an FIR filter using the FFT.

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

     fftfilt(b, x, n = NULL)

     FftFilter(b, n)

     ## S3 method for class 'FftFilter':
     filter(filt, x, ...)

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

       b: the moving-average (MA) coefficients of an FIR filter.

       x: the input signal to be filtered. 

       n: if given, the length of the FFT window for the overlap-add
          method. 

    filt: filter to apply to the signal.

     ...: additional arguments (ignored). 

_D_e_t_a_i_l_s:

     If 'n' is not specified explicitly, we do not use the overlap-add
     method at all because loops are really slow. Otherwise, we only
     ensure that the number of points in the FFT is the smallest power
     of two larger than 'n' and 'length(b)'.

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

     For 'fftfilt', the filtered signal, the same length as the input
     signal 'x'.

     For 'FftFilter', a filter of class 'FftFilter' that can be used
     with 'filter'.

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

     Original Octave version by Kurt Hornik and John W. Eaton.
     Conversion to R by Tom Short.

_R_e_f_e_r_e_n_c_e_s:

     Octave Forge <URL: http://octave.sf.net>

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

     'Ma', 'filter', 'fft', 'filtfilt'

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

     t = seq(0, 1, len=100)                       # 1 second sample
     x = sin(2*pi*t*2.3) + 0.25*rnorm(length(t))  # 2.3 Hz sinusoid+noise
     z = fftfilt(rep(1, 10)/10, x) # apply 10-point averaging filter
     plot(t, x, type = "l")
     lines(t, z, col="red")

