# audiofirfilter

audiofirfilter implements a 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.

## Example application

]|

## Hierarchy

    GObject
        ╰──GInitiallyUnowned
            ╰──GstObject
                ╰──GstElement
                    ╰──GstBaseTransform
                        ╰──GstAudioFilter
                            ╰──GstAudioFXBaseFIRFilter
                                ╰──audiofirfilter

## Factory details

Authors: – Sebastian Dröge

Classification: – `Filter/Effect/Audio`

Rank – none

Plugin – audiofx

Package – GStreamer Good Plug-ins

## Pad Templates

### `sink`

    audio/x-raw:
             format: { F32LE, F64LE }
               rate: [ 1, 2147483647 ]
           channels: [ 1, 2147483647 ]
             layout: interleaved

Presence – always

Direction – sink

Object type – GstPad

### `src`

    audio/x-raw:
             format: { F32LE, F64LE }
               rate: [ 1, 2147483647 ]
           channels: [ 1, 2147483647 ]
             layout: interleaved

Presence – always

Direction – src

Object type – GstPad

## Signals

### rate-changed

    rate_changed_callback (GstElement * filter,
                           gint rate,
                           gpointer udata)

    def rate_changed_callback (filter, rate, udata):
        #python callback for the 'rate-changed' signal

    function rate_changed_callback(filter: GstElement * filter, rate: gint rate, udata: gpointer udata): {
        // javascript callback for the 'rate-changed' signal
    }

Will be emitted when the sampling rate changes. The callbacks will be called from the streaming thread and processing will stop until the event is handled.

Parameters:

`filter` –

the filter on which the signal is emitted

`rate` –

the new sampling rate

`udata` –
No description available

Flags: Run Last

## Properties

### kernel

    “kernel” GValueArray *

Filter kernel for the FIR filter

Flags : Read / Write

### latency

    “latency” guint64

Filter latency in samples

Flags : Read / Write

Default value : 0

The results of the search are