lowpass#

gwpy.signal.filter_design.lowpass(
frequency: QuantityLike,
sample_rate: QuantityLike,
fstop: QuantityLike | None = None,
gpass: float = 2,
gstop: float = 30,
type: Literal['iir'] = 'iir',
output: Literal['zpk'] = 'zpk',
**kwargs,
) ZpkType[source]#
gwpy.signal.filter_design.lowpass(
frequency: QuantityLike,
sample_rate: QuantityLike,
fstop: QuantityLike | None = None,
gpass: float = 2,
gstop: float = 30,
type: Literal['iir'] = 'iir',
output: Literal['ba'] = 'ba',
**kwargs,
) BAType
gwpy.signal.filter_design.lowpass(
frequency: QuantityLike,
sample_rate: QuantityLike,
fstop: QuantityLike | None = None,
gpass: float = 2,
gstop: float = 30,
type: Literal['iir'] = 'iir',
output: Literal['sos'] = 'sos',
**kwargs,
) SosType
gwpy.signal.filter_design.lowpass(
frequency: QuantityLike,
sample_rate: QuantityLike,
fstop: QuantityLike | None = None,
gpass: float = 2,
gstop: float = 30,
type: Literal['fir'] = 'fir',
**kwargs,
) TapsType

Design a low-pass filter for the given cutoff frequency.

Parameters:
frequencyfloat

Corner frequency of low-pass filter (Hertz).

sample_ratefloat

Sampling rate of target data (Hertz).

fstopfloat, optional

Edge-frequency of stop-band (Hertz).

gpassfloat, optional, default: 2

The maximum loss in the passband (dB).

gstopfloat, optional, default: 30

The minimum attenuation in the stopband (dB).

typestr, optional, default: 'iir'

The filter type, either 'iir' or 'fir'.

outputstr, optional, default: 'zpk'

The output format for an IIR filter, either 'zpk', 'ba', or 'sos'.

kwargs

Other keyword arguments are passed directly to iirdesign() or firwin().

Returns:
filter

The formatted filter. The output format for an IIR filter depends on the input arguments, default is a tuple of (zeros, poles, gain).

Notes

By default a digital filter is returned, meaning the zeros and poles are given in the Z-domain in units of radians/sample.

Examples

To create a low-pass filter at 1000 Hz for 4096 Hz-sampled data:

>>> from gwpy.signal.filter_design import lowpass
>>> lp = lowpass(1000, 4096)

To view the filter, you can use the BodePlot:

>>> from gwpy.plot import BodePlot
>>> plot = BodePlot(lp, sample_rate=4096)
>>> plot.show()

(png)

../../_images/gwpy-signal-filter_design-lowpass-1.png