gst-plugins-good
1.20.3
About: GStreamer (Good Plugins) is a library for constructing of graphs of media-handling components. A set of good-quality plug-ins (under LGPL license).
![]() ![]() |
#include <string.h>
#include <gst/gst.h>
#include <gst/base/gstbasetransform.h>
#include <gst/audio/audio.h>
#include <gst/audio/gstaudiofilter.h>
#include <math.h>
#include "math_compat.h"
#include "audiochebband.h"
#include "gst/glib-compat-private.h"
Go to the source code of this file.
Macros | |
#define | GST_CAT_DEFAULT gst_audio_cheb_band_debug |
#define | gst_audio_cheb_band_parent_class parent_class |
#define | GST_TYPE_AUDIO_CHEBYSHEV_FREQ_BAND_MODE (gst_audio_cheb_band_mode_get_type ()) |
Enumerations | |
enum | { PROP_0 , PROP_MODE , PROP_TYPE , PROP_LOWER_FREQUENCY , PROP_UPPER_FREQUENCY , PROP_RIPPLE , PROP_POLES } |
enum | { MODE_BAND_PASS = 0 , MODE_BAND_REJECT } |
Functions | |
GST_DEBUG_CATEGORY_STATIC (gst_audio_cheb_band_debug) | |
G_DEFINE_TYPE (GstAudioChebBand, gst_audio_cheb_band,(gst_audio_fx_base_iir_filter_get_type())) | |
GST_ELEMENT_REGISTER_DEFINE (audiochebband, "audiochebband", GST_RANK_NONE,(gst_audio_cheb_band_get_type())) | |
static void | gst_audio_cheb_band_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
static void | gst_audio_cheb_band_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
static void | gst_audio_cheb_band_finalize (GObject *object) |
static gboolean | gst_audio_cheb_band_setup (GstAudioFilter *filter, const GstAudioInfo *info) |
static GType | gst_audio_cheb_band_mode_get_type (void) |
static void | gst_audio_cheb_band_class_init (GstAudioChebBandClass *klass) |
static void | gst_audio_cheb_band_init (GstAudioChebBand *filter) |
static void | generate_biquad_coefficients (GstAudioChebBand *filter, gint p, gint rate, gdouble *b0, gdouble *b1, gdouble *b2, gdouble *b3, gdouble *b4, gdouble *a1, gdouble *a2, gdouble *a3, gdouble *a4) |
static void | generate_coefficients (GstAudioChebBand *filter, const GstAudioInfo *info) |
#define gst_audio_cheb_band_parent_class parent_class |
Definition at line 100 of file audiochebband.c.
#define GST_CAT_DEFAULT gst_audio_cheb_band_debug |
SECTION:element-audiochebband @title: audiochebband
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.
Be warned that a too large number of poles can produce noise. The most poles are possible with a cutoff frequency at a quarter of the sampling rate.
|[ gst-launch-1.0 audiotestsrc freq=1500 ! audioconvert ! audiochebband mode=band-pass lower-frequency=1000 upper-frequency=6000 poles=4 ! audioconvert ! alsasink gst-launch-1.0 filesrc location="melo1.ogg" ! oggdemux ! vorbisdec ! audioconvert ! audiochebband mode=band-reject lower-frequency=1000 upper-frequency=4000 ripple=0.2 ! audioconvert ! alsasink gst-launch-1.0 audiotestsrc wave=white-noise ! audioconvert ! audiochebband mode=band-pass lower-frequency=1000 upper-frequency=4000 type=2 ! audioconvert ! alsasink ]|
Definition at line 86 of file audiochebband.c.
#define GST_TYPE_AUDIO_CHEBYSHEV_FREQ_BAND_MODE (gst_audio_cheb_band_mode_get_type ()) |
Definition at line 121 of file audiochebband.c.
anonymous enum |
Enumerator | |
---|---|
PROP_0 | |
PROP_MODE | |
PROP_TYPE | |
PROP_LOWER_FREQUENCY | |
PROP_UPPER_FREQUENCY | |
PROP_RIPPLE | |
PROP_POLES |
Definition at line 89 of file audiochebband.c.
anonymous enum |
Enumerator | |
---|---|
MODE_BAND_PASS | |
MODE_BAND_REJECT |
Definition at line 115 of file audiochebband.c.
G_DEFINE_TYPE | ( | GstAudioChebBand | , |
gst_audio_cheb_band | , | ||
(gst_audio_fx_base_iir_filter_get_type()) | |||
) |
|
static |
Definition at line 213 of file audiochebband.c.
References asinh(), cosh(), _GstAudioChebBand::lower_frequency, _GstAudioChebBand::mode, MODE_BAND_PASS, _GstAudioChebBand::poles, _GstAudioChebBand::ripple, sinh(), t, _GstAudioChebBand::type, and _GstAudioChebBand::upper_frequency.
Referenced by generate_coefficients().
|
static |
Definition at line 393 of file audiochebband.c.
References generate_biquad_coefficients(), GST_AUDIO_FX_BASE_IIR_FILTER, gst_audio_fx_base_iir_filter_calculate_gain(), gst_audio_fx_base_iir_filter_set_coefficients(), _GstAudioChebBand::lower_frequency, _GstAudioChebBand::mode, MODE_BAND_PASS, MODE_BAND_REJECT, _GstAudioChebBand::poles, _GstAudioChebBand::ripple, _GstAudioChebBand::type, and _GstAudioChebBand::upper_frequency.
Referenced by gst_audio_cheb_band_set_property(), and gst_audio_cheb_band_setup().
|
static |
Definition at line 144 of file audiochebband.c.
References gst_audio_cheb_band_finalize(), gst_audio_cheb_band_get_property(), gst_audio_cheb_band_set_property(), gst_audio_cheb_band_setup(), GST_TYPE_AUDIO_CHEBYSHEV_FREQ_BAND_MODE, MODE_BAND_PASS, PROP_LOWER_FREQUENCY, PROP_MODE, PROP_POLES, PROP_RIPPLE, PROP_TYPE, and PROP_UPPER_FREQUENCY.
|
static |
Definition at line 563 of file audiochebband.c.
References GST_AUDIO_CHEB_BAND, _GstAudioChebBand::lock, and parent_class.
Referenced by gst_audio_cheb_band_class_init().
|
static |
Definition at line 622 of file audiochebband.c.
References GST_AUDIO_CHEB_BAND, _GstAudioChebBand::lower_frequency, _GstAudioChebBand::mode, _GstAudioChebBand::poles, PROP_LOWER_FREQUENCY, PROP_MODE, PROP_POLES, PROP_RIPPLE, PROP_TYPE, PROP_UPPER_FREQUENCY, _GstAudioChebBand::ripple, _GstAudioChebBand::type, and _GstAudioChebBand::upper_frequency.
Referenced by gst_audio_cheb_band_class_init().
|
static |
Definition at line 201 of file audiochebband.c.
References _GstAudioChebBand::lock, _GstAudioChebBand::lower_frequency, _GstAudioChebBand::mode, MODE_BAND_PASS, _GstAudioChebBand::poles, _GstAudioChebBand::ripple, _GstAudioChebBand::type, and _GstAudioChebBand::upper_frequency.
|
static |
Definition at line 123 of file audiochebband.c.
References MODE_BAND_PASS, and MODE_BAND_REJECT.
|
static |
Definition at line 573 of file audiochebband.c.
References generate_coefficients(), GST_AUDIO_CHEB_BAND, _GstAudioChebBand::lock, _GstAudioChebBand::lower_frequency, _GstAudioChebBand::mode, _GstAudioChebBand::poles, PROP_LOWER_FREQUENCY, PROP_MODE, PROP_POLES, PROP_RIPPLE, PROP_TYPE, PROP_UPPER_FREQUENCY, _GstAudioChebBand::ripple, _GstAudioChebBand::type, and _GstAudioChebBand::upper_frequency.
Referenced by gst_audio_cheb_band_class_init().
|
static |
Definition at line 655 of file audiochebband.c.
References generate_coefficients(), GST_AUDIO_CHEB_BAND, and parent_class.
Referenced by gst_audio_cheb_band_class_init().
GST_DEBUG_CATEGORY_STATIC | ( | gst_audio_cheb_band_debug | ) |
GST_ELEMENT_REGISTER_DEFINE | ( | audiochebband | , |
"audiochebband" | , | ||
GST_RANK_NONE | , | ||
(gst_audio_cheb_band_get_type()) | |||
) |