After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 794774 - contributing an easy-to-use IIR audio filter via LADSPA ACDf plugin
contributing an easy-to-use IIR audio filter via LADSPA ACDf plugin
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
http://audio.claub.net/LADSPA-plugins...
Depends on:
Blocks:
 
 
Reported: 2018-03-28 16:59 UTC by Charlie Laub
Modified: 2018-11-03 14:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Charlie Laub 2018-03-28 16:59:33 UTC
I am the developer of a LADSPA plugin known as "ACDf". It can implement all of the following filter types via 7 named parameters:

ACDf filter types and their required parameters:
TYPE   DESCRIPTION                 REQUIRED PARAMETERS
 0     gain block                  dB_gain, polarity 
 1     1st order LP                dB_gain, polarity, Fp
 2     1st order HP                dB_gain, polarity, Fp
 3     1st order AP                polarity, Fp
 4     1st low shelf               Fp, dB_gain
 5     1st high shelf              Fp, dB_gain
21     2nd order LP                dB_gain, polarity, Fp, Qp, 
22     2nd order HP                dB_gain, polarity, Fp, Qp
23     2nd order AP                polarity, Fp, Qp
24     2nd order low shelf         dB_gain, polarity, Fp, Qp
25     2nd order high shelf        dB_gain, polarity, Fp, Qp
26     parametric EQ, digital form dB_gain, Fp, Qp
27     2nd order notch             dB_gain, polarity, Fp, Qp, Fz
28     biquadratic filter          dB_gain, polarity, Fp, Qp, Fz, Qz

The ACDf LADSPA plugin is available under a GPL3 license and is becoming quite popular in the DIY audio community. It can be downloaded with its supporting documentation, bundled with a couple other plugins I wrote, from this web page:
http://audio.claub.net/LADSPA-plugins.html

I am currently implementing ACDf via gstreamer's LADSPA plugin capabilities, however, I think that it would make IIR filtering must easier for users if it was incorporated into gstreamer itself as a gstreamer element. The current IIR filtering plugin, audioiirfilter, requires arrays of the transfer coefficients as parameters. This is not easy for most users to calculate and these cannot be supplied via gst-launch. 

ACDf has 7 named parameters, e.g.:

PARAMETER     WHAT IT DOES
filter_type:  indicates which filter type to implement (see below)
dB_gain:      passband gain for the filter in dB
polarity:     -1 reverses polarity. polarity is unchanged for any other number
Fop:          sets the frequency of the filter pole in Hz 
Qp:           sets the Q factor of the filter pole 
Foz:          sets the frequency of the filter zero in Hz 
Qz:           sets the Q factor of the filter zero

As described above, not all parameters are required for every filter type. Using these parameters to describing a filter will be more familiar to users, and easier to implement, compared to transfer coefficients. 

I would like to contribute the code from ACDf (written in C++) to the gstreamer project. It's available at the link provided above. I have no experience creating plugins for gstreamer or working on gstreamer code, so I can't create a patch or commit myself. I would be happy to work with someone who can, and perhaps it is not difficult under the existing LADSPA interface in gstreamer. 

If this is of interest, please post a follow up or contact me. Thanks,

Charlie Laub
Comment 1 Nicolas Dufresne (ndufresne) 2018-03-28 18:13:37 UTC
(In reply to Charlie Laub from comment #0)
> I am the developer of a LADSPA plugin known as "ACDf". It can implement all
> of the following filter types via 7 named parameters:
> 
> ACDf filter types and their required parameters:
> TYPE   DESCRIPTION                 REQUIRED PARAMETERS
>  0     gain block                  dB_gain, polarity 
>  1     1st order LP                dB_gain, polarity, Fp
>  2     1st order HP                dB_gain, polarity, Fp
>  3     1st order AP                polarity, Fp
>  4     1st low shelf               Fp, dB_gain
>  5     1st high shelf              Fp, dB_gain
> 21     2nd order LP                dB_gain, polarity, Fp, Qp, 
> 22     2nd order HP                dB_gain, polarity, Fp, Qp
> 23     2nd order AP                polarity, Fp, Qp
> 24     2nd order low shelf         dB_gain, polarity, Fp, Qp
> 25     2nd order high shelf        dB_gain, polarity, Fp, Qp
> 26     parametric EQ, digital form dB_gain, Fp, Qp
> 27     2nd order notch             dB_gain, polarity, Fp, Qp, Fz
> 28     biquadratic filter          dB_gain, polarity, Fp, Qp, Fz, Qz
> 
> The ACDf LADSPA plugin is available under a GPL3 license and is becoming
> quite popular in the DIY audio community. It can be downloaded with its
> supporting documentation, bundled with a couple other plugins I wrote, from
> this web page:
> http://audio.claub.net/LADSPA-plugins.html

GPLv3 (and LGPLv3) is a bit problematic for the GStreamer Project. If it's a LADPSA (or lv2) plugin, it's not our problem, but when its in our code base, it is. We only accept contribution under LGPLv2 or looser licence.

> 
> I am currently implementing ACDf via gstreamer's LADSPA plugin capabilities,
> however, I think that it would make IIR filtering must easier for users if
> it was incorporated into gstreamer itself as a gstreamer element. The
> current IIR filtering plugin, audioiirfilter, requires arrays of the
> transfer coefficients as parameters. This is not easy for most users to
> calculate and these cannot be supplied via gst-launch. 

That specific aspect can likely be solved now that GstValueList can be used from properties. But it does not solve the complexity problem.

> 
> ACDf has 7 named parameters, e.g.:
> 
> PARAMETER     WHAT IT DOES
> filter_type:  indicates which filter type to implement (see below)
> dB_gain:      passband gain for the filter in dB
> polarity:     -1 reverses polarity. polarity is unchanged for any other
> number
> Fop:          sets the frequency of the filter pole in Hz 
> Qp:           sets the Q factor of the filter pole 
> Foz:          sets the frequency of the filter zero in Hz 
> Qz:           sets the Q factor of the filter zero
> 
> As described above, not all parameters are required for every filter type.
> Using these parameters to describing a filter will be more familiar to
> users, and easier to implement, compared to transfer coefficients. 

Even though I'm not expert, I agree that it looks much more manageable then what we have.

> 
> I would like to contribute the code from ACDf (written in C++) to the
> gstreamer project. It's available at the link provided above. I have no
> experience creating plugins for gstreamer or working on gstreamer code, so I
> can't create a patch or commit myself. I would be happy to work with someone
> who can, and perhaps it is not difficult under the existing LADSPA interface
> in gstreamer. 
> 
> If this is of interest, please post a follow up or contact me. Thanks,

Importing code from ACDf, as it's GPLv3 is just not possible without written approval to relicence from the original authors.

A second venue, if the existing IIR implementation is suitable of course, would be to introduce these proporties into the existing audioiirfilter, plus one property that let user choose between the matrix and these properties. Then you can do internally the transformation.
Comment 2 Charlie Laub 2018-03-28 19:20:27 UTC
> GPLv3 (and LGPLv3) is a bit problematic for the GStreamer Project. If it's a
> LADPSA (or lv2) plugin, it's not our problem, but when its in our code base,
> it is. We only accept contribution under LGPLv2 or looser licence.

I am the sole author. It's no problem changing or even removing the licensing for ACDf. 

Getting this kind of IIR filter interface into gstreamer outweighs any concerns regarding usage, private or commercial, as long as my name is attributed to the contribution.

> Even though I'm not expert, I agree that it looks much more manageable then
> what we have.

Right. Not only more managable, but easier to understand. In the end, it's the same thing: the 7 input parameters for ACDf are used to calculate the transfer function coefficients. In essence you could consider ACDf to be a "wrapper" for audioiirfilter in that the the 7 parameters are converted into transfer function coefficients, which are then passed to the existing code within audioiirfilter. There is no need to reinvent the wheel.

> Importing code from ACDf, as it's GPLv3 is just not possible without written
> approval to relicence from the original authors.

As I mentioned above, I am the sole author.

> A second venue, if the existing IIR implementation is suitable of course,
> would be to introduce these proporties into the existing audioiirfilter,
> plus one property that let user choose between the matrix and these
> properties. Then you can do internally the transformation.

That's certainly a possibility, perhaps with a new audioiirfilter property e.g.:
input-mode = [ ACDf || transfer-function ]


.
Comment 3 Charlie Laub 2018-03-30 17:05:21 UTC
So, if I have removed the concerns about licensing, and if as you say this seems like an easier and more accessible way to allow the user to make use of the existing audioiirfilter element, can we move forward?

I am happy to outline the lines of code within ACDf that is required. It's not all that many lines, really.

I think this will be very well received in the audio community, and will encourage people to migrate to gstreamer from other audio DSP platforms. It will be especially powerful if the audioiitfilter element is supported under Windows, where LADSPA plugins are not so easily compiled and where support is very limited.
Comment 4 Edward Hervey 2018-05-05 14:46:42 UTC
(Moving to gst-plugins-bad, which is where new plugins should go)
Comment 5 GStreamer system administrator 2018-11-03 14:19:49 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/issues/673.