| fir1 {gsignal} | R Documentation | 
Window-based FIR filter design
Description
FIR filter coefficients for a filter with the given order and frequency cutoff.
Usage
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  | 
| window | smoothing window. The returned filter is the same shape as the
smoothing window. Default:  | 
| scale | whether to normalize or not. Use  | 
Value
The FIR filter coefficients, a vector of length n + 1, of
class Ma.
Author(s)
Paul Kienzle, pkienzle@users.sf.net,
Conversion to R Tom Short,
adapted by Geert van Boxtel, G.J.M.vanBoxtel@gmail.com.
References
https://en.wikipedia.org/wiki/Fir_filter
See Also
Examples
freqz(fir1(40, 0.3))
freqz(fir1(10, c(0.3, 0.5), "stop"))
freqz(fir1(10, c(0.3, 0.5), "pass"))