summaryrefslogtreecommitdiff
path: root/macros/wconv.sci
diff options
context:
space:
mode:
Diffstat (limited to 'macros/wconv.sci')
-rw-r--r--macros/wconv.sci33
1 files changed, 33 insertions, 0 deletions
diff --git a/macros/wconv.sci b/macros/wconv.sci
new file mode 100644
index 0000000..a0682a6
--- /dev/null
+++ b/macros/wconv.sci
@@ -0,0 +1,33 @@
+function y = wconv (type, x, f, shape)
+//Performs 1D or 2D convolution.
+//Calling Sequence
+//y = wconv (type, x, f)
+// y = wconv (type, x, f, shape)
+//Parameters
+//type: convolution type.
+//x: Signal vector or matrix.
+//f: FIR filter coefficients.
+//shape: Shape.
+//Description
+//This is an Octave function.
+//It performs 1D or 2D convolution between the signal x and the filter coefficients f.
+//Examples
+//a = [1 2 3 4 5]
+//b = [7 8 9 10]
+//wconv(1,a,b)
+//ans =
+// 7 22 46 80 114 106 85 50
+
+funcprot(0);
+rhs = argn(2)
+if(rhs<3 | rhs>4)
+error("Wrong number of input arguments.")
+end
+
+select (rhs)
+ case 3 then
+ y = callOctave("wconv",type, x, f)
+ case 4 then
+ y = callOctave("wconv",type, x, f, shape)
+ end
+endfunction