How to deliberately create THD

For general discussions related to SynthMaker.

Moderators: electrogear, exonerate

How to deliberately create THD

Postby rocko on Thu Jun 28, 2012 5:33 am

Dear all,

I'm interested in deliberately creating controlled THD.

That is to take any signal and produce higher harmonics out of it, odd or even harmonics.

I'm interestead in this for "saturation modelling" and such.

Any efficient way besides finding the frequency and creating higher harmonics synthetically?

Thanks,
Rocko
Last edited by rocko on Thu Jun 28, 2012 6:13 am, edited 1 time in total.
rocko
essemist
 
Posts: 59
Joined: Mon Dec 07, 2009 5:25 pm

Re: How to delberately create THD

Postby Dell on Thu Jun 28, 2012 6:13 am

THD is based on a signal that is overdriven. The stock plug-in labelled "Overdrive" will give you an idea what an audio signal will sound like using various settings of the control knob. The Harmonics is based on peaks of the audio signal and varies from song to song.

The peaks are frequency driven and co-respond to the initial frequency note however, at a lower dB level than the initial frequency note being excited.

Bear in mind saturation and THD do not sound the same. THD is more to wards an amplifier being heavily clipped whereas saturation is some means of tape deteriorating.
Last edited by Dell on Thu Jun 28, 2012 6:15 am, edited 1 time in total.
Dell
essemilian
 
Posts: 474
Joined: Sat Sep 26, 2009 6:45 pm
Location: New York

Re: How to deliberately create THD

Postby rocko on Thu Jun 28, 2012 6:15 am

Thanks, I'll look into this.
rocko
essemist
 
Posts: 59
Joined: Mon Dec 07, 2009 5:25 pm

Re: How to deliberately create THD

Postby treacherousumbrella on Thu Jun 28, 2012 8:04 am

When the signal is overdriven the addition of harmonics will result. The specific mix of harmonics generated is highly dependant on how the system overdrives. Hard clipping (flatline) distortion is commonly found in digital systems and will produce only odd harmonics. Assymetric distortion produces a mix of odd and even. A good first step would be to pass a sine wave through the system you are attempting to model and analyse both the waveform and frequency response of the result.
treacherousumbrella
essemist
 
Posts: 65
Joined: Mon Oct 04, 2010 4:44 pm

Re: How to deliberately create THD

Postby rocko on Thu Jun 28, 2012 8:23 am

Hi,

Let's say I'm trying to model a tube compressor (I'm not, just learning and inquiring, but OK).

First stage - imitating the amplitude curve:
I'll measure the dynamic range curve and "imitate it" in digital domain.
Now I get a "natural" by-product THD simply due to the fact that I use a non-linear amplitude curve. Right?
This is true to any compressor - clean as can be.
It's a "mathematical THD" which can not be avoided, right?

second stage - imitating the added THD:
Now I'm trying to add the "tube" THD - without reshaping the amplitude curve.
How is this done?

Thanks
rocko
essemist
 
Posts: 59
Joined: Mon Dec 07, 2009 5:25 pm

Re: How to deliberately create THD

Postby trogluddite on Thu Jun 28, 2012 2:44 pm

rocko wrote:Bear in mind saturation and THD do not sound the same

Not strictly speaking true.
THD is not any particular sound - it is a scientific measure of how much the output sound differs in harmonic content from the input sound. Its main use is to provide a means of describing any unintended consequences of processing a signal, so that you can judge the quality of the engineering - i.e. a pre-amplifier with very low THD gives a more accurate rendering of the signal coming from a mic.
THD also tells you nothing about the spectrum of the added (or removed) harmonics that make the output sound different - it is a weighted total of all of the harmonics, when tested with a calibrated test signal. Which is why it is called 'Total Harmonic Distortion'.
So the accurate answer to 'how do I create deliberate THD' is to do just about anything to the signal that changes it (except for a pure gain change).

OK, OK, sorry, I am being pedantic and I sound like your boring science teacher at school - not very useful for what you are after - lecture over ;)

Different kinds of distortion will give you different kinds and amounts of added harmonics.
The two biggest factors to play with, I would say, are...
1) The 'severity' of distortion - i.e. do you just 'bend' or 'round off' the waveform, or at the other extreme, just hard clip it to make a very 'angular' shape.
2) Symmetry - distorting the positive and negative halves of a wave in different ways or by different amounts will sound very different than if they are both distorted in the same way.

