fftconv {gsignal} | R Documentation |
FFT-based convolution
Description
Convolve two vectors using the FFT for computation.
Usage
fftconv(x, y, n = NULL)
Arguments
x , y |
input vectors. |
n |
FFT length, specified as a positive integer. The FFT size must be an
even power of 2 and must be greater than or equal to the length of
|
Details
The computation uses the FFT by calling the function fftfilt
. If the
optional argument n
is specified, an n
-point overlap-add FFT is
used.
Value
Convoluted signal, specified as a a vector of length equal to
length (x) + length (y) - 1
. If x
and y
are the
coefficient vectors of two polynomials, the returned value is the
coefficient vector of the product polynomial.
Author(s)
Kurt Hornik, Kurt.Hornik@wu-wien.ac.at,
adapted by John W. Eaton.
Conversion to R by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.
See Also
Examples
u <- rep(1L, 3)
v <- c(1, 1, 0, 0, 0, 1, 1)
w1 <- conv(u, v) # time-domain convolution
w2 <- fftconv(u, v) # frequency domain convolution
all.equal(w1, w2) # same results