gstlal 1.13.0
Loading...
Searching...
No Matches
python.pipeparts.filters Namespace Reference

Functions

pipetools.Element audio_cheb_band (pipetools.Pipeline pipeline, pipetools.Element src, float lower_frequency, float upper_frequency, int poles=8)
 Adds a audiochebband element to a pipeline with useful default properties.
pipetools.Element audio_cheb_limit (pipetools.Pipeline pipeline, pipetools.Element src, float cutoff, int mode=0, int poles=8, int type=1, float ripple=0.25)
 Adds a audiocheblimit element to a pipeline with useful default properties.
pipetools.Element caps (pipetools.Pipeline pipeline, pipetools.Element src, Union[str, pipetools.Caps] caps, **dict properties)
 Adds a capsfilter element to a pipeline with useful default properties.
pipetools.Element drop (pipetools.Pipeline pipeline, pipetools.Element src, int drop_samples=0)
 Adds a lal_whiten element to a pipeline with useful default properties.
pipetools.Element fir (pipetools.Pipeline pipeline, pipetools.Element src, pipetools.GValueArray kernel, latency, **dict properties)
 Adds a audiofirfilter element to a pipeline with useful default properties.
pipetools.Element gate (pipetools.Pipeline pipeline, pipetools.Element src, float threshold=None, pipetools.Element control=None, **properties)
 Adds a lal_gate element to a pipeline with useful default properties.
pipetools.Element iir (pipetools.Pipeline pipeline, pipetools.Element src, pipetools.ValueArray a, pipetools.ValueArray b)
 Adds a audioiirfilter element to a pipeline with useful default properties.
pipetools.Element remove_fake_disconts (pipetools.Pipeline pipeline, pipetools.Element src, bool silent=True)
 Adds a lal_nofakedisconts element to a pipeline with useful default properties.
pipetools.Element state_vector (pipetools.Pipeline pipeline, pipetools.Element src, **properties)
 Adds a lal_statevector element to a pipeline with useful default properties.
pipetools.Element inject (pipetools.Pipeline pipeline, pipetools.Element src, str filename)
 Adds a lal_simulation element to a pipeline with useful default properties.

Detailed Description

Module for filter elements

Function Documentation

◆ audio_cheb_band()

pipetools.Element audio_cheb_band ( pipetools.Pipeline pipeline,
pipetools.Element src,
float lower_frequency,
float upper_frequency,
int poles = 8 )

Adds a audiochebband element to a pipeline with useful default properties.

Attenuates all frequencies outside (bandpass) or inside (bandreject) of a frequency band. The number
    of poles and the ripple parameter control the rolloff. This element has the advantage over the windowed
    sinc bandpass and bandreject filter that it is much faster and produces almost as good results. It's only
    disadvantages are the highly non-linear phase and the slower rolloff compared to a windowed sinc filter
    with a large kernel. For type 1 the ripple parameter specifies how much ripple in dB is allowed in the
    passband, i.e. some frequencies in the passband will be amplified by that value. A higher ripple value
    will allow a faster rolloff. For type 2 the ripple parameter specifies the stopband attenuation. In the
    stopband the gain will be at most this value. A lower ripple value will allow a faster rolloff. As a
    special case, a Chebyshev type 1 filter with no ripple is a Butterworth filter.

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to which the new element will be added
        src:
            Gst.Element, the source element
        lower_frequency:
            float, Start frequency of the band (Hz)
        upper_frequency:
            float, Stop frequency of the band (Hz)
        poles:
            int, Number of poles to use, will be rounded up to the next multiple of four

    References:
        [1] https://gstreamer.freedesktop.org/documentation/audiofx/audiochebband.html?gi-language=python

    Returns:
        Element

Definition at line 20 of file filters.py.

◆ audio_cheb_limit()

pipetools.Element audio_cheb_limit ( pipetools.Pipeline pipeline,
pipetools.Element src,
float cutoff,
int mode = 0,
int poles = 8,
int type = 1,
float ripple = 0.25 )

Adds a audiocheblimit element to a pipeline with useful default properties.

Attenuates all frequencies above the cutoff frequency (low-pass) or all frequencies below the cutoff frequency (high-pass).
    The number of poles and the ripple parameter control the rolloff. This element has the advantage over the windowed sinc lowpass
    and highpass filter that it is much faster and produces almost as good results. It's only disadvantages are the highly non-linear
    phase and the slower rolloff compared to a windowed sinc filter with a large kernel. For type 1 the ripple parameter specifies
    how much ripple in dB is allowed in the passband, i.e. some frequencies in the passband will be amplified by that value. A higher
    ripple value will allow a faster rolloff. For type 2 the ripple parameter specifies the stopband attenuation. In the stopband the
    gain will be at most this value. A lower ripple value will allow a faster rolloff. As a special case, a Chebyshev type 1 filter
    with no ripple is a Butterworth filter.

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to which the new element will be added
        src:
            Gst.Element, the source element
        cutoff:
            float, Cut off frequency (Hz)
        mode:
            int, default 0, 0 for low-pass or 1 for high-pass
        poles:
            int, Number of poles to use, will be rounded up to the next multiple of four
        type:
            int, default 1, Type of the chebychev filter
        ripple:
            float, default 0,25, Amount of ripple (dB)

    References:
        [1] https://gstreamer.freedesktop.org/documentation/audiofx/audiocheblimit.html?gi-language=python

    Returns:
        Element

Definition at line 53 of file filters.py.

◆ caps()

pipetools.Element caps ( pipetools.Pipeline pipeline,
pipetools.Element src,
Union[str, pipetools.Caps] caps,
**dict properties )

Adds a capsfilter element to a pipeline with useful default properties.

The element does not modify data as such, but can enforce limitations on the data format.
    Note: this element does *not* act as a filter on the data of the source, but rather as a filter on the
    metadata (CAPS) of the source element.

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to which the new element will be added
        src:
            Gst.Element, the source element
        caps:
            str or Gst.Caps, the capabilities specification to limit the source data format
        **properties:
            dict, keyword arguments to be set as element properties

    References:
        [1] capsfilter docs: https://gstreamer.freedesktop.org/documentation/coreelements/capsfilter.html?gi-language=python

    Returns:
        Element, the source element limited by the given caps (capabilities)

Definition at line 89 of file filters.py.

◆ drop()

pipetools.Element drop ( pipetools.Pipeline pipeline,
pipetools.Element src,
int drop_samples = 0 )

Adds a lal_whiten element to a pipeline with useful default properties.

Drop samples from the start of a stream

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to which the new element will be added
        srcs:
            Iterable[Gst.Element], the source elements
        drop_samples:
            int, default 0, number of samples to drop from the beginning of a stream

    References:
        Implementation: gstlal/gst/lal/gstlal_drop.c

    Returns:
        Element

Definition at line 114 of file filters.py.

◆ fir()

pipetools.Element fir ( pipetools.Pipeline pipeline,
pipetools.Element src,
pipetools.GValueArray kernel,
latency,
**dict properties )

Adds a audiofirfilter element to a pipeline with useful default properties.

Generic audio FIR filter. Before usage the "kernel" property has to be set to the filter kernel that should be
    used and the "latency" property has to be set to the latency (in samples) that is introduced by the filter kernel.
    Setting a latency of n samples will lead to the first n samples being dropped from the output and n samples added
    to the end.

    The filter kernel describes the impulse response of the filter. To calculate the frequency response of the filter
    you have to calculate the Fourier Transform of the impulse response.

    To change the filter kernel whenever the sampling rate changes the "rate-changed" signal can be used. This should
    be done for most FIR filters as they're depending on the sampling rate.

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to which the new element will be added
        src:
            Gst.Element, the source element
        kernel:
            Gst.GValueArray, filter kernel for the FIR filter
        latency:
            int, filter latency in samples
        **properties:
            dict, keyword arguments to be set as element properties

    References:
        [1] audiofirfilter docs: https://gstreamer.freedesktop.org/documentation/audiofx/audiofirfilter.html?gi-language=python

    Returns:
        Element, the FIR element

