FUNCTION FIR_DESIGN,S,M ;+ ;h=FIR_DESIGN(S,M) computes the FIR coefficients for a filter of length M ;that will approximate the frequency response S. ; ;S is a vector of length N/2. The frequency response is constructed ;to make S symmetrical about the origin. ; ;H. Rhody ;May, 2002 ;- N=N_Elements(S) R=[S,0,Reverse(S[0:N-2])] w=0.54-0.46*cos(2*!pi*findgen(M+1)/M) h=Shift(FFT(R,/Inverse),M/2) h=h[0:M]*w Return,float(h) END