Understanding distortion mechanism

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi.


This is something I'd like to know, and that has been mentionned several times recently, here.

When some of you write "the transconductance is quadratic, this will create 2nd order harmonics", "put a ccs instead of a resistor, you'll have 20dB less thd" I'm really interested. I'l also like to know how to predict this.

So:
Non linear transfer function create harmonics, if the TF is Nth order, it will produce Nth order harmonics
Vce modulation on a BJT creates distortion (early effect) (is there somethink like this for Fets?)

What are the other distortion sources?
 
Yes.

In fact, I've been playing with an FFT program so I'll modify it to demonstrate:

- The white lines are the time domain signal (the only difference you will be able to see is a 'small' gain difference).
- Purple is the fft output (dB magnitude)
- Green lines are 20dB y axis markers
- The top / bottom graphs show:
y = ((1-yy/10)^2-1)*10 'quadratic distortion
y = (2^(1+yy/10)-2)*10 'exponential ditortion
(where yy=pure sinewave, y=distorted version, in BASIC)

This shows:
-Quadratic distortion produces ONLY 2nd order harmonics (I thought there would be some 3rd etc but there you go, perhaps I missed something in the rush).
-Exponential distortion produces a roughly 'linear' dropoff in harmonics (I have gone for very roughly 10% distortion in these plots, but for 1% distortion the 2nd is ~-60dB, 3rd ~-120dB etc)

You have do be doing something pretty nasty before this difference becomes audible!

In reality both MOSFETs and BJTs produce similar looking distortion spectra because they are non-ideal. Same applies for tubes in fact.
 

Attachments

  • clip0002.gif
    clip0002.gif
    84.9 KB · Views: 197
Hi Bricolo ;)
Another thing to consider is that in most cases a BJT is current driven. In that case the distortion will be a function of change in hfe. You can find a graph of hfe as a function of emitter current in many datasheets. It is very different for every particular type of transistor. It is possible to find transistors with a very linear hfe- curve. They will offcause distort very little when current driven. In the JLH class a only the first transistor should be regarded as voltage driven. In many cases the drive is somewhere between voltage and current so the distortion is difficult to predict. And simulations are depending on the accuracy of the models they use. Hope you get some inspiration out of this.:scratch1:

Thorsten
 
Bricolo said:
Vce modulation on a BJT creates distortion (early effect) (is there somethink like this for Fets?)
There are effects similar to the early effect and hfe variation for fets just like bjts. The voltage to current gain graph may occur in different forms or even be ommitted for switching fets. Not much use beyond a simple shortlist. Actually testing the component is the only way to know how it measures and sounds if you really want the best result.

The reason I'm posting is to elaborate on my ealier post. Of course squaring a sinewave only creates the 2nd harmonic - this is what a frequency doubler is (using the sin^2 = sin2f identity). I was thinking a step ahead and assuming an audio signal, which I thought might in some cases make higher order harmonics due to intermodulation. No. All it does is create intermodulation products not much higher in frequency than the 2nd harmonic (ie doesn't cause a train of harmonics). It often takes a simulation before I realise the obvious.

Here is another simulation showing 3 closely spaced sinewaves, and the result of putting each resulting sample through the same quadratic transfer function in my original post:
 

Attachments

  • 3fdist.gif
    3fdist.gif
    40 KB · Views: 124
Hi adx !
Interesting findings. So if we add one more stage we will get some 4`th harmonic because the next stage will produce 2`nd harmonics of the second harmonics of the first stage. And/or maybe we will some reduction in the 2`nd harmonic because of distortion annulation. If the currents in the two stages are in opposit phase. What do you think?

Thorsten
 
Yes, but it also produces a 3rd harmonic, I'm no maths expert (that's by choice) but if you go (a+bx^2)^2 I expect there will be a 4th order thingie (polynomial?). N E way 3 tones it looks like as attached...

There is some difference between inverting and not inverting the stages, but not a lot, the only difference is the 2nd harmonic(s) is about 10dB lower, the others remain the same. This makes sense because the second stage is only ~10% distortion so can't compensate 100%. In the real world of a stable <1% (for class-A amps anyway), the polarity of successive stages will make practically no difference. I sort of knew that, but a live example has made it nice and clear.

The graph shown is actually with it inverted, because my equation does an inversion. Here is the QB code which generates the distorted time domain signal for the inlcuded graph:

FOR i = 0 TO 4095
yy = SIN(i / 4096 * 3.1415926# * 100) 'generate single tone
yy = yy + SIN(i / 4096 * 3.1415926# * 110) 'generate 2nd tone
yy = yy + SIN(i / 4096 * 3.1415926# * 120) 'generate 3rd tone
yy = yy/3 'scale to 1/3rd to compensate

yy = ((1-yy/10)^2-1)*10 'quadratic distortion extra stage
'yy = -yy 'invert it
y(0, i) = ((1-yy/10)^2-1)*10 'quadratic distortion
'y(0, i) = (2^(1+yy/10)-2)*10 'exponential ditortion
PSET (i / 8, 200 - y(0, i) * 100),15
y(1, i) = 0
NEXT

(Actually running it in FreeBasic on windoze - a very happy find for me, the master of writing simulations in QB!)
 

Attachments

  • 2stage3tone.gif
    2stage3tone.gif
    45.7 KB · Views: 110
Distortion nulling

Hi adx !

It should be no problem in theory to reduce the second harmonic to zero. If first stage makes 10% and second stage makes 10%, but antiphase, the result would be 0%. But the second stage would also make 10% distortion of the second harmonic from the first stage, which would give 1% fourth harmonic distortion. In practice it is a matter of adjusting the working points to reach the desired distortion spectrum, or the best compromise.
Or maybe just choose what sounds best.

Thorsten
 
Hi - and yes, you're right, my reasoning above was flawed. Roughly the same level of fundimental is present in the second stage as in the first. The 10dB drop I saw IS a sizeable reduction (1/3rd). I'm sure I could null out the 2nd harmonic with ease, if I didn't have to get an amp ready for a demo tonight...

It's a pity audio signals are still shown using the old log scale tradition, the reality is that our response is closer to linear (pressure) and this is a much more "visually relevant" presentation. Even the a linear frequency scale is better than log for some jobs (like designing speaker crossovers). I was going to write an article or some sort of paper on this at some stage, but that was a while ago now!

Oh well, back to this amp. One day I might even sell one.
 
Woaaa! Maths. At least I verified that (ax^2+bx)^2 results in an x^3 term. That's about as high tech as it gets for me.

I think I see what's going on in those formulas, which I think implies x^n results in only harmonic "n" being added to the output, and demonstrates how exponential distortion gives an infinite number of harmonics.

I modified my program to do y = ((1-yy/10)^3-1)*10 and got a 2nd harmonic as well, as shown. I guess this is because the waveform is offset and scaled before it goes into the "cuber" (something I'd usually associate with cooking or garden waste processing or something like that). Interesting to see all this working.

The gif is clearer this time - the latest version of freebasic doesn't scale graphics slightly off any more. BTW I thoroughly recommend this to anyone wanting to do lash up quick utils and programs without a big learning curve. I've been searching for years.

Well, I got my amp going and debugged (a Gainclone), so onto the next one!
 

Attachments

  • cubed.gif
    cubed.gif
    16.9 KB · Views: 45
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.