From 6e1e4362783f68a8e8be1d199337c1ca831a2994 Mon Sep 17 00:00:00 2001 From: Brijeshcr Date: Fri, 10 Nov 2017 15:08:11 +0530 Subject: Brijesh functions --- macros/wconv.sci | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 macros/wconv.sci (limited to 'macros/wconv.sci') 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 -- cgit