Kemper does a pretty good job creating "sound prints" of guitar tube amplifiers, where distortion is desired. I do not know what approach they use, there must be some really advances stuff for processing the test signals and responses - but in the end, maybe they are just calculating transfer characteristic out of that. Maybe deriving the transfer characteristic from a loadline from e.g. 300B datasheet would be worth a try.
You don't need DSP hardware to do this, just use Matlab or Octave software to read, process and write .wav files (I've manipulated .wav files in C/C++). Just squaring the input will "work" for a sine wave, but will cause lots more than even harmonics for any other input waveform. What's needed is a slight curve in the input-output transfer response (as opposed to the perfectly straight diagonal line) to generate even harmonics. With a "good" curve the second harmonic will dominate, but it's not really possible to generate only a single harmonic with general input material.
You can even use LTSpice with a decent FET model.
You can even use LTSpice with a decent FET model.
IMHO any shape is composed of sine waves up to the bandwidth. The second-order polynomial (i.e. the slightly-asymmetrically-curved transfer curve) will create the H2 for all the sines present in the signal.
I was experimenting with this over the weekend. It's trivial to add a second harmonic to a sine wave with an amplitude of 1. Just square it and subtract the DC. and you get a surprisingly clean 2nd harmonic. Removing the DC I can do just by subtracting a moving average, but controlling the amplitude is tricker. If I square a signal of amplitude 1, I get a signal back that also has amplitude 1. But if the original amplitude is 0.5 I obviously only get an amplitude of 0.25 back. However, an amplifier typically seems to have a linear relationship between the amplitude fundamental and harmonics. Is there even a closed form transfer function for doing this? It needs to look different depending on the amplitude of each frequency component. Or am I completely going down the wrong track?
Obviously, I could brute force it and do it in the frequency domain: Do and FFT, shift a scaled version of the signal up an octave and get it back through a IFFT. In my case, I'm not doing it in real time, so that might be an option. But it feels wrong!
Obviously, I could brute force it and do it in the frequency domain: Do and FFT, shift a scaled version of the signal up an octave and get it back through a IFFT. In my case, I'm not doing it in real time, so that might be an option. But it feels wrong!
Yes, it's simple math https://www.wolframalpha.com/input?i=sin^2(x)Just square it and subtract the DC. and you get a surprisingly clean 2nd harmonic.
IME the distortion profile is rather dependent on the signal level.However, an amplifier typically seems to have a linear relationship between the amplitude fundamental and harmonics.
I am not sure there is a way to introduce clean H2 of a specific scale to all harmonic components of an arbitrary musical signal.
Wont most any non-linearity work? It doesnt have to have the dramatic "bend" of a square term; it can be more subtle. Isnt that what amplifiers do; they attempt to be linear, but end up with a trace of non-linearity, hence harmonic profile. Think the old 12AX7 trick, where both triodes are paralleled to deliberately foster a larger non-linear bend and hence, more "tube sound".I am not sure there is a way to introduce clean H2 of a specific scale to all harmonic components of an arbitrary musical signal.
It does, absolutely. E.g. a polynomial transfer function will generate specific harmonic frequencies at exact phases to all frequencies of an arbitrary musical signal. But amplitudes of the added harmonics do not scale linearly with their fundamental levels, also the constant term (DC) varies nonlinearly with the signal amplitude (becoming a non-DC component by itself)Wont most any non-linearity work?
Full-scale signal:
Signal -20dB:
I looked at this type of thing , using 4016 in NFB loop , single bjt etc. Tube sound is more then just 2nd harmonics.
I gave in and have 2 6922 tubes in the preamp aided by silicon. Not looking back anymore !!
I gave in and have 2 6922 tubes in the preamp aided by silicon. Not looking back anymore !!
Well, so far I've only made it sound terrible. 😀 With sine waves or even multiple sine waves, it produces nice second harmonics. With music, it just sounds scratchy.Yes, it's simple math https://www.wolframalpha.com/input?i=sin^2(x)
IME the distortion profile is rather dependent on the signal level.
I am not sure there is a way to introduce clean H2 of a specific scale to all harmonic components of an arbitrary musical signal.
The added harmonics should be very small (like -60dB and less? ), i.e. tiny coefficients of the second-order component of the polynomial. But I am talking about math and theory, no idea about how it sounds.
Yeah, I’ve been experimenting with rather large coefficients on the squared term. If you isolate the squared term and listen to it, it sounds absolutely horrendous. Very scratchy. But I think my code is correct, because it produces a clean sounding octave on sine waves. I don’t know what I expected the second harmonic to sound like, but definitely not THAT bad. 😀
None other than audiophiles praising it as “warm” and “tube sounding”. If I get time tonight, I’ll create and upload a few samples for giggles.
With such a rough approach you should get such a result.Yeah, I’ve been experimenting with rather large coefficients on the squared term. If you isolate the squared term and listen to it, it sounds absolutely horrendous. Very scratchy. But I think my code is correct, because it produces a clean sounding octave on sine waves. I don’t know what I expected the second harmonic to sound like, but definitely not THAT bad.
You can take any free tube vst plugin and connect it to a digital player and look at the FFT it creates for the sine wave, and also look at the shape of the sine wave that imitates the sound of the tube. In fact, there is a formula for synthesis of distortions, a little more complicated than simply squaring the function.
I was interested in the imitation of a tube and its effect on sound, to test the effect of even harmonics on sound I made a project in Sigma Studio for 1452 in which you can change the level of harmonics using an external potentiometer when playing music, in this post I showed the results of measurements of the even harmonics simulator and gave a project for Sigma Studio that makes such harmonics.
https://www.diyaudio.com/community/...adau1452-100w-per-channel.410804/post-7668090
Last edited:
Well, the tubes are not only H2 🙂 Soft limitation (not H2), and e.g. their reportedly transfer function is not x^2, but x^(3/2) https://www.researchgate.net/figure...ating-the-3-2-power-law-in-the_fig1_228799815 .
Unfortunately, the material in which the project of implementing tube harmonics in Sigma Studio and the formula by which it was done were shown is no longer available to me. It was a long time ago. It is worth considering that the formulas by which tube sound is synthesized are different and they are usually not shown in the public domain.... But I think if you really set your mind to it, you can find formulas for synthesizing tube amplifiers.You have a link to the formula? I’m just doing this for fun, but it intrigues me!
Speculation: Electronic components generate thermal noise that increases with temperature. Perhaps "tube sound" can be attributed (along with other factors) to resistors baking and caps boiling.
Johnson–Nyquist noise (thermal noise, Johnson noise, or Nyquist noise) is the electronic noise generated by the thermal agitation of the charge carriers (usually the electrons) inside an electrical conductor at equilibrium, which happens regardless of any applied voltage. Thermal noise is present in all electrical circuits, and in sensitive electronic equipment (such as radio receivers) can drown out weak signals, and can be the limiting factor on sensitivity of electrical measuring instruments. Thermal noise is proportional to absolute temperature, so some sensitive ......
Johnson–Nyquist noise (thermal noise, Johnson noise, or Nyquist noise) is the electronic noise generated by the thermal agitation of the charge carriers (usually the electrons) inside an electrical conductor at equilibrium, which happens regardless of any applied voltage. Thermal noise is present in all electrical circuits, and in sensitive electronic equipment (such as radio receivers) can drown out weak signals, and can be the limiting factor on sensitivity of electrical measuring instruments. Thermal noise is proportional to absolute temperature, so some sensitive ......
jFETs better approximate x^2 function. Or do the MOS-FETs? But it will not be "tube sound".Well, the tubes are not only H2 🙂 Soft limitation (not H2), and e.g. their reportedly transfer function is not x^2, but x^(3/2) https://www.researchgate.net/figure...ating-the-3-2-power-law-in-the_fig1_228799815 .
- Home
- Source & Line
- Digital Line Level
- Adding even harmonics to a stereo signal