help-octave
[Top][All Lists]
Advanced

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

Re: Mean filter


From: Quentin Spencer
Subject: Re: Mean filter
Date: Thu, 21 Jul 2005 08:57:48 -0500
User-agent: Mozilla Thunderbird 1.0.6-1.1.fc4 (X11/20050720)

Søren Hauberg wrote:

Robert A. Macy wrote:

Was that the first time you ran meanfilter? Doesn't the second time run faster?

No that was the third time.
In the test below I cheated a little bit and created the filter (f) before I called tic, so this will also affect time.

Thanks,
Søren

Thanks, I hadn't thought of that implementation - it's
nice :-)
Unforunaly it doesn't appear to be fast enough:

a = rand(1,100000);
f = ones(1,100)/100;

tic; m1 = meanfilter(a, 100); toc
ans = 0.15448

tic; m2 = conv(a, f); toc
ans = 0.12615


I tried this with both the filter and conv functions, with similar results (though filter seemed very slightly faster). Since they are precompiled functions, I think the only way you could improve on them is to write your own precompiled function that does only addition and no multiplication--you could scale the results afterward if you needed to.

-Quentin



-------------------------------------------------------------
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]