FUNCTION REFERENCE
fir2
Design a symmetric FIR by frequency sampling and windowing.
Design a symmetric FIR by frequency sampling and windowing.
Syntax
b = fir2(n,f,m[,npt,lap,window])Syntax
b = fir2(n,f,m,window)Syntax
b = fir2(n,f,m,npt,window)f and m give a piecewise-linear desired response on [0,1] relative to Nyquist; f must start at 0 and end at 1. Default npt is max(512,next_power_of_two(n+1)), specifying npt+1 mesh points. Inverse-transform the response with linear phase n/2, retain n+1 taps and multiply by a symmetric Hamming window, or the supplied n+1 window values. A repeated interior frequency represents a jump: lap spreads the pair by lap/(2*npt) on each side; default lap=0 uses machine epsilon. Only paired repeats are accepted.
Example
b = fir2(32,[0 0.3 0.5 1],[1 1 0 0]);Example
b = fir2(16,[0 0.4 0.4 1],[1 1 0 0],512,4,hann(17));Example
b = fir2(16,[0 0.3 0.5 1],[1 1 0 0],512,hann(17));Differences from MATLAB: the stated mesh and jump conventions are explicit. Odd n requires zero desired Nyquist gain. 1<=n<=4096, n<npt<=65536, lap<=npt/2, at most 8192 breakpoints and bounded inverse-transform work. No antisymmetric design option.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.