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)  

audiochebband.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 "audiochebband.h"
#include "gst/glib-compat-private.h"
Include dependency graph for audiochebband.c:

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)
 

Macro Definition Documentation

◆ gst_audio_cheb_band_parent_class

#define gst_audio_cheb_band_parent_class   parent_class

Definition at line 100 of file audiochebband.c.

◆ GST_CAT_DEFAULT

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

Example launch line

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

◆ GST_TYPE_AUDIO_CHEBYSHEV_FREQ_BAND_MODE

#define GST_TYPE_AUDIO_CHEBYSHEV_FREQ_BAND_MODE   (gst_audio_cheb_band_mode_get_type ())

Definition at line 121 of file audiochebband.c.

Enumeration Type Documentation

◆ anonymous enum

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

anonymous enum
Enumerator
MODE_BAND_PASS 
MODE_BAND_REJECT 

Definition at line 115 of file audiochebband.c.

Function Documentation

◆ G_DEFINE_TYPE()

G_DEFINE_TYPE ( GstAudioChebBand  ,
gst_audio_cheb_band  ,
(gst_audio_fx_base_iir_filter_get_type())   
)

◆ generate_biquad_coefficients()

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

◆ generate_coefficients()

◆ gst_audio_cheb_band_class_init()

◆ gst_audio_cheb_band_finalize()

static void gst_audio_cheb_band_finalize ( GObject *  object)
static

◆ gst_audio_cheb_band_get_property()

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

◆ gst_audio_cheb_band_init()

◆ gst_audio_cheb_band_mode_get_type()

static GType gst_audio_cheb_band_mode_get_type ( void  )
static

Definition at line 123 of file audiochebband.c.

References MODE_BAND_PASS, and MODE_BAND_REJECT.

◆ gst_audio_cheb_band_set_property()

◆ gst_audio_cheb_band_setup()

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

◆ GST_DEBUG_CATEGORY_STATIC()

GST_DEBUG_CATEGORY_STATIC ( gst_audio_cheb_band_debug  )

◆ GST_ELEMENT_REGISTER_DEFINE()

GST_ELEMENT_REGISTER_DEFINE ( audiochebband  ,
"audiochebband"  ,
GST_RANK_NONE  ,
(gst_audio_cheb_band_get_type())   
)