From: <car...@us...> - 2012-08-15 13:41:41
|
Revision: 10878 http://octave.svn.sourceforge.net/octave/?rev=10878&view=rev Author: carandraug Date: 2012-08-15 13:41:35 +0000 (Wed, 15 Aug 2012) Log Message: ----------- fir2: always return a row (matlab compatibility) Modified Paths: -------------- trunk/octave-forge/main/signal/NEWS trunk/octave-forge/main/signal/inst/fir2.m Modified: trunk/octave-forge/main/signal/NEWS =================================================================== --- trunk/octave-forge/main/signal/NEWS 2012-08-15 13:15:12 UTC (rev 10877) +++ trunk/octave-forge/main/signal/NEWS 2012-08-15 13:41:35 UTC (rev 10878) @@ -4,7 +4,10 @@ signal-1.1.4 Release Date: 2012-XX-XX Release Manager: =============================================================================== - ** Improved Matlab compability for the function `fir2'. + ** Improved Matlab compability for the function `fir2'. This changes include + always returning vaues in a row (even when the smoothing window is a single + column), the default values for grid_n and ramp_n, and returning an error + when invalid values are used (instead of silently adjusting them). ** Fixed failing test for the function `residued'. Modified: trunk/octave-forge/main/signal/inst/fir2.m =================================================================== --- trunk/octave-forge/main/signal/inst/fir2.m 2012-08-15 13:15:12 UTC (rev 10877) +++ trunk/octave-forge/main/signal/inst/fir2.m 2012-08-15 13:41:35 UTC (rev 10878) @@ -129,14 +129,12 @@ b = ifft([grid ; zeros(grid_n*2,1) ;grid(grid_n:-1:2)]); b = 2 * real([ b([end-n+1:2:end]) ; b(2:2:(n+1))]); endif + ## Multiplication in the time domain is convolution in frequency, ## so multiply by our window now to smooth the frequency response. - if rows(window) > 1 - b = b .* window; - else - b = b' .* window; - endif - b = b' + ## Also, for matlab compatibility, we return return values in 1 row + b = b(:)' .* window(:)'; + endfunction %% Test that the grid size is rounded up to the next power of 2 This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |