Uses the window design method to design a linear phase FIR filter. This function windows the impulse response with a Hamming window by default.
b = fir_win(n, w)
b = fir_win(n, w, option)
b = fir_win(n, w, window)
b = fir_win(n, w, s)
b = fir_win(n, w, option, window)
b = fir_win(n, w, option, s)
b = fir_win(n, w, option, window, s)Legacy name: fir1
Filter order. n is a nonnegative integer. n must be even for filters with a non-zero gain at the Nyquist frequency. If n does not meet this condition, MathScript increases n by 1.
Cutoff frequencies of the filter. w is real scalar or ascending vector with elements between 0 and 1. 1 represents the Nyquist frequency. fir_win generally designs a multiband FIR filter with bands 0<w<w 1, w 1<w<w 2 … w n<w<1.
Type of filter to design. option is a string that accepts the following values:
Multiband filter whose first band is a stopband.
Multiband filter whose first band is a passband.
Window coefficients. The length of window must equal n + 1. If n is even and the filter has a non-zero gain at the Nyquist frequency, the length of window must equal n + 2.
Specifies whether the magnitude of the designed filter is normalized. s is a string that accepts the following values:
Directs MathScript to scale the filter coefficients.
Directs MathScript not to scale the filter coefficients.
Filter coefficients of order n. b is a real vector.
N = 5; W = 0.2; B = fir_win(N, W, 'low', win_hann2(6))
Where This Node Can Run:
Desktop OS: Windows
FPGA: This product does not support FPGA devices