bandpass#
- gwpy.signal.filter_design.bandpass(
- flow: QuantityLike,
- fhigh: QuantityLike,
- sample_rate: QuantityLike,
- fstop: tuple[QuantityLike, QuantityLike] | None = None,
- gpass: float = 2,
- gstop: float = 30,
- type: Literal['iir'] = 'iir',
- output: Literal['zpk'] = 'zpk',
- **kwargs,
- gwpy.signal.filter_design.bandpass(
- flow: QuantityLike,
- fhigh: QuantityLike,
- sample_rate: QuantityLike,
- fstop: tuple[QuantityLike, QuantityLike] | None = None,
- gpass: float = 2,
- gstop: float = 30,
- type: Literal['iir'] = 'iir',
- output: Literal['ba'] = 'ba',
- **kwargs,
- gwpy.signal.filter_design.bandpass(
- flow: QuantityLike,
- fhigh: QuantityLike,
- sample_rate: QuantityLike,
- fstop: tuple[QuantityLike, QuantityLike] | None = None,
- gpass: float = 2,
- gstop: float = 30,
- type: Literal['iir'] = 'iir',
- output: Literal['sos'] = 'sos',
- **kwargs,
- gwpy.signal.filter_design.bandpass(
- flow: QuantityLike,
- fhigh: QuantityLike,
- sample_rate: QuantityLike,
- fstop: tuple[QuantityLike, QuantityLike] | None = None,
- gpass: float = 2,
- gstop: float = 30,
- type: Literal['fir'] = 'fir',
- **kwargs,
Design a band-pass filter for the given cutoff frequencies.
- Parameters:
- flow
float,Quantity Lower corner frequency of pass band.
- fhigh
float,Quantity Upper corner frequency of pass band.
- sample_rate
float,Quantity Sampling rate of target data.
- fstop
tupleoffloat (low, high)edge-frequencies of stop band.- gpass
float The maximum loss in the passband (dB).
- gstop
float The minimum attenuation in the stopband (dB).
- type
str The filter type, either
'iir'or'fir'.- output
str, optional, default:'zpk' The output format for an IIR filter, either
'zpk','ba', or'sos'.- kwargs
Other keyword arguments are passed directly to
iirdesign()orfirwin().
- flow
- Returns:
filterThe 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 band-pass filter for 100-1000 Hz for 4096 Hz-sampled data:
>>> from gwpy.signal.filter_design import bandpass >>> bp = bandpass(100, 1000, 4096)
To view the filter, you can use the
BodePlot:>>> from gwpy.plot import BodePlot >>> plot = BodePlot(bp, sample_rate=4096) >>> plot.show()
(
png)