# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1365110296 14400 # Node ID 39847dcd25681af07af96620c87893c5ff3b0886 # Parent 22c0e0df1dbcd0f7065d1e1b0c9d90ef7fcfb3d8 * fftfilt.m: simplify computation of xisreal and xisimag diff --git a/scripts/signal/fftfilt.m b/scripts/signal/fftfilt.m --- a/scripts/signal/fftfilt.m +++ b/scripts/signal/fftfilt.m @@ -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)));