diff options
Diffstat (limited to 'macros/fftconv.sci')
-rw-r--r-- | macros/fftconv.sci | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/macros/fftconv.sci b/macros/fftconv.sci index 5028359..eab1e21 100644 --- a/macros/fftconv.sci +++ b/macros/fftconv.sci @@ -1,17 +1,18 @@ -/*Description
- Convolve two vectors using the FFT for computation. c = fftconv (X, Y) returns 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.
- If the optional argument n is specified, an N-point FFT is used.
- Calling Sequence
- Y = fftconv(X, Y)
- Y = fftconv(X, Y, n)
- Parameters
- X, Y: Vectors
- Examples
- fftconv([1,2,3], [3,4,5])
- ans =
- 3. 10. 22. 22. 15.
- */
+
function y = fftconv(X, Y, n)
+// Description
+// Convolve two vectors using the FFT for computation. c = fftconv (X, Y) returns 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.
+// If the optional argument n is specified, an N-point FFT is used.
+// Calling Sequence
+// Y = fftconv(X, Y)
+// Y = fftconv(X, Y, n)
+// Parameters
+// X, Y: Vectors
+// Examples
+// fftconv([1,2,3], [3,4,5])
+// ans =
+// 3. 10. 22. 22. 15.
+
funcprot(0);
rhs = argn(2);
if(rhs<2 | rhs>3)
|