def firwin_kaiser_hpf(f_stop, f_pass, d_stop, fs = <NUM_LIT:1.0>, N_bump=<NUM_LIT:0>):
<EOL>f_pass_eq = fs/<NUM_LIT> - f_pass<EOL>f_stop_eq = fs/<NUM_LIT> - f_stop<EOL>wc = <NUM_LIT:2>*np.pi*(f_pass_eq + f_stop_eq)/<NUM_LIT:2>/fs<EOL>delta_w = <NUM_LIT:2>*np.pi*(f_stop_eq - f_pass_eq)/fs<EOL>M = np.ceil((d_stop - <NUM_LIT:8>)/(<NUM_LIT>*delta_w))<EOL>M += N_bump<EOL>N_taps = M + <NUM_LIT:1><EOL>beta = signal.kaiser_beta(d_stop)<EOL>w_k = signal.kaiser(N_taps,beta)<EOL>n = np.arange(N_taps)<EOL>b_k = wc/np.pi*np.sinc(wc/np.pi*(n-M/<NUM_LIT:2>)) * w_k<EOL>b_k /= np.sum(b_k)<EOL>n = np.arange(len(b_k))<EOL>b_k *= (-<NUM_LIT:1>)**n<EOL>print('<STR_LIT>' % N_taps)<EOL>return b_k<EOL>
Design an FIR highpass filter using the sinc() kernel and
a Kaiser window. The filter order is determined based on 
f_pass Hz, f_stop Hz, and the desired stopband attenuation
d_stop in dB, all relative to a sampling rate of fs Hz.
Note: the passband ripple cannot be set independent of the
stopband attenuation.

Mark Wickert October 2016