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 "audiocheblimit.h"
#include "gst/glib-compat-private.h"
Go to the source code of this file.
Macros | |
#define | GST_CAT_DEFAULT gst_audio_cheb_limit_debug |
#define | gst_audio_cheb_limit_parent_class parent_class |
#define | GST_TYPE_AUDIO_CHEBYSHEV_FREQ_LIMIT_MODE (gst_audio_cheb_limit_mode_get_type ()) |
Enumerations | |
enum | { PROP_0 , PROP_MODE , PROP_TYPE , PROP_CUTOFF , PROP_RIPPLE , PROP_POLES } |
enum | { MODE_LOW_PASS = 0 , MODE_HIGH_PASS } |
Functions | |
GST_DEBUG_CATEGORY_STATIC (gst_audio_cheb_limit_debug) | |
G_DEFINE_TYPE (GstAudioChebLimit, gst_audio_cheb_limit,(gst_audio_fx_base_iir_filter_get_type())) | |
GST_ELEMENT_REGISTER_DEFINE (audiocheblimit, "audiocheblimit", GST_RANK_NONE,(gst_audio_cheb_limit_get_type())) | |
static void | gst_audio_cheb_limit_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) |
static void | gst_audio_cheb_limit_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) |
static void | gst_audio_cheb_limit_finalize (GObject *object) |
static gboolean | gst_audio_cheb_limit_setup (GstAudioFilter *filter, const GstAudioInfo *info) |
static GType | gst_audio_cheb_limit_mode_get_type (void) |
static void | gst_audio_cheb_limit_class_init (GstAudioChebLimitClass *klass) |
static void | gst_audio_cheb_limit_init (GstAudioChebLimit *filter) |
static void | generate_biquad_coefficients (GstAudioChebLimit *filter, gint p, gint rate, gdouble *b0, gdouble *b1, gdouble *b2, gdouble *a1, gdouble *a2) |
static void | generate_coefficients (GstAudioChebLimit *filter, const GstAudioInfo *info) |
#define gst_audio_cheb_limit_parent_class parent_class |
Definition at line 95 of file audiocheblimit.c.
#define GST_CAT_DEFAULT gst_audio_cheb_limit_debug |
SECTION:element-audiocheblimit @title: audiocheblimit
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.
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 ! audiocheblimit mode=low-pass cutoff=1000 poles=4 ! audioconvert ! alsasink gst-launch-1.0 filesrc location="melo1.ogg" ! oggdemux ! vorbisdec ! audioconvert ! audiocheblimit mode=high-pass cutoff=400 ripple=0.2 ! audioconvert ! alsasink gst-launch-1.0 audiotestsrc wave=white-noise ! audioconvert ! audiocheblimit mode=low-pass cutoff=800 type=2 ! audioconvert ! alsasink ]|
Definition at line 82 of file audiocheblimit.c.
#define GST_TYPE_AUDIO_CHEBYSHEV_FREQ_LIMIT_MODE (gst_audio_cheb_limit_mode_get_type ()) |
Definition at line 116 of file audiocheblimit.c.
anonymous enum |
Enumerator | |
---|---|
PROP_0 | |
PROP_MODE | |
PROP_TYPE | |
PROP_CUTOFF | |
PROP_RIPPLE | |
PROP_POLES |
Definition at line 85 of file audiocheblimit.c.
anonymous enum |
Enumerator | |
---|---|
MODE_LOW_PASS | |
MODE_HIGH_PASS |
Definition at line 110 of file audiocheblimit.c.
G_DEFINE_TYPE | ( | GstAudioChebLimit | , |
gst_audio_cheb_limit | , | ||
(gst_audio_fx_base_iir_filter_get_type()) | |||
) |
|
static |
Definition at line 205 of file audiocheblimit.c.
References asinh(), cosh(), _GstAudioChebLimit::cutoff, _GstAudioChebLimit::mode, MODE_HIGH_PASS, MODE_LOW_PASS, _GstAudioChebLimit::poles, _GstAudioChebLimit::ripple, sinh(), t, and _GstAudioChebLimit::type.
Referenced by generate_coefficients().
|
static |
Definition at line 347 of file audiocheblimit.c.
References _GstAudioChebLimit::cutoff, 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(), _GstAudioChebLimit::mode, MODE_LOW_PASS, _GstAudioChebLimit::poles, _GstAudioChebLimit::ripple, and _GstAudioChebLimit::type.
Referenced by gst_audio_cheb_limit_set_property(), and gst_audio_cheb_limit_setup().
|
static |
Definition at line 139 of file audiocheblimit.c.
References gst_audio_cheb_limit_finalize(), gst_audio_cheb_limit_get_property(), gst_audio_cheb_limit_set_property(), gst_audio_cheb_limit_setup(), GST_TYPE_AUDIO_CHEBYSHEV_FREQ_LIMIT_MODE, MODE_LOW_PASS, PROP_CUTOFF, PROP_MODE, PROP_POLES, PROP_RIPPLE, and PROP_TYPE.
|
static |
Definition at line 486 of file audiocheblimit.c.
References GST_AUDIO_CHEB_LIMIT, _GstAudioChebLimit::lock, and parent_class.
Referenced by gst_audio_cheb_limit_class_init().
|
static |
Definition at line 539 of file audiocheblimit.c.
References _GstAudioChebLimit::cutoff, GST_AUDIO_CHEB_LIMIT, _GstAudioChebLimit::mode, _GstAudioChebLimit::poles, PROP_CUTOFF, PROP_MODE, PROP_POLES, PROP_RIPPLE, PROP_TYPE, _GstAudioChebLimit::ripple, and _GstAudioChebLimit::type.
Referenced by gst_audio_cheb_limit_class_init().
|
static |
Definition at line 193 of file audiocheblimit.c.
References _GstAudioChebLimit::cutoff, _GstAudioChebLimit::lock, _GstAudioChebLimit::mode, MODE_LOW_PASS, _GstAudioChebLimit::poles, _GstAudioChebLimit::ripple, and _GstAudioChebLimit::type.
|
static |
Definition at line 118 of file audiocheblimit.c.
References MODE_HIGH_PASS, and MODE_LOW_PASS.
|
static |
Definition at line 496 of file audiocheblimit.c.
References _GstAudioChebLimit::cutoff, generate_coefficients(), GST_AUDIO_CHEB_LIMIT, _GstAudioChebLimit::lock, _GstAudioChebLimit::mode, _GstAudioChebLimit::poles, PROP_CUTOFF, PROP_MODE, PROP_POLES, PROP_RIPPLE, PROP_TYPE, _GstAudioChebLimit::ripple, and _GstAudioChebLimit::type.
Referenced by gst_audio_cheb_limit_class_init().
|
static |
Definition at line 569 of file audiocheblimit.c.
References generate_coefficients(), GST_AUDIO_CHEB_LIMIT, and parent_class.
Referenced by gst_audio_cheb_limit_class_init().
GST_DEBUG_CATEGORY_STATIC | ( | gst_audio_cheb_limit_debug | ) |
GST_ELEMENT_REGISTER_DEFINE | ( | audiocheblimit | , |
"audiocheblimit" | , | ||
GST_RANK_NONE | , | ||
(gst_audio_cheb_limit_get_type()) | |||
) |