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).
  Fossies Dox: gst-plugins-good-1.20.3.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

audiocheblimit.c File Reference
#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"
Include dependency graph for audiocheblimit.c:

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)
 

Macro Definition Documentation

◆ gst_audio_cheb_limit_parent_class

#define gst_audio_cheb_limit_parent_class   parent_class

Definition at line 95 of file audiocheblimit.c.

◆ GST_CAT_DEFAULT

#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.

Example launch line

|[ 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.

◆ GST_TYPE_AUDIO_CHEBYSHEV_FREQ_LIMIT_MODE

#define GST_TYPE_AUDIO_CHEBYSHEV_FREQ_LIMIT_MODE   (gst_audio_cheb_limit_mode_get_type ())

Definition at line 116 of file audiocheblimit.c.

Enumeration Type Documentation

◆ anonymous enum

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

anonymous enum
Enumerator
MODE_LOW_PASS 
MODE_HIGH_PASS 

Definition at line 110 of file audiocheblimit.c.

Function Documentation

◆ G_DEFINE_TYPE()

G_DEFINE_TYPE ( GstAudioChebLimit  ,
gst_audio_cheb_limit  ,
(gst_audio_fx_base_iir_filter_get_type())   
)

◆ generate_biquad_coefficients()

static void generate_biquad_coefficients ( GstAudioChebLimit filter,
gint  p,
gint  rate,
gdouble *  b0,
gdouble *  b1,
gdouble *  b2,
gdouble *  a1,
gdouble *  a2 
)
static

◆ generate_coefficients()

◆ gst_audio_cheb_limit_class_init()

◆ gst_audio_cheb_limit_finalize()

static void gst_audio_cheb_limit_finalize ( GObject *  object)
static

◆ gst_audio_cheb_limit_get_property()

static void gst_audio_cheb_limit_get_property ( GObject *  object,
guint  prop_id,
GValue *  value,
GParamSpec *  pspec 
)
static

◆ gst_audio_cheb_limit_init()

◆ gst_audio_cheb_limit_mode_get_type()

static GType gst_audio_cheb_limit_mode_get_type ( void  )
static

Definition at line 118 of file audiocheblimit.c.

References MODE_HIGH_PASS, and MODE_LOW_PASS.

◆ gst_audio_cheb_limit_set_property()

static void gst_audio_cheb_limit_set_property ( GObject *  object,
guint  prop_id,
const GValue *  value,
GParamSpec *  pspec 
)
static

◆ gst_audio_cheb_limit_setup()

static gboolean gst_audio_cheb_limit_setup ( GstAudioFilter *  filter,
const GstAudioInfo *  info 
)
static

◆ GST_DEBUG_CATEGORY_STATIC()

GST_DEBUG_CATEGORY_STATIC ( gst_audio_cheb_limit_debug  )

◆ GST_ELEMENT_REGISTER_DEFINE()

GST_ELEMENT_REGISTER_DEFINE ( audiocheblimit  ,
"audiocheblimit"  ,
GST_RANK_NONE  ,
(gst_audio_cheb_limit_get_type())   
)