For valve simulation there is also another big factor that often comes into play - compression. When you drive a valve hard, it has a lot more work to do, which leads to some gain reduction that doesn't just change the shape of individual wave cycles - it acts over a slightly longer period of time (but not as usually slow as common compressor settings).
So to get a nice valve simulation, you will probably need more than one stage of processing to get the complete sound.
Feel free to use any schematics and algorithms I post on the forum in your own designs - a credit is appreciated (but not a requirement).
Don't stagnate, mutate to create. Without randomness and serendipity the earth would be just another barren rock.
User avatar
trogluddite
smychopath
 
Posts: 3027
Joined: Mon Oct 20, 2008 3:52 pm
Location: Yorkshire, UK

Re: How to deliberately create THD

Postby rocko on Thu Jun 28, 2012 2:46 pm

Thanks trog !
rocko
essemist
 
Posts: 59
Joined: Mon Dec 07, 2009 5:25 pm

Re: How to deliberately create THD

Postby Dell on Fri Jun 29, 2012 2:08 am

Any audio hardware product can/will distort based on the following things.

The Power Supply

The Input Section

The Output Section

Various components in between

All four are stressed under various conditions and will contribute to the sound.

Valves vary considerably on how they will react under the given conditions. This applies to semiconductors as well. From my experience using valves, achieving a sound of audio equipment using valves requires a lot of measuring on all aspects of the component. Valves are very unpredictable and are never 100% accurate.

This is due to the errors valves bring forth in addition to the other components (which cannot be emulated in a plug-in) contributing to the sound.

If you were planning to pursue such a project, it would be best to own some type of valve equipment. There are lots of valve emulations running about that sound more to wards a small transistor radio than valve audio equipment.

Be careful of making your design offering too much characteristics as hardware if you plan to offer it to the public. The majority of users wanting the valve sound do not have any experience using hardware equipment. If the characteristics are too realistic you will find yourself explaining numerous times how to use your design due to the user assuming your design is going to work just as the typical vst plug-in.
Dell
essemilian
 
Posts: 474
Joined: Sat Sep 26, 2009 6:45 pm
Location: New York

Re: How to deliberately create THD

Postby rocko on Fri Jun 29, 2012 8:16 am

Hi,

Thanks for the detailed response.

I'm more into the theoretical sound of how to create THD which is not a side effect of dynamic range compression.

By this I mean, how to create extra harmonics (i.e related to the fundamental of the input) - without directly changing the dynamic range.

What is the mathematical action used to add more harmonies? I mean the 'THD adding' algorithms do not really pin-point the frequency and then create harmonies with oscilators, right?

Thanks,
Rocko
rocko
essemist
 
Posts: 59
Joined: Mon Dec 07, 2009 5:25 pm

Re: How to deliberately create THD

Postby treacherousumbrella on Fri Jun 29, 2012 9:41 am

I'm not sure where you're going with this but have a look at Chebyshev polynomials
treacherousumbrella
essemist
 
Posts: 65
Joined: Mon Oct 04, 2010 4:44 pm

Re: How to deliberately create THD

Postby trogluddite on Fri Jun 29, 2012 12:13 pm

Dell wrote:If the characteristics are too realistic you will find yourself explaining

He he, too true.
The guys that made original valve gear were mostly trying to achieve very low THD - i.e. excellent quality linear reproduction of the sound - they would mostly have considered adding deliberate THD to be poor engineering!
Deliberate distortion (e.g. for lead gutar) is a different matter - but a lot of the 'virtual valve'/'virtual transformer'/'virtual tape' plugins out there tend to be completely overcooked. I think a lot of younger musicians and producers would be rather disappointed with well engineered valve hardware - the effect is really very subtle, even when you have well trained ears.

rocko wrote:'THD adding' algorithms do not really pin-point the frequency and then create harmonies with oscilators, right?

There are maybe a few exceptions, but yes that is pretty much the case - after all, the gear you are trying to emulate did not do it that way either. The additional harmonics would not be totally pure odd or even etc. - just that different circuits will have a characterisitc spectrum that has a bias towards different tone colours.
For example, one reason why guitarists tend to prefer valves over transistors is that a good valve circuit tends to be stronger in even harmonics, whereas many transistor circuits create more odd harmonics. Research has shown that most people perceive even harmonics as more musical, and odd harmonics as more 'jarring'.
Feel free to use any schematics and algorithms I post on the forum in your own designs - a credit is appreciated (but not a requirement).
Don't stagnate, mutate to create. Without randomness and serendipity the earth would be just another barren rock.
User avatar
trogluddite
smychopath
 
