highpass#

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

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

Parameters:
frequencyfloat, Quantity

Corner frequency of high-pass filter.

sample_ratefloat, Quantity

Sampling rate of target data.

fstopfloat

Edge-frequency of stop-band.

gpassfloat

The maximum loss in the passband (dB)

gstopfloat

The minimum attenuation in the stopband (dB).

typestr

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 high-pass filter at 100 Hz for 4096 Hz-sampled data:

>>> from gwpy.signal.filter_design import highpass
>>> hp = highpass(100, 4096)

To view the filter, you can use the BodePlot:

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

(png)

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