changeset 16436:39847dcd2568

* fftfilt.m: simplify computation of xisreal and xisimag
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Thu, 04 Apr 2013 17:18:16 -0400
parents 22c0e0df1dbc
children 919796a440c6
files scripts/signal/fftfilt.m
diffstat 1 files changed, 3 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/signal/fftfilt.m	Thu Apr 04 15:45:58 2013 -0400
+++ b/scripts/signal/fftfilt.m	Thu Apr 04 17:18:16 2013 -0400
@@ -101,17 +101,9 @@
   ## - If b is real and x is imaginary, y should be imaginary.
   ## - If b is imaginary and x is real, y should be imaginary.
   ## - If both b and x are imaginary, y should be real.
-  xisreal = zeros (1,size(x,2));
-  xisimag = xisreal;
-  for cx = 1:size(x,2)
-    if (all (imag (x(:,cx)) == 0))
-      xisreal (cx) = 1;
-    elseif (all (real (x (:,cx)) == 0))
-      xisimag (cx) = 1;
-    endif
-  endfor
-  xisreal = find(xisreal);
-  xisimag = find(xisimag);
+  xisreal = all (imag (x) == 0);
+  xisimag = all (real (x) == 0);
+
   if (all (imag (b) == 0))
     y (:,xisreal) = real (y (:,xisreal));
     y (:,xisimag) = complex (real (y (:,xisimag)) * 0, imag (y (:,xisimag)));