Posts: 3027
Joined: Mon Oct 20, 2008 3:52 pm
Location: Yorkshire, UK

Re: How to deliberately create THD

Postby rocko on Fri Jun 29, 2012 4:48 pm

Hi,

Again this is just a 'theoretical discussion' - I ain;t building emulations I just want to better understand how they work.

So, Trog - your saying that engineering a SM module that adds THD involves a:

1. FFT (or other) frequency finding algorithm
2. Oscilators that are tuned to the found frequency and add harmonics (odd/even)

There must be an easier/simpler/less CPU consuming way to create harmonies (again - indifferent to dynamic range ilinearities).

Rocko
rocko
essemist
 
Posts: 59
Joined: Mon Dec 07, 2009 5:25 pm

Re: How to deliberately create THD

Postby trogluddite on Mon Jul 02, 2012 6:11 am

rocko wrote:So, Trog - your saying that engineering a SM module that adds THD involves

Sorry, I wasn't too clear - I was agreeing with you that FFT etc. is not the usual way to do it! :)
Feel free to use any schematics and algorithms I post on the forum in your own designs - a credit is appreciated (but not a requirement).
Don't stagnate, mutate to create. Without randomness and serendipity the earth would be just another barren rock.
User avatar
trogluddite
smychopath
 
Posts: 3027
Joined: Mon Oct 20, 2008 3:52 pm
Location: Yorkshire, UK

Re: How to deliberately create THD

Postby Dell on Tue Jul 03, 2012 4:00 am

rocko wrote:Hi,

Thanks for the detailed response.

I'm more into the theoretical sound of how to create THD which is not a side effect of dynamic range compression.

By this I mean, how to create extra harmonics (i.e related to the fundamental of the input) - without directly changing the dynamic range.

What is the mathematical action used to add more harmonies? I mean the 'THD adding' algorithms do not really pin-point the frequency and then create harmonies with oscilators, right?

Thanks,
Rocko





You cannot make a mathematical equation on THD for there is no standard on THD.

Hopefully what I am about to say is not outside your realm of understanding for certain things cannot be explained no other way.

The graph below illustrates two raw loudspeakers getting pink noise. As you can see, the second and third harmonic distortion differs per graph despite both loudspeakers getting pink noise. The graph stems from both loudspeakers offering the same model number however one is an older version while the other is a newer version.


w.jpg


Trying to make a mathematical equation on THD requires a lot of work and will not guarantee it will reflect every loudspeaker on the market.

Like loudspeakers, valves stem from different manufactures, plants in addition to generations. So how does one create THD using mathematics? You can only choose a device in which you have the proper tools to literally measure (Its rare if you could find VST developer with the proper tools to make such measurements) the device and accept it will only reflect one device out of the thousands of devices manufactured.

Even using convolutions cannot guarantee accurate results for, like a loudspeaker, a valve’s performance vary based in the environment it resides in. The unpredictability of valves is precisely why trying to make a mathematical standard in terms of THD is like trying to catch your shadow.
You do not have the required permissions to view the files attached to this post.
Dell
essemilian
 
Posts: 474
Joined: Sat Sep 26, 2009 6:45 pm
Location: New York

Re: How to deliberately create THD

Postby Dell on Tue Jul 03, 2012 4:16 am

trogluddite wrote:
Dell wrote:If the characteristics are too realistic you will find yourself explaining

He he, too true.
The guys that made original valve gear were mostly trying to achieve very low THD - i.e. excellent quality linear reproduction of the sound - they would mostly have considered adding deliberate THD to be poor engineering!
Deliberate distortion (e.g. for lead gutar) is a different matter - but a lot of the 'virtual valve'/'virtual transformer'/'virtual tape' plugins out there tend to be completely overcooked. I think a lot of younger musicians and producers would be rather disappointed with well engineered valve hardware - the effect is really very subtle, even when you have well trained ears.



I've must of heard this countless times from users with no experience in valves state the following "I never heard a tube before but, I'm sure this insert the plug-in here sounds like a tube....... :S ...... Oh dear xP

Have you seen this video?

http://www.youtube.com/watch?v=BYTlN6wj ... ature=plcp

The discussion tries the educate the uninformed yet, many lash out because they cannot differentiate mind over matter.
Dell
essemilian
 
Posts: 474
Joined: Sat Sep 26, 2009 6:45 pm
Location: New York

Next

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest