pactools.utils.fir.BandPassFilter

class pactools.utils.fir.BandPassFilter(fs, fc, n_cycles=7.0, bandwidth=None, zero_mean=True, extract_complex=False)[source]

Band-pass FIR filter

Designs a band-pass FIR filter centered on frequency fc.

Parameters
fsfloat

Sampling frequency

fcfloat

Center frequency of the bandpass filter

n_cyclesfloat or None, (default 7.0)

Number of oscillation in the wavelet. None if bandwidth is used.

bandwidthfloat or None, (default None)

Bandwidth of the FIR wavelet filter. None if n_cycles is used.

zero_meanboolean, (default True)

If True, the mean of the FIR is subtracted, i.e. fir.sum() = 0.

extract_complexboolean, (default False)

If True, the wavelet filter is complex and transform returns two signals, filtered with the real and the imaginary part of the filter.

Examples

>>> from pactools.utils import BandPassFilter
>>> f = BandPassFilter(fs=100., fc=5., bandwidth=1., n_cycles=None)
>>> f.plot()
>>> signal_out = f.transform(signal_in)
__init__(self, fs, fc, n_cycles=7.0, bandwidth=None, zero_mean=True, extract_complex=False)[source]

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(self, fs, fc[, n_cycles, …])

Initialize self.

plot(self[, axs, fscale, colors])

Plots the impulse response and the transfer function of the filter.

transform(self, sigin[, out, out_imag])

Apply this filter to a signal