frequency_response#
- gwpy.signal.filter_design.frequency_response(
- filt: FilterCompatible,
- frequencies: NDArray | int | None,
- *,
- analog: bool = False,
- sample_rate: QuantityLike = 1.0,
- unit: str | UnitBase = 'rad/s',
- normalize_gain: bool = False,
Compute the frequency response of a filter at given frequencies.
- Parameters:
- filt
FilterCompatible Filter definition in one of the supported formats.
- frequencies
numpy.ndarray Frequencies (in Hz) at which to compute the response.
- analog
bool, optional - sample_rate
astropy.units.Quantity-like, optional Sample rate of the digital data (only used if
analogisFalse).- unit
str, optional For analogue ZPK filters, the units in which the zeros and poles are specified. Either
'Hz'or'rad/s'(default).- normalize_gain
bool, optional Whether to normalize the gain when converting from Hz to rad/s.
False(default): Multiply zeros/poles by -2π but leave gain unchanged. This matches the LIGO GDS ‘f’ plane convention (plane='f'ins2z()).True: Normalize gain to preserve frequency response magnitude. Gain is scaled by \(|∏p_i/∏z_i| · (2π)^{(n_p - n_z)}\). Use this when your filter was designed with the transfer function \(H(f) = k·∏(f-z_i)/∏(f-p_i)\) in Hz. This matches the LIGO GDS ‘n’ plane convention (plane='n'ins2z()).
Only used for analogue filters in Hz (
analog=True, unit="Hz").
- filt
- Returns:
- frequencies
numpy.ndarray Frequencies at which the response was computed. If
analog=True, unit='rad/s', these are in rad/s, otherwise they are in Hz.- response
numpy.ndarray Frequency response of the filter at the given frequencies.
- frequencies