From: <jo...@us...> - 2012-08-20 17:11:06
|
Revision: 10889 http://octave.svn.sourceforge.net/octave/?rev=10889&view=rev Author: jordigh Date: 2012-08-20 17:10:59 +0000 (Mon, 20 Aug 2012) Log Message: ----------- firls.m: ensure N is even Modified Paths: -------------- trunk/octave-forge/main/signal/inst/firls.m Modified: trunk/octave-forge/main/signal/inst/firls.m =================================================================== --- trunk/octave-forge/main/signal/inst/firls.m 2012-08-20 17:05:50 UTC (rev 10888) +++ trunk/octave-forge/main/signal/inst/firls.m 2012-08-20 17:10:59 UTC (rev 10889) @@ -13,12 +13,12 @@ ## You should have received a copy of the GNU General Public License along with ## this program; if not, see <http://www.gnu.org/licenses/>. -## b = firls(N, F, A); -## b = firls(N, F, A, W); +## b = firls(N, F, A); b = firls(N, F, A, W); ## ## FIR filter design using least squares method. Returns a length N+1 ## linear phase filter such that the integral of the weighted mean -## squared error in the specified bands is minimized. +## squared error in the specified bands is minimized. N must be an even +## integer or ## ## F specifies the frequencies of the band edges, normalized so that ## half the sample frequency is equal to 1. Each band is specified by @@ -28,7 +28,8 @@ ## ## W is an optional weighting function that contains one value for each ## band that weights the mean squared error in that band. A must be the -## same length as F, and W must be half the length of F. +## same length as F, and W must be half the length of F. N must be +## even. If you specify an odd value, firls increments it by 1. ## ## The least squares optimization algorithm for computing FIR filter ## coefficients is derived in detail in: @@ -59,6 +60,8 @@ error("This feature is implemented yet"); else + N += mod (N, 2); + M = N/2; w = kron (weight(:), [-1; 1]); omega = frequencies * pi; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |