notch#
- gwpy.signal.filter_design.notch(
- frequency: QuantityLike,
- sample_rate: QuantityLike,
- type: Literal['iir'] = 'iir',
- output: Literal['zpk'] = 'zpk',
- **kwargs,
- gwpy.signal.filter_design.notch(
- frequency: QuantityLike,
- sample_rate: QuantityLike,
- type: Literal['iir'] = 'iir',
- output: Literal['ba'] = 'ba',
- **kwargs,
- gwpy.signal.filter_design.notch(
- frequency: QuantityLike,
- sample_rate: QuantityLike,
- type: Literal['iir'] = 'iir',
- output: Literal['sos'] = 'sos',
- **kwargs,
Design a ZPK notch filter for the given frequency and sampling rate.
- Parameters:
- frequency
float,Quantity Frequency (default in Hertz) at which to apply the notch.
- sample_rate
float,Quantity Number of samples per second for
TimeSeriesto which this notch filter will be applied.- type
str, optional, default: ‘iir’ Type of filter to apply, currently only ‘iir’ is supported.
- output
str, optional, default: ‘zpk’ Output format for notch.
- kwargs
Other keyword arguments to pass to
scipy.signal.iirdesign.
- frequency
- Returns:
filterThe formatted filter. The output format for an IIR filter depends on the input arguments, default is a tuple of
(zeros, poles, gain).
See also
scipy.signal.iirdesignFor details on the IIR filter design method and the output formats.
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 notch >>> n = notch(100, 4096)
To view the filter, you can use the
BodePlot:>>> from gwpy.plot import BodePlot >>> plot = BodePlot(n, sample_rate=4096) >>> plot.show()
(
png)