help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Very slow filter.cc


From: akira
Subject: Very slow filter.cc
Date: Wed, 29 Dec 2004 00:11:52 +0900 (JST)

I recently begin to use the development version of octave (2.1.64) and
found that filter function is very slow compared with that of
octave-2.0.17.

The test code I attached the last part of this mail showed that the
new filter function (2.1.64) is 9 times slower than the old filter
function (2.0.17). I converted codes executing actual filtering from
the old filter.cc to the new filter.cc, it made five times faster than
the new filter.cc of 2.1.64. It still twice slower than the old filter
function. The rest of the new filter.cc may be codes for input, output
and error handling and I was not able to figure out the problem.

I suspect that the reason of slow filter function is NDArray support
for
the third and fourth arguments of the filter function. The speed of
filter function should be very critical for users of digital signal
processing and I want to say goodby to the slow filter function.

I compiled octave-2.1.64 with ATLAS-3.6 and FFTW-3.0.1. Please tell me
the way to speed up filter function.

==== test code 1 ====

x = randn(1e6,1); b = randn(500,1);
tic, y = filter(b, 1, x); toc

# AthlonXP 2200+ octave-2.1.64 Linux-2.4.27
ans = 14.712

# AthlonXP 2200+ octave-2.0.17 Linux-2.4.27
ans = 1.6280

==== test code 2 ====

x = randn(1e5,10); b = randn(500,1);
tic, y = filter(b, 1, x); toc

# AthlonXP 2200+ octave-2.1.64 Linux-2.4.27
ans = 14.430

# Multi-dimensional array does not contribute its speed!!

==== test code 3 ====

x = randn(1e5,10); b = randn(500,1);
tic, for k=1:10
y(:,k) = filter(b, 1, x(:,k));
end; toc

# AthlonXP 2200+ octave-2.0.17 Linux-2.4.27
ans = 1.7135

_/_/_/  _/  _/            _/            _/_/        Akira NISHIMURA
 _/    _/  _/            _/             | Dept. of Media and Cultural Studies
_/okyo _/_/niversity of _/nformation _/_/ciences address@hidden
                   http://www.rsch.tuis.ac.jp/~akira








-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]