summaryrefslogtreecommitdiff
path: root/macros/wconv.sci
blob: a0682a6ca6d6a0685b64825d2b2b0f0f436376e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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