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. F specifies the frequencies of the band edges, normalized so that half the sample frequency is equal to 1. Each band is specified by two frequencies, to the vector must have an even length. A specifies the amplitude of the desired response at each band edge. 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.