Transfer Function Effect

Effects, Recipes, Interfacing with other software, etc.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
KUppiano
Posts: 6
Joined: Sat Jan 26, 2013 6:30 am
Operating System: Please select

Transfer Function Effect

Post by KUppiano » Sat Feb 16, 2013 9:19 pm

Sometimes, a person might want to process recorded audio with a particular transfer function in the time domain, either for a particular effect, or for research. For example, I want to experiment with crossover distortion, which would compress the samples near the zero crossing. Or I might want to simulate a particular type of distortion, such as one might get from a particular kind of guitar amplifier.

If a person knew the kind of transfer function they wanted, they could simply draw it in, freehand with the mouse. Or, one might use a Bezier or curve-fit tool to help the user produce the desired result. It might be worthwhile for users to be able to enter or select from algebraic expressions as well (exponential, trignonometric, etc.)

Often, the transfer function in the third quadrant would mirror the first quadrant (e.g., class B or class A-B behavior), but to simulate single-ended or class A behavior, a full range function might be desired (i.e, everything is in the first quadrant -- actually just a y-intercept offset).

Note that effects such as clippers and amplifiers are a predefined (although adjustable) form of this tool. An amplifier has a linear transfer function with an adjustable slope. A clipper has a linear transfer function with a slope of 1 up to an adjustable clip level, where the slope becomes zero. I'm envisioning an arbitrary transfer function.

Users should be able to save and load their transfer functions. Some presets might be interesting, and possibly products in their own right. For example, if someone came up with a really great Vox or Marshall Amp transfer function or whatever, that they could share with the community.

Since transfer function non-linearity can produce aliasing effects, oversampling calculations with a lowpass filter might be necessary, although a person should be able to adjust it or switch it off, if aliasing is what they want.

I have searched for this type of tool or add-in for Audacity, but have not found one. Does such a thing exist?

kozikowski
Forum Staff
Posts: 68938
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Transfer Function Effect

Post by kozikowski » Sun Feb 17, 2013 12:28 am

I'm used to using the video and Photoshop version of this tool, so I know exactly what you want, but I don't think Audacity has anything even close.
Attachments
Screen shot 2013-02-16 at 4.22.55 PM.png
Screen shot 2013-02-16 at 4.22.55 PM.png (30.29 KiB) Viewed 1774 times

KUppiano
Posts: 6
Joined: Sat Jan 26, 2013 6:30 am
Operating System: Please select

Re: Transfer Function Effect

Post by KUppiano » Sun Feb 17, 2013 1:56 am

Yes, I think the UI would be quite similar for drawing the transfer function. ~ Karl

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Transfer Function Effect

Post by steve » Sun Feb 17, 2013 3:24 am

kozikowski wrote:I'm used to using the video and Photoshop version of this tool, so I know exactly what you want, but I don't think Audacity has anything even close.
Audacity has something far more versatile and powerful, but it's not graphical:
http://wiki.audacityteam.org/wiki/Nyqui ... _Reference
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: Transfer Function Effect

Post by Robert J. H. » Sun Feb 17, 2013 5:46 am

I have the same opinion as Steve.
There are quite a few plug-ins that translate transfer functions into first or second order Biquads for example.
Although it is theoretically imaginable that such a function could be directly entered into a textbox (H=a*z(n)...) it appears to me rather unintuitive.
There are so many rules to have in mind that going the direct way over specialized functions is often better, e.g. the shape function for wave shaping.
For example, I am working on a simple distortion plug-in that lets you move the peak of a waveform to the left and right (e.g. a sawtooth becomes a triangle). That's rather hard to put into a transfer function when you apply simultanuously soft clipping and leveling.
However, if you should stumble accidentely over a special transfer function, please post it here in the forum.

steve
Site Admin
Posts: 80752
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Transfer Function Effect

Post by steve » Sun Feb 17, 2013 10:36 am

KUppiano wrote:with a particular transfer function in the time domain,
There's the problem; the "particular" transfer function could be anything. Unless someone can come up with a very clever interface I would expect that by necessity a GUI effect would be limited to specific types of transfer functions.

KUppiano wrote:I want to experiment with crossover distortion, which would compress the samples near the zero crossing.
Here's a little script that you can run in the Nyquist Prompt effect.
Copy and paste this script into the text box of the Nyquist Prompt effect and apply.
The first three lines set the crossover thresholds and the amount of distortion. Change the values in these three lines as required.

Code: Select all

(setq low -0.2) ; lower crossover non-linear threshold
(setq high 0.2) ; upper crossover non-linear threshold
(setq amount 0.8) ; amount of distortion on scale 0 to 1

(setq d0 (* (- 1 amount) low))
(setq d1 (* (- 1 amount) high))
(setq low (1+ low))
(setq high (1+ high))
(setf tf (abs-env (pwlv -1 low d0 high  d1 2 1)))
(multichan-expand #'shape s tf 1)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

Post Reply