pyeeg.utils
.fir_order
- pyeeg.utils.fir_order(tbw, srate, atten=60, ripples=None)
Estimate FIR Type II filter order (order will be odd).
If ripple is given will use rule:
\[N = \frac{2}{3} \log_{10}\frac{1}{10\delta_ripp\delta_att} \frac{Fs}{TBW}\]Else:
\[N = \frac{Atten*Fs}{22*TBW} - 1\]- Parameters:
tbw (float) – Transition bandwidth in Hertz
srate (float) – Sampling rate (Fs) in Hertz
atten (float (default 60.0)) – Attenuation in StopBand in dB
ripples (float (default None, optional)) – Maximum ripples height (in relative to peak)
- Returns:
order – Filter order (i.e. 1+numtaps)
- Return type:
int
Notes
Rule of thumbs from here.