FIR filter coefficients for a filter with the given order and frequency cutoff.
fir1( n, w, type = c("low","high","stop","pass","DC-0","DC-1"), window = hamming(n +1), scale =TRUE)
Arguments
n: filter order (1 less than the length of the filter).
w: band edges, strictly increasing vector in the range c(0, 1), where 1 is the Nyquist frequency. A scalar for highpass or lowpass filters, a vector pair for bandpass or bandstop, or a vector for an alternating pass/stop filter.
type: character specifying filter type, one of "low" for a low-pass filter, "high" for a high-pass filter, "stop" for a stop-band (band-reject) filter, "pass" for a pass-band filter, "DC-0" for a bandpass as the first band of a multiband filter, or "DC-1" for a bandstop as the first band of a multiband filter. Default: "low".
window: smoothing window. The returned filter is the same shape as the smoothing window. Default: hamming(n + 1).
scale: whether to normalize or not. Use TRUE (default) or "scale" to set the magnitude of the center of the first passband to 1, and FALSE or "noscale" to not normalize.
Returns
The FIR filter coefficients, a vector of length n + 1, of class Ma.