Hi Søren,
Thank you for getting back to me. Now worries on the late reply.
I tried to clean up what I did and have created a patch file. The
latest version of levinson.m I could find online at sourceforge was
Revision 4684 from 2006.
You will see from the patch file (attached) that what I have attempted
to do is quite simple. Basically I am iterating through a matrix,
treating each column as a separate input vector to the function. This
is what the MATLAB version appears to be doing as well.
Hopefully this is simpler to follow. I apologize for the complexity of
the first version. Please let me know if you would like me to do
anything else with this.
-Joe
On Mon, Jun 6, 2011 at 5:09 PM, Søren Hauberg <[email protected]> wrote:
> tir, 10 05 2011 kl. 18:43 -0400, skrev Joe Romano:
>> Hello All,
>
> I apologize for the late reply, but man-power is a scarce resource
> around here.
>
>> I have hacked my local version of levinson.m to add in this feature,
>> and tested it's compatibility with the Matlab implementation. It is
>> attached to this email.
>
> Cool! Thanks for working on this.
>
>> I am new to Octave and the developer list, so
>> I apologize in advance for not following whatever the 'norm' protocol
>> is. If someone is interested in responding to tell me how I can best
>> add in this fix to the codebase myself I'd be happy to do so.
>
> We try to review suggested changes before committing them. For this
> reason it is helpful for us to have a list of your changes. This can be
> generated using the 'diff' command on Unix operating systems. So, if you
> can generate a patch using diff that shows the suggested changes it
> makes reviewing much more easy. I tried doing this with the code you
> sent, but it seems like you changed many things that did not need to be
> changed (like adding % in front of comment lines). This made it too hard
> for me to follow the list of changes. Can you generate a patch that is
> as simple as possible, while still containing the changes you want?
>
> Thanks
> Søren
>
>
58a59,67
> ## Changes (Joe Romano, 6 Jun 2011):
> ## Modified so that matrix inputs of the variable acf do not get
> ## their columns forced into a column vector, but are instead
> ## treated as independent vector inputs to the levinson function.
> ## The resulting output (a,v) are matrices that match the size of
> ## the input matrix acf.
> ## This mirrors the matrix-input functionality of the MATLAB
> ## levinson function.
>
62c71
< elseif( ~isvector(acf) || length(acf)<2 )
---
> elseif( length(acf)<2 )
68c77
< if( columns(acf)>1 ) acf=acf(:); endif # force a column vector
---
> for i=1 : size(acf,2) %# for each column in the input variable acf
73,76c82,86
< R = toeplitz(acf(1:p), conj(acf(1:p)));
< a = R \ -acf(2:p+1);
< a = [ 1, a.' ];
< v = real( a*conj(acf(1:p+1)) );
---
> R = toeplitz(acf(1:p,i), conj(acf(1:p,i)));
> ap = R \ -acf(2:p+1,i);
> ap = [ 1, ap.' ];
> a(i,:) = ap;
> v(i,:) = real( ap*conj(acf(1:p+1,i)) );
81,84c91,94
< g = -acf(2)/acf(1);
< a = [ g ];
< v = real( ( 1 - g*conj(g)) * acf(1) );
< ref(1) = g;
---
> g = -acf(2,i)/acf(1,i);
> ap = [ g ];
> v(i,:) = real( ( 1 - g*conj(g)) * acf(1,i) );
> ref(1,i) = g;
86,89c96,99
< g = -(acf(t+1) + a * acf(t:-1:2)) / v;
< a = [ a+g*conj(a(t-1:-1:1)), g ];
< v = v * ( 1 - real(g*conj(g)) ) ;
< ref(t) = g;
---
> g = -(acf(t+1,i) + ap * acf(t:-1:2,i)) / v(i,:);
> ap = [ ap+g*conj(ap(t-1:-1:1)), g ];
> v(i,:) = v(i,:) * ( 1 - real(g*conj(g)) ) ;
> ref(t,i) = g;
91c101
< a = [1, a];
---
> a(i,:) = [1, ap];
92a103
> endfor
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev