From: <car...@us...> - 2011-10-01 20:33:02
|
Revision: 8648 http://octave.svn.sourceforge.net/octave/?rev=8648&view=rev Author: carandraug Date: 2011-10-01 20:32:55 +0000 (Sat, 01 Oct 2011) Log Message: ----------- impinvar/invimpinvar: removed private function pad_poly and replaced with octave-core prepad Modified Paths: -------------- trunk/octave-forge/main/signal/inst/impinvar.m trunk/octave-forge/main/signal/inst/private/h1_z_deriv.m trunk/octave-forge/main/signal/inst/private/inv_residue.m Removed Paths: ------------- trunk/octave-forge/main/signal/inst/private/pad_poly.m Modified: trunk/octave-forge/main/signal/inst/impinvar.m =================================================================== --- trunk/octave-forge/main/signal/inst/impinvar.m 2011-09-30 19:06:11 UTC (rev 8647) +++ trunk/octave-forge/main/signal/inst/impinvar.m 2011-10-01 20:32:55 UTC (rev 8648) @@ -1,4 +1,4 @@ -## Copyright 2007 R.G.H. Eschauzier <res...@ya...> +## Copyright (c) 2007 R.G.H. Eschauzier <res...@ya...> ## Copyright (c) 2011 Carnë Draug <car...@gm...> ## Copyright (c) 2011 Juan Pablo Carbajal <car...@if...> ## Modified: trunk/octave-forge/main/signal/inst/private/h1_z_deriv.m =================================================================== --- trunk/octave-forge/main/signal/inst/private/h1_z_deriv.m 2011-09-30 19:06:11 UTC (rev 8647) +++ trunk/octave-forge/main/signal/inst/private/h1_z_deriv.m 2011-10-01 20:32:55 UTC (rev 8648) @@ -27,13 +27,13 @@ d = (-1)^n; % Vector with the derivatives of H1(z) for i=(1:n-1) d = conv(d,[1 0]); % Shift result right (multiply by -z) - d += pad_poly(polyderiv(d),i+1); % Add the derivative + d += prepad(polyderiv(d), i+1, 0) % Add the derivative endfor %% Build output vector b = zeros(1,n+1); for i=(1:n) - b += d(i) * pad_poly(h1_deriv(n-i+1, ts), n+1); + b += d(i) * prepad(h1_deriv(n-i+1, ts), n+1, 0); endfor b *= ts^(n+1)/factorial(n); Modified: trunk/octave-forge/main/signal/inst/private/inv_residue.m =================================================================== --- trunk/octave-forge/main/signal/inst/private/inv_residue.m 2011-09-30 19:06:11 UTC (rev 8647) +++ trunk/octave-forge/main/signal/inst/private/inv_residue.m 2011-10-01 20:32:55 UTC (rev 8648) @@ -40,7 +40,7 @@ while (i<=n) term = [1 -p_in(i)]; % Term to be factored out p = r_in(i)*deconv(a_out,term); % Residue times resulting polynomial - p = pad_poly(p,n+1); % Pad for proper length + p = prepad(p, n+1, 0); % Pad for proper length b_out += p; m = 1; @@ -51,7 +51,7 @@ m++; mterm = conv(mterm, term); % Next multiplicity to be factored out p = r_in(i) * deconv(a_out, mterm); % Resulting polynomial - p = pad_poly(p, n+1); % Pad for proper length + p = prepad(p, n+1, 0); % Pad for proper length b_out += p; endwhile i++; Deleted: trunk/octave-forge/main/signal/inst/private/pad_poly.m =================================================================== --- trunk/octave-forge/main/signal/inst/private/pad_poly.m 2011-09-30 19:06:11 UTC (rev 8647) +++ trunk/octave-forge/main/signal/inst/private/pad_poly.m 2011-10-01 20:32:55 UTC (rev 8648) @@ -1,25 +0,0 @@ -## Copyright 2007 R.G.H. Eschauzier <res...@ya...> -## Adapted by Carnë Draug on 2011 <car...@gm...> -## -## 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 -## the Free Software Foundation; either version 2 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; if not, write to the Free Software -## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - -## This function is necessary for impinvar and invimpinvar of the signal package - -## Pad polynomial to length n -function p_out = pad_poly(p_in,n) - l = length(p_in); % Length of input polynomial - p_out(n-l+1:n) = p_in(1:l); % Right shift for proper length - p_out(1:n-l) = 0; % Set first elements to zero -endfunction This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |