changeset 804:15ee4d50d9dd

[project @ 1994-10-14 01:14:18 by jwe]
author jwe
date Fri, 14 Oct 1994 01:14:18 +0000
parents 1844c17634f9
children 9737aee6900f
files scripts/signal/filter.m
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/signal/filter.m	Thu Oct 13 23:17:34 1994 +0000
+++ b/scripts/signal/filter.m	Fri Oct 14 01:14:18 1994 +0000
@@ -44,6 +44,8 @@
 #  amr@mpl.ucsd.edu
 #  June 1994
 
+# Bug fix by FL (Friedrich.Leisch@ci.tuwien.ac.at) on Oct 12, 1994
+
   if(nargin < 3 || nargin > 4)
     error("usage: [y, sf] = filter(b,a,x[,si])");
   endif
@@ -59,12 +61,15 @@
   MN = max([N M]);
   lw = MN - 1;
 
+  # It's convenient to pad the coefficient vectors to the same length.
+  b = postpad(b,MN);
+
   # Ensure that all vectors have the assumed dimension.
   if(columns(a) > 1)
     a = reshape(a,N,1);
   endif
   if(columns(b) > 1)
-    b = reshape(b,M,1);
+    b = reshape(b,MN,1);
   endif
 
   if(nargin == 3)
@@ -82,9 +87,6 @@
   # Allocate space for result.
   y = zeros(1,L);
 
-  # It's convenient to pad the coefficient vectors to the same length.
-  b = postpad(b,MN);
-
   norm = a(1);
   if (norm == 0.)
     error("First element in second argument must be non-zero.");