prepare_analog_filter#
- gwpy.signal.filter_design.prepare_analog_filter( ) tuple[Literal['ba', 'zpk', 'sos'], BAType | ZpkType | SosType][source]#
Prepare an analog filter by parsing and converting units.
This handles:
Parsing filter specification
Converting Hz → rad/s for ZPK filters (if unit=’Hz’)
Applying gain normalization (if requested)
Does NOT:
Convert to digital
Extract gain for SOS
Apply prewarping
- Parameters:
- filt
filterspecification Filter as
(b, a),(z, p, k), sos array, orltiobject.- 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()).
Ignored when
unit='rad/s'.
- filt
- Returns:
- form
str Filter form:
'ba','zpk', or'sos'.- filt
tupleornumpy.ndarray Filter coefficients in the identified form.
- form
See also
prepare_digital_filterPrepare filter for digital filtering with prewarping and gain extraction.
parse_filterParse filter specification without unit conversion.