comparison scripts/signal/spencer.m @ 3238:041ea33fbbf4

[project @ 1999-03-26 17:48:16 by jwe]
author jwe
date Fri, 26 Mar 1999 17:48:35 +0000
parents e4f4b2d26ee9
children f8dde1807dee
comparison
equal deleted inserted replaced
3237:737b219ab65a 3238:041ea33fbbf4
25 25
26 if (nargin != 1) 26 if (nargin != 1)
27 usage ("spencer (X)"); 27 usage ("spencer (X)");
28 endif 28 endif
29 29
30 [xr xc] = size(X); 30 [xr, xc] = size(X);
31 31
32 n = xr; 32 n = xr;
33 c = xc; 33 c = xc;
34 34
35 if (is_vector(X)) 35 if (is_vector(X))
36 n = length(X); 36 n = length(X);
37 c = 1; 37 c = 1;
38 X = reshape(X, n, 1); 38 X = reshape(X, n, 1);
39 endif 39 endif
40 40
41 W = [ -3 -6 -5 3 21 46 67 74 67 46 21 3 -5 -6 -3 ] / 320; 41 W = [-3, -6, -5, 3, 21, 46, 67, 74, 67, 46, 21, 3, -5, -6, -3] / 320;
42 42
43 retval = fftfilt (W, X); 43 retval = fftfilt (W, X);
44 retval = [zeros(7,c); retval(15:n,:); zeros(7,c);]; 44 retval = [zeros(7,c); retval(15:n,:); zeros(7,c);];
45 45
46 retval = reshape(retval, xr, xc); 46 retval = reshape(retval, xr, xc);