From: <sch...@us...> - 2012-07-04 10:23:48
|
Revision: 10726 http://octave.svn.sourceforge.net/octave/?rev=10726&view=rev Author: schloegl Date: 2012-07-04 10:23:38 +0000 (Wed, 04 Jul 2012) Log Message: ----------- fix normalization when A0 is not the identity matrix Modified Paths: -------------- trunk/octave-forge/extra/tsa/inst/mvfilter.m Modified: trunk/octave-forge/extra/tsa/inst/mvfilter.m =================================================================== --- trunk/octave-forge/extra/tsa/inst/mvfilter.m 2012-07-03 15:39:22 UTC (rev 10725) +++ trunk/octave-forge/extra/tsa/inst/mvfilter.m 2012-07-04 10:23:38 UTC (rev 10726) @@ -1,4 +1,3 @@ - function [x,z]=mvfilter(B,A,x,z) % Multi-variate filter function % @@ -30,7 +29,7 @@ % see also: MVAR, FILTER % $Id$ -% Copyright (C) 1996-2003 by Alois Schloegl <a.s...@ie...> +% Copyright (C) 1996-2003,2010,2012 by Alois Schloegl <alo...@is...> % % This program is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by @@ -84,18 +83,13 @@ end; %%%%% normalization to A{1}=I; -if p<=q, - for k=1:p, - %A{k}=A{k}/A{1}; - A(:,k*M+(1:M)) = A(:,k*M+(1:M)) / A(:,1:M); + for k=1:p, + A(:,k*M+(1:M)) = A(:,1:M) \ A(:,k*M+(1:M)); end; - A(:,1:M) = eye(M); -else for k=0:q, - %B{k}=B{k}/A{1}; - B(:,k*M+(1:M)) = B(:,k*M+(1:M)) / A(:,1:M); + B(:,k*M+(1:M)) = A(:,1:M) \ B(:,k*M+(1:M)); end; -end; + A(:,1:M) = eye(M); for k = 1:N, acc = B(:,1:M) * x(:,k) + z(:,1); % / A{1}; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |