octave-maintainers
[Top][All Lists]
Advanced

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

Re: movfun: movmin


From: Juan Pablo Carbajal
Subject: Re: movfun: movmin
Date: Fri, 19 Oct 2018 12:44:55 +0200

Hi Rik,

Thanks for the review

The loop over columns is expected to be small, e.g. if you have a single signal ncols == 1 (I can't understand why people put sliding window functions in a statistics package that has all methods implemented for independent samples, movfun doesn't belong there and is a signal processing tool, but well... I guess this is inheritance again...).
Hence for a single signal there is only 1 loop which is over the columns of an indexed matrix (see reshapemod). I have tested the function with large signals and did not see any justification to write lower level code (well, assuming reshapemod fits in memory)

Example

x = randn (1e6, 1);
tic;y = movfun(@min, x, 5);toc
Elapsed time is 0.067837 seconds.

On Thu, Oct 18, 2018 at 10:08 PM Rik <address@hidden> wrote:
On 10/18/2018 09:00 AM, address@hidden wrote:
Subject:
movfun: movmin
From:
Juan Pablo Carbajal <address@hidden>
Date:
10/17/2018 03:48 PM
To:
Maintainers GNU Octave <address@hidden>
List-Post:
<mailto:address@hidden>
Precedence:
list
MIME-Version:
1.0
Message-ID:
<address@hidden>
Content-Type:
text/plain; charset="UTF-8"
Message:
1

Dear all,

A first version of movmin is implemented in the movfun package

https://bitbucket.org/KaKiLa/movfun/src

A review is now in order, if anyone has time to do it. When this
function is polished, all the other mov* functions are implemented the
same way.

The critical points (check issues) are parsing of arguments (can't
check with the other software), and compatibility (name of options,
window length and asymmetry, etc...). Related to the later, note how I
named the boundary condition (now called Endpoints) arbitrarily,
without know what the other software did, I can fix that now.

Thanks


Also see bug #48774 (https://savannah.gnu.org/bugs/?func=detailitem&item_id=48774) where the request for moving versions of the statistics functions was made.  This bug report can be used to update and track progress as you add implementations. 

I glanced at movfun and I saw what looked like a a 2-deep nested for loop (one over columns and one over the number of elements not subject to boundary effects).  Those will be slow in an interpreted language like Octave.  You may need to write movfun in C++ if it needs to keep the for loops.  Or maybe there is a way to use clever bits of indexing.

--Rik


reply via email to

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