From: <car...@us...> - 2012-08-23 16:18:56
|
Revision: 10897 http://octave.svn.sourceforge.net/octave/?rev=10897&view=rev Author: carandraug Date: 2012-08-23 16:18:49 +0000 (Thu, 23 Aug 2012) Log Message: ----------- xcorr2: fix bug caused by r9421 Revision Links: -------------- http://octave.svn.sourceforge.net/octave/?rev=9421&view=rev Modified Paths: -------------- trunk/octave-forge/main/signal/NEWS trunk/octave-forge/main/signal/inst/xcorr2.m Modified: trunk/octave-forge/main/signal/NEWS =================================================================== --- trunk/octave-forge/main/signal/NEWS 2012-08-23 07:43:52 UTC (rev 10896) +++ trunk/octave-forge/main/signal/NEWS 2012-08-23 16:18:49 UTC (rev 10897) @@ -15,6 +15,9 @@ ** The function `rceps' was fixed to work correctly with odd-length inputs. + ** Bugfix in `xcorr2' introduced in 1.1.2 that would not accept "none" as + sacle option. + ** The following functions are new: movingrms schtrig clustersegment Modified: trunk/octave-forge/main/signal/inst/xcorr2.m =================================================================== --- trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-23 07:43:52 UTC (rev 10896) +++ trunk/octave-forge/main/signal/inst/xcorr2.m 2012-08-23 16:18:49 UTC (rev 10897) @@ -65,23 +65,26 @@ ## bias routines by Dave Cogdell (cog...@as...) ## optimized by Paul Kienzle (pki...@us...) - if strcmp(lower(biasflag), 'biased'), - c = c / ( min ([ma, mb]) * min ([na, nb]) ); - elseif strcmp(lower(biasflag), 'unbiased'), - lo = min ([na,nb]); - hi = max ([na, nb]); - row = [ 1:(lo-1), lo*ones(1,hi-lo+1), (lo-1):-1:1 ]; + switch lower (biasflag) + case {"biased"} + c = c / ( min ([ma, mb]) * min ([na, nb]) ); + case {"unbiased"} + lo = min ([na,nb]); + hi = max ([na, nb]); + row = [ 1:(lo-1), lo*ones(1,hi-lo+1), (lo-1):-1:1 ]; - lo = min ([ma,mb]); - hi = max ([ma, mb]); - col = [ 1:(lo-1), lo*ones(1,hi-lo+1), (lo-1):-1:1 ]'; + lo = min ([ma,mb]); + hi = max ([ma, mb]); + col = [ 1:(lo-1), lo*ones(1,hi-lo+1), (lo-1):-1:1 ]'; - bias = col*row; - c = c./bias; + bias = col*row; + c = c./bias; - elseif strcmp(lower(biasflag),'coeff'), - c = c/max(c(:))'; - else - error ("invalid type of scale %s", biasflag); - endif + case {"coeff"} + c = c/max(c(:))'; + case {"none"} + ## do nothing, it's all done + otherwise + error ("invalid type of scale %s", biasflag); + endswitch endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |