Functions > Signal Processing > Digital Filtering > FIR Filter Design
  
FIR Filter Design
bandpass(f1, f2, n, [w])—Returns coefficients for a bandpass FIR filter with n coefficients and cutoff frequencies f1 and f2, windowed with taper w.
bandstop(f1, f2, n, [w])—Returns coefficients for a bandstop FIR filter with n coefficients and cutoff frequencies f1 and f2, windowed with taper w.
highpass(f, n, [w])—Returns coefficients for a highpass FIR filter with n coefficients and cutoff frequency f, windowed with taper w.
lowpass(f, n, [w])—Returns coefficients for a lowpass FIR filter with n coefficients and cutoff frequency f, windowed with taper w.
Arguments
f, f1, and f2 are real-valued cutoff or bandpass frequencies, given as a fraction of the sampling frequency, between 0 and 0.5.
n is an integer greater than 2. It represents the number of coefficients for the filter.
w (optional) is an integer representing a windowing function index. A rectangular window is used if w is 0 or not specified.
The following table shows values for w and the windows they correspond to:
Value of w
Window
0
current default window
1
rectangular (default)
2
tapered rectangular
3
triangular
4
Hanning
5
Hamming
6
Blackman
7
Nuttall
Additional Information
The FIR design functions use windowing of the impulse response of an ideal filter to generate coefficients for an FIR filter of the given type.
All functions return an n element vector containing the filter coefficients.