help-octave
[Top][All Lists]
Advanced

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

Average Magnitude Differential Function - implementation


From: jacek grabowski
Subject: Average Magnitude Differential Function - implementation
Date: Wed, 5 May 2010 21:29:02 +0200

Hello,

following code:

s=wavread('/home/jaca/ka.wav');
w=s(2000:4000);
 N=length(w);
   for k=1:N
       suma=0;
       for n=1:N-k
             suma=suma+abs(w(k)-w(k+n));    % 2 001 000 times for N=2001
       endfor
    amdf(k)=suma;
  endfor

I wolud like to run it from PHP system('octave3.0 -qf amdf.m') but max
execution time is only 30 s.
When i run amdf.m direct on shell:

address@hidden:~$ octave3.0 -fq amdf.m
Elapsed time is 58.2993 seconds.

It's any way to optimize this code? When i run the same script on PC
with Matlab execution time is about 3-4 s.
Maybe I'm doing something wrong?

--
Jacek Grabowski



reply via email to

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