firls: Least-squares linear-phase FIR filter design

View source: R/firls.R

firlsR Documentation

Least-squares linear-phase FIR filter design

Description

Produce a linear phase filter such that the integral of the weighted mean squared error in the specified bands is minimized.

Usage

firls(n, f, a, w = rep(1L, length(a)/2))

Arguments

n

filter order (1 less than the length of the filter). Must be even. If odd, it is incremented by one.

f

vector of frequency points in the range from 0 to 1, where 1 corresponds to the Nyquist frequency. Each band is specified by two frequencies, so the vector must have an even length. .

a

vector of the same length as f containing the desired amplitude at each of the points specified in f.

w

weighting function that contains one value for each band that weights the mean squared error in that band. w must be half the length of f.

Value

The FIR filter coefficients, a vector of length n + 1, of class Ma.

Author(s)

Quentin Spencer, qspencer@ieee.org.
Conversion to R by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.

See Also

Ma, filter, fftfilt, fir1

Examples

freqz(firls(255, c(0, 0.25, 0.3, 1), c(1, 1, 0, 0)))


gsignal documentation built on Sept. 12, 2024, 6:27 a.m.