Definition at line 135 of file filters.py.

◆ gate()

pipetools.Element gate ( pipetools.Pipeline pipeline,
pipetools.Element src,
float threshold = None,
pipetools.Element control = None,
** properties )

Adds a lal_gate element to a pipeline with useful default properties.

Flag buffers as gaps based on the value of a control input

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to which the new element will be added
        src:
            Gst.Element, the source element
        threshold:
            float, default None, uutput will be flagged as non-gap when magnitude of control input is >= this value.  See also invert-control.
        control:
            Element, optional control element input
        **properties:
            emit_signals:
                bool, Emit start and stop signals (rate-changed is always emited).  The start and stop signals
                are emited on gap-to-non-gap and non-gap-to-gap transitions in the output stream respectively.

    References:
        Implementation: gstlal/gst/lal/gstlal_gate.c

    Returns:
        Element

Definition at line 170 of file filters.py.

◆ iir()

pipetools.Element iir ( pipetools.Pipeline pipeline,
pipetools.Element src,
pipetools.ValueArray a,
pipetools.ValueArray b )

Adds a audioiirfilter element to a pipeline with useful default properties.

aGeneric audio IIR filter. Before usage the "a" and "b" properties have to be set to the filter coefficients
    that should be used.

    The filter coefficients describe the numerator and denominator of the transfer function.

    To change the filter coefficients whenever the sampling rate changes the "rate-changed" signal can be used.
    This should be done for most IIR filters as they're depending on the sampling rate.

        convention is z = \exp(-i 2 \pi f / f_{\rm sampling})
        H(z) = (\sum_{j=0}^{N} a_j z^{-j}) / (\sum_{j=0}^{N} (-1)^{j} b_j z^{-j})

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to which the new element will be added
        src:
            Gst.Element, the source element
        a:
            ValueArray, Filter coefficients (denominator of transfer function)
        b:
            ValueArray, Filter coefficients (numerator of transfer function)

    References:
        [1] audioiirfilter docs: https://gstreamer.freedesktop.org/documentation/audiofx/audioiirfilter.html?gi-language=python

    Returns:
        Element, IIR of the sources

Definition at line 206 of file filters.py.

◆ inject()

pipetools.Element inject ( pipetools.Pipeline pipeline,
pipetools.Element src,
str filename )

Adds a lal_simulation element to a pipeline with useful default properties.

An injection routine calling lalsimulation waveform generators

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to which the new element will be added
        src:
            Gst.Element, the source element
        filename:
            str, path to xml file Name of LIGO Light Weight XML file containing list(s) of software injections

    References:
        Implementation: gstlal/gst/lal/gstlal_simulation.c

    Returns:
        Element

Definition at line 280 of file filters.py.

◆ remove_fake_disconts()

pipetools.Element remove_fake_disconts ( pipetools.Pipeline pipeline,
pipetools.Element src,
bool silent = True )

Adds a lal_nofakedisconts element to a pipeline with useful default properties.

Fix incorrectly-set discontinuity flags

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to which the new element will be added
        srcs:
            Iterable[Gst.Element], the source elements
        silent:
            bool, default True, if True Don't print a message when alterning the flags in a buffer.

    References:
        Implementation: gstal/gst/lal/gstlal_nofakedisconts.c

    Returns:
        Element

Definition at line 239 of file filters.py.

◆ state_vector()

pipetools.Element state_vector ( pipetools.Pipeline pipeline,
pipetools.Element src,
** properties )

Adds a lal_statevector element to a pipeline with useful default properties.

Converts a state vector stream into booleans, for example to drive a lal_gate element.

    Args:
        pipeline:
            Gst.Pipeline, the pipeline to which the new element will be added
        src:
            Gst.Element, the source element
        **properties:

    References:
        Implementation: gstlal/gst/lal/gstlal_statevector.c

    Returns:
        Element

Definition at line 260 of file filters.py.