Silicon ChipCircuit Surgery - June 2022 SILICON CHIP
  1. Outer Front Cover
  2. Contents
  3. Subscriptions: PE Subscription
  4. Subscriptions
  5. Publisher's Letter: How to annoy customers and lose them
  6. Feature: Positivity follows the gloom by Mark Nelson
  7. Feature: The Fox Report by Barry Fox
  8. Project: Net Work by Alan Winstanley
  9. Project: Full-wave Universal Motor Speed Controller by JOHN CLARKE
  10. Project: 8-pin 14-pin 20-pin PIC PROGRAMMING HELPER by TIM BLYTHMAN
  11. Project: Advanced GPS Computer by Tim Blythman
  12. Feature: Max’s Cool Beans by Max the Magnificent
  13. Back Issues: Max’s Cool Beans by Max the Magnificent
  14. Feature: Circuit Surgery by Ian Bell
  15. Feature: Make it with Micromite by Phil Boyce
  16. Feature: AUDIO OUT by Jake Rothman
  17. Feature: Electronic Building Blocks by Julian Edgar
  18. PCB Order Form
  19. Advertising Index

This is only a preview of the June 2022 issue of Practical Electronics.

You can view 0 of the 72 pages in the full issue.

Articles in this series:
  • (November 2020)
  • Techno Talk (December 2020)
  • Techno Talk (January 2021)
  • Techno Talk (February 2021)
  • Techno Talk (March 2021)
  • Techno Talk (April 2021)
  • Techno Talk (May 2021)
  • Techno Talk (June 2021)
  • Techno Talk (July 2021)
  • Techno Talk (August 2021)
  • Techno Talk (September 2021)
  • Techno Talk (October 2021)
  • Techno Talk (November 2021)
  • Techno Talk (December 2021)
  • Communing with nature (January 2022)
  • Should we be worried? (February 2022)
  • How resilient is your lifeline? (March 2022)
  • Go eco, get ethical! (April 2022)
  • From nano to bio (May 2022)
  • Positivity follows the gloom (June 2022)
  • Mixed menu (July 2022)
  • Time for a total rethink? (August 2022)
  • What’s in a name? (September 2022)
  • Forget leaves on the line! (October 2022)
  • Giant Boost for Batteries (December 2022)
  • Raudive Voices Revisited (January 2023)
  • A thousand words (February 2023)
  • It’s handover time (March 2023)
  • AI, Robots, Horticulture and Agriculture (April 2023)
  • Prophecy can be perplexing (May 2023)
  • Technology comes in different shapes and sizes (June 2023)
  • AI and robots – what could possibly go wrong? (July 2023)
  • How long until we’re all out of work? (August 2023)
  • We both have truths, are mine the same as yours? (September 2023)
  • Holy Spheres, Batman! (October 2023)
  • Where’s my pneumatic car? (November 2023)
  • Good grief! (December 2023)
  • Cheeky chiplets (January 2024)
  • Cheeky chiplets (February 2024)
  • The Wibbly-Wobbly World of Quantum (March 2024)
  • Techno Talk - Wait! What? Really? (April 2024)
  • Techno Talk - One step closer to a dystopian abyss? (May 2024)
  • Techno Talk - Program that! (June 2024)
  • Techno Talk (July 2024)
  • Techno Talk - That makes so much sense! (August 2024)
  • Techno Talk - I don’t want to be a Norbert... (September 2024)
  • Techno Talk - Sticking the landing (October 2024)
  • Techno Talk (November 2024)
  • Techno Talk (December 2024)
  • Techno Talk (January 2025)
  • Techno Talk (February 2025)
  • Techno Talk (March 2025)
  • Techno Talk (April 2025)
  • Techno Talk (May 2025)
  • Techno Talk (June 2025)
Circuit Surgery Regular clinic by Ian Bell Distortion and distortion circuits – Part 1 D istortion is a key concept in audio and many other areas of electronics. As its name implies, Distortion changes the shape of a waveform. This broad definition would include the effects of ideal filter circuits – for example a low-pass filter ‘round offs’ the sharp-edged changes of a square wave. However, the term is most often used to refer to the effects on signals of non-linearity in circuits, which is what we will explain in detail in this article. Such distortion is usually an unwanted characteristic of signal processing in circuits such as amplifiers and filters, but it also has some positive uses. Distortion is obviously an imperfection in an amplifier that ought to output an exact copy of the input signal at a higher power level – the output should have the same shape waveform as the input. For audio amplifiers, the amount of distortion produced is often characterised using a measurement called ‘Total Harmonic Distortion’ (THD). The word ‘harmonic’ is used here because distortion due to non-linearity adds frequencies to the output which were not present in the input. In the simplest case, if we input a sinewave (which has a single frequency) distortion will add content to the signal at multiples of the original frequency (its harmonics) – thus, THD is a measure of the amount of harmonic content which the distortion has introduced and serves as a metric of the quality of circuits such as amplifiers. The ideal (linear) filter mentioned above does not add any frequencies to the output which were not present in the input signal, so there is no harmonic distortion, but it does change the relative amplitude of frequencies present in a complex waveform and hence the shape of the waveform. Simulation files Most, but not every month, LTSpice is used to support descriptions and analysis in Circuit Surgery. The examples and files are available for download from the PE website. 48 Musical distortion Linear and non-linear circuits Although nonlinear distortion is often A linear circuit is one in which the output unwanted, it does have its uses, with is related to the input by multiplying it by a particularly well-known case being a simple scaling factor, G1. For example, Distortion and distortion circuits – Part 1 in music effects. Significant amounts for an input signal (vin) we could write of unwanted nonlinear distortion in the output signal (vout) as: audio circuits usually sounds harsh and 𝑣𝑣 = $ 𝑣𝑣 horrible, but applied appropriately it can be a useful creative tool. In musical This is the transfer function of the circuit. terms, changing the shape of a waveform 𝑣𝑣 If G =1 is' equal + $ 𝑣𝑣 to or greater than 1 we refer alters its timbre. Timbre is the quality to the circuit as an amplifier with a gain of of a musical note other than its pitch G1, otherwise it is an attenuator. The term (fundamental frequency) and𝑣𝑣loudness plot a graph of = ' +– $ 𝑣𝑣 ‘linear’ + ( 𝑣𝑣 (makes + ) 𝑣𝑣 )sense + * 𝑣𝑣if* we +⋯ it is the timbre which distinguishes the this relationship between vin and vout – it sound of different instruments playing is a perfect straight line going through the the same DC note at the 'same volume. origin, as shown in the top trace of Fig.1. offset Ideal 𝑣𝑣 change the Therefore, anoutput ability $to The slope of the line is equal to the gain. ( ) * + ) 𝑣𝑣 to +the + ⋯ circuit for which the input-output timbre of Distortion an instrument ( 𝑣𝑣 adds $* 𝑣𝑣 Any range of possible musical expression. If graph is not a straight line is non-linear you start with a ‘pure’ note (something and will introduce distortion. ( ) 𝑣𝑣 = of' + $ 𝑣𝑣For + any + $* 𝑣𝑣 * + ⋯ close to a sinewave) a small amount circuit the gain (G1) will ) 𝑣𝑣 real distortion will add warmth and grain vary with frequency. If this variation is to the sound. Adding more distortion specifically designed to pass or reject = 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) will result in a grittier, fuzzy or rasping 𝑣𝑣 signals of particular frequency ranges then sound. Distorting a complex sound we have a filter. This can still be linear – will tend to produce a harsher result the input-output amplitude relationship 𝑣𝑣 tone. = $ can 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝑐𝑐𝑐𝑐𝑐𝑐 ( (𝜔𝜔𝜔𝜔)line at any given than produced from a purer input still+be( a straight Musical use of distortion is commonly frequency, even if the gain (slope of the Distortion and distortion circuits Part 1is different at different frequencies. associated with the electric guitar in – line) 𝑐𝑐𝑐𝑐𝑐𝑐(2 ) = 2𝑐𝑐𝑐𝑐𝑐𝑐 ( ( ) rock music, where distortion pedals We may find that a real circuit has a very are widely used, but it can be applied good linear response, but there is a DC 𝑣𝑣 = $ 𝑣𝑣 to any instrument, even to vocals, and offset (or DC error) on the output. We (( ) 𝑐𝑐𝑐𝑐𝑐𝑐 = + 𝑐𝑐𝑐𝑐𝑐𝑐(2 ) is used in other genres. would 2 then write the transfer function as: FX applications 𝑣𝑣 = '+ $ 𝑣𝑣 Here, G0 is the offset. Although it could In the past couple of issues (PE, April, 𝑣𝑣 = $ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + + + ( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) May 2022) we published a Digital FX of the output 2 (to 2 ) the shape (‘change * 𝑣𝑣 = ' + $be 𝑣𝑣 said + ( 𝑣𝑣 + ) 𝑣𝑣 + * 𝑣𝑣 + ⋯ project by John Clarke, which provides waveform’ it is not of primary concern a variety of sound-processing effects when considering distortion. The graph is 𝑣𝑣 = 𝐵𝐵' + still 𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + 𝐵𝐵(line, 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) for musicians. was mainly a straight although it no longer DCThis offsetproject ' aimed at relatively complex effects such goes through the origin. Ideal output 𝑣𝑣 $ as phasing, chorus and pitch-shift, Distortion 𝑣𝑣 ( + ) 𝑣𝑣 )but + $* 𝑣𝑣 * + ⋯ 𝑣𝑣 = 𝐵𝐵' (+ 𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) + 𝐵𝐵* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) + ⋯ distortion effects were also included. ( Voltage supply limits John also published a distortion pedal There are a number of reasons why an ( er might ) * project about a year ago (see PE, March 𝑣𝑣 = ' +amplifi + ⋯ a completely $ 𝑣𝑣 + ) 𝑣𝑣 + not $* 𝑣𝑣 have 2021, Nutube Guitar Overdrive and linear response, but perhaps the most Distortion Pedal). Inspired by these obvious is that its output signal level is 𝑣𝑣 = This 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) projects we look at the fundamentals of limited. limit will typically depend distortion (including the basis of THD), on the supply voltage. Examples of inputinvestigate some SPICE simulations output relationship for amplifiers with 𝑣𝑣 2)= $finite 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + ( output 𝑐𝑐𝑐𝑐𝑐𝑐 ( (𝜔𝜔𝜔𝜔) related to distortion, and (in Part maximum levels are shown consider some basic circuits used in in the middle and lower traces in Fig.1. creating distortion effects. In both cases the output is limited to 1V. 𝑐𝑐𝑐𝑐𝑐𝑐(2 ) = 2𝑐𝑐𝑐𝑐𝑐𝑐 ( ( ) Practical Electronics | June | 2022 𝑐𝑐𝑐𝑐𝑐𝑐 ( ( ) = 2 + 𝑐𝑐𝑐𝑐𝑐𝑐(2 ) minimum of 1V and the input signal. To get a symmetrical function about 0V, the minimum function is applied to the absolute value of the input voltage (abs(x) function) and the result is multiplied by the sign function (sgn(x) returns +1 or −1 based on the sign of the x). The B3 source implements the softer limiting (lower trace) and uses uplim(x,y,z) instead of min(x,y). The uplim function is similar to min(x,y) but with a continuous first derivative and transition width z – this smooths the transition over a range controlled by z. The term, ‘continuous first derivative,’ means there are no abrupt changes in the slope of the graph – no sharp corners like those in the middle trace. The effect on an input waveform of the three transfer functions in Fig.1 is shown in Fig.3. The top trace is a perfect (undistorted) sine. The middle one shows ‘clipping’ – the highest amplitude parts of the sinewave are flattened. Use of softer transitions produces ‘limiting’ (as in the lower trace), also referred to as ‘compression’. The waveforms were obtained by changing V1 in the schematic in Fig.2 to a 1kHz 1.3V sinewave source and running a transient simulation (.tran 3m). Describing distortion mathematically Fig.1. Input-output relationships. Top trace is linear, middle trace has hard limiting (clipping) at ±1V and the bottom trace has softer clipping, also called ‘limiting’ at ±1V. The middle trace has an abrupt transition from the linear response to the limited output and the lower trace shows a more gradual transition from the linear to the limited part of the relationship. The transfer functions shown in Fig.1 were obtained using behavioural voltage sources and a DC sweep simulation in LTspice, using the schematic shown in Fig.2. The B1 source simply copies the input (the voltage at node x, from source V1) – this is the linear response (upper trace). The B2 source implements the hard limiting at 1V by outputting the Fig.2. LTspice schematic used to produce Fig.1. Practical Electronics | June | 2022 If an amplifier does not have a straightline input-output relationship, then we are presented with the problem of how we might represent the output mathematically in order to determine how much distortion is present. We could proceed with a very detailed analysis of the circuit, taking into account the characteristics of the all the components, but this may be very difficult, and may produce an equation which is too unwieldy to work with. It would also only be applicable to the one circuit we had analysed, and we would have to start again from scratch for each new circuit. We need something which is more general and can represent the output of any circuit producing distortion. Our answer is provided by Taylor’s theorem, which was published in 1715 by English mathematician Brook Taylor. Put in simple terms, the theorem states that any a smooth mathematical function can be approximated by a polynomial (known as a Taylor series). A polynomial is an equation formed from a sum of powers of our variable of interest (in this case vin). By ‘powers,’ we mean the original v in (raised to the power 1), v in squared (power 2), vin cubed (power 3), vin to the power 4, and so on. Each power is scaled by a different amount (G1, G2, G3 and so on) in which the numerical subscript refers to the relevant power of vin. We 49 the percentage of distortion in the whole output signal. This leads us immediately to a couple of problems: we have not defined vin and we do not know the coefficients. It would be useful to be able to compare different circuits in terms of the distortion they produce. This is only meaningful if it can be done in a consistent way; it therefore makes sense to use the same type of signal for vin in such a comparison, and indeed for all distortion figures. The special properties of sinewaves make them the perfect choice for the basis of distortion measurement. Signal spectra Distortion and distortion circuits – Part 1 DC offset Ideal output Distortion Fig.3. Effect of the 𝑣𝑣 transfer = 𝑣𝑣 functions in Fig.1 on a 1.3V sinewave. $ may also include a DC offset G0. This leads to a completely general transfer equation for an amplifier with distortion, 𝑣𝑣 = ' + $ 𝑣𝑣 which is a natural extension of the ideal linear amplifier equation given above: 𝑣𝑣 = '+ $ 𝑣𝑣 + ( 𝑣𝑣 ( + ) 𝑣𝑣 ) + * 𝑣𝑣 * +⋯ The G values are referred to as ‘coefficients,’ and the items which we are adding up, eg, G1vin and G1v2in, are $ 𝑣𝑣 circuits – Partthere 1 ( Distortion ) * referred toand as distortion ‘terms’. In principle, ( 𝑣𝑣 + ) 𝑣𝑣 + $* 𝑣𝑣 + ⋯ could be a very large number of terms, but in practice the values of the coefficients get 𝑣𝑣very=small for( higher) powers*𝑣𝑣 of v= $ 𝑣𝑣 ' + $ 𝑣𝑣 + ) 𝑣𝑣 + $* 𝑣𝑣 + ⋯in and we are unlikely to need anything beyond a small numbers of terms (less 𝑣𝑣 = ' + $ 𝑣𝑣 than 10) to calculate THD. 𝑣𝑣 = 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) We can separate vout from the above equation into three components: the( 𝑣𝑣 = ' + 𝑐𝑐𝑐𝑐𝑐𝑐 + ( 𝑣𝑣 + ) 𝑣𝑣 ) + $ 𝑣𝑣 ( (𝜔𝜔𝜔𝜔) 𝑣𝑣 the = ideal 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) offset, output+ signal and the $ ( distortion: Any periodic waveform can be formed by adding together a set of sinewaves of various frequencies and different amplitudes. This ‘sum of sinewaves’ is known as a Fourier series and was developed by Jean Baptiste Joseph Fourier (1768–1830), a French mathematician and physicist. For example, a square wave may be described as being at 1kHz, but this is just the fundamental frequency; there are other frequencies present too. For a 1kHz, ±1V square wave, the sinewaves which can be added together to form it are approximately: (first figure is amplitude) 900mV at 1kHz, 300mV at 3kHz, 180mV at 5kHz, 129mV at 7kHz and so on to infinity. At each odd multiple, n, of the fundamental the amplitude is 1/n of the fundamental amplitude. Looking at this the other way round, we can break any waveform down into its constituent sinewaves, finding the amplitude of each one. If we plot a graph of the amplitude of the constituent sinewaves along a frequency axis, we have the spectrum of the waveform. Part of the spectrum of a square wave is shown in Fig.4. We often plot spectra with log frequency and dB (decibel) amplitude axes, but Fig.4 uses linear axes and this makes it easier to see the 1/n odd harmonic amplitude relationship. We will discuss how to plot spectra of waveforms using LTspice next month. ' * 𝑣𝑣 * +⋯ DC offset 𝑐𝑐𝑐𝑐𝑐𝑐(2 ' ) = 2𝑐𝑐𝑐𝑐𝑐𝑐 ( ( ) Ideal output $ 𝑣𝑣 ( ) * Distortion ( 𝑣𝑣 + ) 𝑣𝑣 + $* 𝑣𝑣 + ⋯ If we knew we ) =all the 𝑐𝑐𝑐𝑐𝑐𝑐v(in(and + coefficients, 𝑐𝑐𝑐𝑐𝑐𝑐(2 ) ( the could work out the2relative levels of 𝑣𝑣 = ' + $ 𝑣𝑣 + ) 𝑣𝑣 ) + $* 𝑣𝑣 * + ⋯ ideal signal and the distortion and so find Fig.4. Part of the spectrum of a square wave (linear amplitude and frequency axes). 𝑣𝑣 50 = $ 𝑣𝑣 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + 2 ( ++ 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 2 𝑣𝑣( = 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) = 𝐵𝐵' + 𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝑣𝑣 +=𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + $ ( Practical Electronics | June | 2022 𝑐𝑐𝑐𝑐𝑐𝑐 ( (𝜔𝜔𝜔𝜔) If we apply a sinewave input to a perfect linear amplifier, we will get a sinewave of the same frequency at the output. The spectrum of both input and output will contain a single frequency component. If the amplifier introduces any distortion, then the output wave shape will no longer be a perfect sinewave (as in Fig.3) and therefore must contain additional constituent sinewaves at frequencies other than the input frequency. Fourier analysis will reveal these frequencies in Distortion and distortion circuits – Part 1 the output spectrum. Fig.5 shows the spectra of the three waveforms in Fig.3. 𝑣𝑣 = $ 𝑣𝑣 The top plot – that of the sinewave, shows a single peak at the sinewave frequency – this is the same as the input signal. 𝑣𝑣 = ' + $ 𝑣𝑣 The other two plots show the additional Distortion and distortion circuits – Part 1 frequency content produced by distorting the sinewave. Decibel amplitude plots are 𝑣𝑣 = ' + $ 𝑣𝑣 + ( 𝑣𝑣 ( + ) 𝑣𝑣 ) + * 𝑣𝑣 * + ⋯ used1 here as some of the harmonics are istortion circuits – Part 𝑣𝑣 = $ 𝑣𝑣 too small to see on a linear scale. DC offset Ideal output rtion and distortion Assuming circuits – Partv1in is a sinewave, we can Distortion 𝑣𝑣 = $ 𝑣𝑣 distortion Harmonic proceed with using our general transfer 𝑣𝑣equation = ' +to$ 𝑣𝑣 calculate the distortion. To and distortion circuits –Part Part nd distortion circuits – 11 – Part Distortion and distortion Distortion and distortion circuits Part keepcircuits things 𝑣𝑣 –simple = 1 1𝑣𝑣 initially we will 𝑣𝑣 rtion = '+ $ assume that the only distortion term ) + ( 𝑣𝑣 (in+our + * 𝑣𝑣 *is+the ⋯ v squared $ 𝑣𝑣present ) 𝑣𝑣 output in 𝑣𝑣 𝑣𝑣𝑣𝑣 2== $ 𝑣𝑣 $ 𝑣𝑣 𝑣𝑣 = = $ 𝑣𝑣$ 𝑣𝑣 𝑣𝑣 = + 𝑣𝑣 term, G2v in. We' will$ also ignore the DC a sine wave we can proceed withWe using our general calculate the error. will use a transfer cosineequation input tosignal, eep things simple initially we will assume that the only distortion term present in our as this is a bit more convenient in terms 2 +the𝑣𝑣 𝑣𝑣𝑣𝑣 also ==ignore n𝑣𝑣squared term, G2v in. We will $ 𝑣𝑣DC error. 𝑣𝑣$ 𝑣𝑣will𝑣𝑣use )$We * a cosine input ' '+ '+ ' 𝑣𝑣+ 𝑣𝑣 in= +𝑣𝑣 𝑣𝑣($𝑣𝑣 (= = + + ⋯ properties ' +ofcalculations $ 𝑣𝑣 calculations )a sine, the than a+sine, but the a bit terms the than but* the basic ( more convenient ) *of 𝑣𝑣 + ) 𝑣𝑣 + $* 𝑣𝑣 + ⋯ ctra etc. are the same. basic properties in terms of spectra are ( ( we ) ) (+( 𝑣𝑣 * * )+)⋯ same; 𝑣𝑣 =+++so, ++have: 𝑣𝑣𝑣𝑣 == '+the 𝑣𝑣 𝑣𝑣 𝑣𝑣 ⋯ $= ( 𝑣𝑣 𝑣𝑣+𝑣𝑣 ) 𝑣𝑣 𝑣𝑣+𝑣𝑣 * 𝑣𝑣+𝑣𝑣 𝑣𝑣+𝑣𝑣 𝑣𝑣 ++ + + 𝑣𝑣 *𝑣𝑣 *+ + ⋯⋯ + + ' $ ) ( ( * ) ) ' '( $ $ * * fset ' ' ( * +$ 𝑣𝑣%&) 𝑣𝑣+)𝐺𝐺+ +⋯ ' 𝑣𝑣%& $* 𝑣𝑣 $ 𝑣𝑣= 𝐺𝐺 output 𝑣𝑣 $ 𝑣𝑣 = ' +𝑣𝑣!"# ( ) tion + $* 𝑣𝑣 * + ⋯ ( 𝑣𝑣 + ) 𝑣𝑣And DC offset DC offset '' ' ' t Ideal 𝑣𝑣 $ 𝑣𝑣output $ 𝑣𝑣$ 𝑣𝑣 𝑣𝑣 = deal $output 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) * ) (( ) ) (+( +𝑣𝑣 +$*+ 𝑣𝑣)𝑣𝑣*𝑣𝑣))+ ⋯⋯ ( 𝑣𝑣 ++ ) 𝑣𝑣 ) 𝑣𝑣( 𝑣𝑣( $* Distortion 𝑣𝑣(*𝑣𝑣 *+ + ⋯⋯) 𝑣𝑣++ + $* Distortion ( 𝑣𝑣 * 𝑣𝑣 = ' + $* $ 𝑣𝑣 + ) 𝑣𝑣 + $* 𝑣𝑣 + ⋯ ' $ 𝑣𝑣 ( 𝑣𝑣 ( + ) 𝑣𝑣 ) 𝑣𝑣 DC offset Ideal output Distortion 𝑣𝑣 + $* 𝑣𝑣 = * '+ ' $ 𝑣𝑣 ( 𝑣𝑣 = +⋯ 𝑣𝑣 $ 𝑣𝑣 ( 𝑣𝑣 $ 𝑣𝑣 + ( = + '+ ) 𝑣𝑣 ) $ 𝑣𝑣 + = + $* 𝑣𝑣 * '+ ( 𝑣𝑣 ( $ 𝑣𝑣 + +⋯ ) 𝑣𝑣 ) + * 𝑣𝑣 * +⋯ = ) 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔)* ) 𝑣𝑣 + $* 𝑣𝑣 + ⋯ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + ( 𝑐𝑐𝑐𝑐𝑐𝑐(( (𝜔𝜔𝜔𝜔) ) 𝑣𝑣 = ' + $ 𝑣𝑣 + ) 𝑣𝑣 + 𝑐𝑐𝑐𝑐𝑐𝑐(2 ) = 2𝑐𝑐𝑐𝑐𝑐𝑐 ( ( ) 𝑣𝑣 = $* 𝑣𝑣 * +⋯ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) Fig.3. Effect of the transfer functions a 1.3V ) sinewave. 𝑐𝑐𝑐𝑐𝑐𝑐 ( ( ) =in 𝑣𝑣Fig.1 + 𝑐𝑐𝑐𝑐𝑐𝑐(2 =on 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + ( 𝑐𝑐𝑐𝑐𝑐𝑐 ( (𝜔𝜔𝜔𝜔) $ 2 Where Vm is the peak amplitude of the input is its frequency in Fig.5. Spectra of the waveforms in Fig.3 (dB 𝑐𝑐𝑐𝑐𝑐𝑐(2 amplitude and (linear 𝑣𝑣 = $ cosine 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + ( wave, 𝑐𝑐𝑐𝑐𝑐𝑐 ( (𝜔𝜔𝜔𝜔) ) = 2𝑐𝑐𝑐𝑐𝑐𝑐 ( ) frequency). * ) ) ) (+( * * 𝑣𝑣( (=+'+ ++ ⋯ per second times the frequency 𝑣𝑣𝑣𝑣 ==radians 𝑣𝑣 +𝑣𝑣(2 𝑣𝑣)𝑣𝑣*𝑣𝑣))+ ⋯ $= ) 𝑣𝑣$ 𝑣𝑣$ $* 𝑣𝑣+𝑣𝑣$ 𝑣𝑣 + + 𝑣𝑣 + ⋯ + 𝑣𝑣 + 𝑣𝑣 + ⋯ 𝑣𝑣 = 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + + + 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) ' '+ )+ $* $* ' $* $ ( ( 𝑣𝑣 = 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 2 2 in hertz) and t is time. Substituting the vin expression into the at this point, and we can tidy up the equation using B2 = vout) equation ½G2Vm, and similarly for other terms: ) 𝑐𝑐𝑐𝑐𝑐𝑐(2 = 2𝑐𝑐𝑐𝑐𝑐𝑐 ( ( gives: ( 𝑣𝑣 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝑣𝑣𝑣𝑣 == 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝑣𝑣 𝑣𝑣 =+ = 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) = $ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝑐𝑐𝑐𝑐𝑐𝑐 ( (𝜔𝜔𝜔𝜔) ( To deal with the cos2 term we use one of the basic trigonometric 𝑣𝑣 𝑐𝑐𝑐𝑐𝑐𝑐 ( ) = + 𝑐𝑐𝑐𝑐𝑐𝑐(2 ) 2 = 𝐵𝐵' + 𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + 𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) To obtain this equation we started with a simplified version of (( ) ( (𝜔𝜔𝜔𝜔) ) 𝑐𝑐𝑐𝑐𝑐𝑐 + 𝑐𝑐𝑐𝑐𝑐𝑐(2 ( (𝜔𝜔𝜔𝜔) ( (𝜔𝜔𝜔𝜔) ( (𝜔𝜔𝜔𝜔) 𝑣𝑣 = = $= + (𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝑣𝑣𝑐𝑐𝑐𝑐𝑐𝑐 + $ 𝑣𝑣2𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) ( as == + 𝑣𝑣𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝑐𝑐𝑐𝑐𝑐𝑐 ( 𝑐𝑐𝑐𝑐𝑐𝑐 ( ( 𝑐𝑐𝑐𝑐𝑐𝑐 $ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) identities known formulae, 𝑣𝑣which our distorted output in+which only included the G1v2in )$ = (the ) +double-angle = 𝐵𝐵'are + 𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + 𝐵𝐵𝑣𝑣( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) + 𝐵𝐵we 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) +𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) ⋯ 𝑐𝑐𝑐𝑐𝑐𝑐(2 2𝑐𝑐𝑐𝑐𝑐𝑐 *+ = $ +signal 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + ( ( 2 2 related to Pythagoras’ theorem. Specifically, we need to use: term from the distortion. If we include more distortion terms = $ 𝑣𝑣 (( ) (( ( (( () ) 𝑐𝑐𝑐𝑐𝑐𝑐(2 ) )==𝑐𝑐𝑐𝑐𝑐𝑐(2 2𝑐𝑐𝑐𝑐𝑐𝑐 𝑐𝑐𝑐𝑐𝑐𝑐(2 2𝑐𝑐𝑐𝑐𝑐𝑐 ) )= )= 2𝑐𝑐𝑐𝑐𝑐𝑐 𝑐𝑐𝑐𝑐𝑐𝑐(2 2𝑐𝑐𝑐𝑐𝑐𝑐 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + ((( ) + + ( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 𝑐𝑐𝑐𝑐𝑐𝑐 = 2 + 𝑐𝑐𝑐𝑐𝑐𝑐(2 ) 2 Or 2 ( (+ (+ 𝑐𝑐𝑐𝑐𝑐𝑐( ( ( ) )==𝑐𝑐𝑐𝑐𝑐𝑐 )𝑐𝑐𝑐𝑐𝑐𝑐(2 (𝑐𝑐𝑐𝑐𝑐𝑐(2 ) = ) )+ + = 𝑐𝑐𝑐𝑐𝑐𝑐(2 𝑐𝑐𝑐𝑐𝑐𝑐 𝑐𝑐𝑐𝑐𝑐𝑐(2) ) = 𝐵𝐵'𝑐𝑐𝑐𝑐𝑐𝑐 + 𝐵𝐵$(𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 22 + 𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 22 𝑣𝑣 = $ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + + + ( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) ( 2 2 So the v equation becomes: out 𝐵𝐵' + 𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + 𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) + 𝐵𝐵* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) + ⋯ + 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + (( (( + 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 𝑣𝑣𝑣𝑣 == $ $ 𝑣𝑣𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) ( ++ = =$ + +++ + + ( ( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 𝑣𝑣𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) $ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 22𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 222 22 2 𝑣𝑣 = 𝐵𝐵' + + 𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) $ Here, ½G2Vm is a DC voltage (there is no cosine or other 𝑣𝑣 𝑣𝑣 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝐵𝐵𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 𝑣𝑣𝑣𝑣 == 𝐵𝐵𝐵𝐵 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) ++ 𝐵𝐵 $= ( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 𝑣𝑣++ 𝐵𝐵'𝐵𝐵+ 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) ++ 𝐵𝐵in 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 𝑣𝑣𝐵𝐵 = 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) frequency dependent value term). This will add to any ' '+ $𝐵𝐵 $𝐵𝐵 (𝐵𝐵 '+ $(𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) (this = 𝐵𝐵' + 𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) ( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) + 𝐵𝐵* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) + ⋯ existing DC offset (which we ignored earlier). Of more interest is the term ½G2Vmcos(2 t), which represents a signal at twice 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝐵𝐵original +(𝐵𝐵𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 𝐵𝐵 +)𝐵𝐵𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) 𝐵𝐵 +*⋯ ⋯ ==𝐵𝐵𝐵𝐵 ++ 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + $= ( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) ) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) * 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) 𝑣𝑣+𝐵𝐵 𝐵𝐵'𝐵𝐵+ 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) ++ 𝐵𝐵 ++ 𝐵𝐵)+ ++ 𝐵𝐵*+ ++ ⋯⋯ 𝑣𝑣𝐵𝐵 = + 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝐵𝐵𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) 𝐵𝐵𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) ' '+ $ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) ) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) * 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) $𝐵𝐵 ( ' the $( frequency (2 ).𝐵𝐵𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) Since we are looking for general equations, the details of the coefficients such as ½G2Vm are not of particular interest Practical Electronics | June | 2022 the calculation proceeds in the same way – we use relevant trigonometric identities to deal with the various powers of 𝑣𝑣 = 𝐵𝐵 + 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) cosine. There is a lot 'more$ work to do( as the equations get bigger, but the result comes out in a well-structured form: 𝑣𝑣 = 𝐵𝐵' + 𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) + 𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) + 𝐵𝐵* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) + ⋯ Remember, this is the output from a distorting amplifier with a single sinewave (specifically a cosine in this case) at the input. Just as we did with our general output signal, we can separate vout into three components: the offset, the ideal output signal and the distortion: DC Offset Ideal output Distortion 𝐵𝐵' 𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) 𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) + 𝐵𝐵* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) + ⋯ We see that the distortion (of a sinewave input) consists of a set of sinewaves (cosines) at frequencies of twice |𝐵𝐵( | (2 ), three times 𝐷𝐷( = 𝑃𝑃$ = |𝐵𝐵$ | ( 𝑣𝑣$.-./ 𝐵𝐵$( = 𝑅𝑅 2𝑅𝑅 51 DC Offset 𝐵𝐵' DC Offset Ideal output 𝐵𝐵'𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) Ideal output 𝐵𝐵$𝐵𝐵𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) Distortion 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) + 𝐵𝐵* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) + ⋯ DC Offset 𝐵𝐵' ( Distortion 𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) 𝐵𝐵* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔)with + ⋯V peak amplitude, the RMS value is well For + a sinewave (3 ), four times (4 ), and so on, times the input frequency. m Ideal output 𝐵𝐵$ 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) to be VRMS = Vm/√2 = 0.707Vm. In our distortion calculation Frequencies which are whole-number of a particular Distortionmultiples 𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔)known + 𝐵𝐵* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) + ⋯ |𝐵𝐵( | the 𝐷𝐷 wanted output signal is v1 = B1cos( t) so its RMS value is frequency are called harmonics of that fundamental frequency. ( = |𝐵𝐵|𝐵𝐵 (| | This result shows us that for a sinewave input the distortion V1,RMS 𝐷𝐷( = = B1$/√2. From this we can find the power of the ideal |𝐵𝐵$ | |𝐵𝐵(signal | is entirely due to harmonics of the input signal, which is why output (P1) into an arbitrary load resistor R: 𝐷𝐷( = we use the term ‘harmonic distortion’. |𝐵𝐵($ | 𝑣𝑣$.-./ 𝐵𝐵$( If our input signal is more complex than a single sinewave 𝑃𝑃$ = = ( 𝑣𝑣$.-./ 𝐵𝐵$(2𝑅𝑅 𝑅𝑅 then the distortion will contain frequencies other than the 𝑃𝑃$ = = 2𝑅𝑅 ( 𝑅𝑅 𝑣𝑣$.-./ 𝐵𝐵$(can find the power of the second harmonic output, harmonics. For example, if the input signal contains two Similar we 𝑃𝑃$ = = sinewaves of different frequencies ( 1 and 2) the distortion and𝑅𝑅then 2𝑅𝑅 the ( ratio of the two, and hence the second harmonic 𝐵𝐵 ( 𝑃𝑃( = distortion, will include, in addition to the harmonics of both frequencies, 𝐵𝐵((2𝑅𝑅D2. 𝑃𝑃( = the sum ( 1 + 2) and difference ( 1 − 2) frequencies, and other 2𝑅𝑅 𝐵𝐵(( DC Offset 𝐵𝐵' combination frequencies. This is known as intermodulation 𝑃𝑃 = ( DC Offset ' 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) output 𝐵𝐵 𝐵𝐵importance distortion. Intermodulation distortion isIdeal of particular 𝑃𝑃( 2𝑅𝑅𝐵𝐵(( DCoutput Offset 𝐵𝐵$$𝐵𝐵𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) ( ' Ideal = ( =𝐵𝐵𝐷𝐷 ( Distortion 𝐵𝐵( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) +⋯ in radio circuits and has relevance to musical distortion effects. 𝑃𝑃 ( 𝑃𝑃$ 𝐵𝐵(𝐵𝐵$(+ (* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) + ⋯ Ideal output 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) $ Distortion 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) + 𝐵𝐵 = = 𝐷𝐷 Offset 𝐵𝐵('the signal ) (* ( The term B2cos(2 t) in the equationDC above tell us 𝑃𝑃 𝐵𝐵 ( $ $ Distortion + 𝐵𝐵* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) + ⋯ ( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝑃𝑃 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) 𝐵𝐵 Ideal output 𝐵𝐵$𝐵𝐵𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) DC Offset 𝐵𝐵' it is ( = ( = 𝐷𝐷(( level of the second harmonic distortion, but on its own ( 𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) Distortion 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) + 𝐵𝐵|𝐵𝐵 +⋯ 𝑃𝑃 𝐵𝐵 | ( ) * 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) Ideal output 𝑐𝑐𝑐𝑐𝑐𝑐(𝜔𝜔𝜔𝜔) not very useful because what we really need to know𝐵𝐵$is how $ 𝐵𝐵(($ 𝐷𝐷 𝐵𝐵()( = |𝐵𝐵 𝐵𝐵*((( | 𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔) + 𝐵𝐵) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) + 𝐵𝐵* 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) + ⋯ 𝑃𝑃 = + + + ⋯ ( ( ( |𝐵𝐵 | Distortion 𝐵𝐵 +⋯ $ * 𝑐𝑐𝑐𝑐𝑐𝑐(4𝜔𝜔𝜔𝜔) large the distortion is in comparison with the ideal𝐵𝐵output. harmonic distortion 𝐵𝐵𝐵𝐵(2𝑅𝑅 𝐵𝐵)𝐷𝐷 𝐵𝐵*+ ( = ( 𝑐𝑐𝑐𝑐𝑐𝑐(2𝜔𝜔𝜔𝜔)0+Total ) 𝑐𝑐𝑐𝑐𝑐𝑐(3𝜔𝜔𝜔𝜔) 2𝑅𝑅 2𝑅𝑅|𝐵𝐵 (| |𝐵𝐵 $ |⋯ + + + 𝐷𝐷be ( =useful We therefore define the second harmonic distortion, D2, as: 𝑃𝑃0 =(It to know the total power of the distortion 2𝑅𝑅would (2𝑅𝑅 (2𝑅𝑅|𝐵𝐵|𝐵𝐵|$ | 𝐵𝐵( 𝐵𝐵) 𝐵𝐵* ( this with the wanted signal. We might be tempted 𝑃𝑃0 = and + compare +𝐷𝐷( (=+|𝐵𝐵 ⋯ |𝐵𝐵( | ||𝐵𝐵𝐵𝐵($(| ( ( ( 2𝑅𝑅 2𝑅𝑅 2𝑅𝑅 𝑣𝑣 $ $.-./ 𝐷𝐷( = 𝑃𝑃0 to 𝐵𝐵simply 𝐵𝐵 𝐵𝐵 go ahead ( ( ) * 𝑃𝑃$+=( 𝑣𝑣$.-./ 𝐷𝐷(( ==+ 𝐵𝐵⋯$( and add up P2, P3, P4… to get the total |𝐵𝐵$ | = 𝑅𝑅 2𝑅𝑅 ($𝐵𝐵= (+ (*𝐵𝐵 (=|𝐵𝐵 𝑃𝑃0𝑃𝑃$ power. 𝐵𝐵((𝐵𝐵𝑃𝑃 𝐵𝐵 $| ( mathematician might object at this point and say )𝐵𝐵A 𝑣𝑣 $ $ $ 2𝑅𝑅𝐵𝐵$ = ( + 𝑃𝑃 ( = + 𝑅𝑅$.-./ (+⋯ = $ 𝑃𝑃 𝐵𝐵 𝐵𝐵 𝐵𝐵 can We can also define distortion values for the other harmonics (what ((we $ (that (do in terms of finding the power of single $ $ $ 𝑅𝑅 2𝑅𝑅 𝑃𝑃0 𝐵𝐵( 𝐵𝐵) 𝐵𝐵𝑣𝑣*$.-./ 𝐵𝐵$ + (𝑃𝑃($ + = might not when we have a whole set of them (the in𝑣𝑣a( similar𝐵𝐵(way. Terms such as B2cos(2 t) are time dependent=𝑃𝑃0 (signal (( + (⋯ ((= work $.-./ $ 𝑃𝑃$ 𝑃𝑃 𝐵𝐵$= 𝐷𝐷𝐵𝐵 ⋯ 𝐵𝐵( 𝐵𝐵 𝑅𝑅𝑣𝑣𝐷𝐷 ($+ 𝐷𝐷𝐵𝐵 )$+ *(( + 2𝑅𝑅 𝑃𝑃$ = = $.-./ $ Fortunately, it can be shown, using 0𝑃𝑃$ distortion spectrum). and 𝑅𝑅actually show the level of that distortion component at 𝑃𝑃 = ( ( ( 𝐵𝐵 (=𝐷𝐷 + ( ⋯= 2𝑅𝑅 = 𝐷𝐷( + 𝐷𝐷)𝑃𝑃𝑃𝑃 $+ *2𝑅𝑅 𝑅𝑅 ( 2𝑅𝑅 ( = called 𝑃𝑃 each instant of time. When comparing circuits, it is more useful 2𝑅𝑅𝐵𝐵( Parseval’s Theorem, that we can add up 𝑃𝑃0 $ (something 𝑃𝑃(( = ( = 𝐷𝐷 + 𝐷𝐷 + 𝐷𝐷 + ⋯ ( 2𝑅𝑅 Parseval’s Theorem shows that we can to know the average distortion over time. The average voltage (these ) power * 𝐵𝐵values. ( 𝑃𝑃$ 𝑃𝑃0 𝑃𝑃out +( 𝑃𝑃 𝑃𝑃* + ⋯ or energy of a signal using its spectrum =)( +power ( 𝑃𝑃 the of a zero-offset sinewave is zero, so we use root mean square𝐷𝐷( = work 𝐵𝐵(( ( 𝑃𝑃 𝐵𝐵 2𝑅𝑅 = ( ( 𝑃𝑃0𝑃𝑃$ 𝑃𝑃(𝑃𝑃+=𝑃𝑃)𝐵𝐵+(𝑃𝑃𝑃𝑃 +𝐵𝐵((⋯ 𝑃𝑃( = values – this is equal to the DC voltage which provides * 𝐷𝐷 $= or (RMS) (( the original signal and get the same answer. (((= 2𝑅𝑅 𝐷𝐷( = (Fourier = 𝑃𝑃$( =series) 𝐵𝐵𝑃𝑃𝑃𝑃 ( 𝐷𝐷 $(𝐵𝐵= 2𝑅𝑅 ( 𝑃𝑃 𝑃𝑃 ( $ $ ( 𝑃𝑃 ( the distortion, PD = P2 + P3 + P4 + ..., is 𝐵𝐵 total power of the same power dissipation in a fixed resistor as the AC signal. 𝑃𝑃0 The $ 𝑃𝑃 + 𝑃𝑃 + 𝑃𝑃 + ⋯ $ ( ) = * ( = 𝐷𝐷( ( 𝐷𝐷( = =therefore: 𝑃𝑃 𝐵𝐵 $ 𝑃𝑃( 𝑃𝑃 𝐵𝐵( $ ( 𝑃𝑃 $ =$ ( =( 𝐷𝐷( 𝑃𝑃( 𝐵𝐵(( 𝑃𝑃 𝐷𝐷 = ;𝐷𝐷(( 𝐵𝐵 +$((𝐷𝐷𝑃𝑃)((𝐵𝐵 +$)(𝐷𝐷𝐵𝐵*((+ 𝐵𝐵 𝐵𝐵*((⋯ ( = ( = 𝐷𝐷(( ( =)(( + =* 𝐷𝐷 𝑃𝑃0(=+𝐵𝐵𝐷𝐷(( + +(⋯ 𝐵𝐵 𝐵𝐵 𝑃𝑃$ 𝐵𝐵$ ( 𝐷𝐷 = ;𝐷𝐷 + 𝐷𝐷 + ⋯ )+ * 𝐵𝐵 𝑃𝑃 ($ 2𝑅𝑅 ($ 2𝑅𝑅 + ( ⋯ 𝑃𝑃0( = 2𝑅𝑅𝐵𝐵 + ( 2𝑅𝑅𝐵𝐵) 2𝑅𝑅𝐵𝐵* 2𝑅𝑅 + + +⋯ ( 𝑃𝑃0 = ( ( 𝐷𝐷 = ;𝐷𝐷(Dividing + 𝐷𝐷)𝐵𝐵+2𝑅𝑅 ( 𝐷𝐷* + ( ⋯ 2𝑅𝑅 ( the𝐵𝐵power of the wanted signal gives: 𝐵𝐵)2𝑅𝑅 (( by * ( ( ( ( ( 𝑃𝑃 = + + ⋯ <𝑣𝑣 + 𝑣𝑣 + 𝑣𝑣 + ⋯ <𝑃𝑃 (( ( () ( 00 * 𝐵𝐵( 𝐵𝐵) 𝐵𝐵* (𝐵𝐵 ( 𝑃𝑃 𝐵𝐵 𝐵𝐵 2𝑅𝑅 2𝑅𝑅 2𝑅𝑅 0 ( ) * 𝐷𝐷 = = ( ( ( 𝐵𝐵 𝐵𝐵 𝐵𝐵 ( ( ( 𝑃𝑃0 = + + +⋯ + 𝑣𝑣( )(+𝑣𝑣+ 𝑣𝑣) *+ ⋯* <𝑃𝑃0 𝑃𝑃0 <𝑣𝑣 = (= (( + )𝐵𝐵+ 𝑃𝑃0𝐵𝐵 + ( + ⋯+ ⋯ $ *𝐵𝐵 2𝑅𝑅 2𝑅𝑅 2𝑅𝑅 $$ = 𝐷𝐷 = <𝑃𝑃𝑃𝑃 = ( 𝐵𝐵$ + ( 𝐵𝐵 (2𝑅𝑅 ⋯ $(𝐵𝐵+ 2𝑅𝑅 𝑃𝑃0( 𝐵𝐵 (𝐵𝐵)2𝑅𝑅 $(𝐵𝐵+ 𝑣𝑣 ( 𝐵𝐵 * 𝑃𝑃 𝐵𝐵 𝐵𝐵 ( ( $ <𝑃𝑃 $ $ =$𝑣𝑣)(++$𝑣𝑣* (++⋯ <𝑃𝑃0 $ <𝑣𝑣 ( + (+⋯ ( ( ( 𝑃𝑃 𝐵𝐵 𝐵𝐵 𝐵𝐵 𝐷𝐷 = = 𝑃𝑃𝑃𝑃0 $ 𝐵𝐵( $ 𝐵𝐵) $ 𝐵𝐵* $ 0 = ( 𝑣𝑣 <𝑃𝑃$ 𝑃𝑃 +$𝐷𝐷)(( + + 𝐷𝐷*(( + +⋯ ⋯ = 𝐷𝐷 𝑃𝑃0 𝐵𝐵(( 𝐵𝐵)( 𝐵𝐵*( 𝐵𝐵(($( + 𝐵𝐵$( + 𝐵𝐵$( + 𝐵𝐵((𝐷𝐷 𝐵𝐵)(𝐷𝐷 𝐵𝐵*(⋯ 𝑃𝑃𝑃𝑃0$$𝑃𝑃=𝑃𝑃0𝐷𝐷 + = (+ (+ (+⋯ ( ) * + + 𝑃𝑃$ 0 ==𝐷𝐷( + ( ( 𝑃𝑃$ 𝐵𝐵$ 𝐵𝐵$ 𝐵𝐵$ ( 𝐷𝐷 + ( 𝐷𝐷 ( ++⋯⋯ 𝑃𝑃$𝑃𝑃$ (𝐵𝐵$ )𝐵𝐵$ *𝐵𝐵$ 𝑃𝑃 0 Representing distortion with single value (D) we = 𝐷𝐷( + 𝐷𝐷( +the 𝐷𝐷( overall +⋯ 𝑃𝑃0 𝑃𝑃 𝑃𝑃00 ( 𝑃𝑃( +) 𝑃𝑃) +*𝑃𝑃* + ⋯ can ( $ 𝑃𝑃write: = 𝐷𝐷(( + 𝐷𝐷)( + 𝐷𝐷*( + ⋯ ( ( ( 𝐷𝐷( = 𝑃𝑃0 = = 𝑃𝑃 + 𝑃𝑃 + 𝑃𝑃* *++⋯⋯ 𝑃𝑃$ 𝑃𝑃$$𝑃𝑃= 𝐷𝐷((𝑃𝑃++𝐷𝐷))𝑃𝑃𝑃𝑃$++𝐷𝐷 𝐷𝐷 = 𝑃𝑃 0 ( 𝑃𝑃 𝑃𝑃)$ 𝑃𝑃* + ⋯ ( $ Practical Practical Practical Practical Practical 𝐷𝐷 = = Electronics Electronics Electronics Electronics Electronics 𝑃𝑃 $ $* + ⋯ 𝑃𝑃0 𝑃𝑃( + 𝑃𝑃) +𝑃𝑃𝑃𝑃 𝐷𝐷( = = 𝑃𝑃 𝑃𝑃 + 𝑃𝑃 + 𝑃𝑃 + ⋯ 0 ( ) * $ 𝑃𝑃0Total $ ) + 𝑃𝑃* + Distortion 𝑃𝑃( Harmonic +𝑃𝑃𝑃𝑃 ⋯ D is(𝑃𝑃 the and is defined in terms of 𝐷𝐷( = = ;𝐷𝐷 𝐷𝐷 𝐷𝐷 = = ((( +=𝐷𝐷)(( + 𝐷𝐷*(( + ⋯ 𝑃𝑃$ 𝑃𝑃$ 𝑃𝑃 ;𝐷𝐷𝑃𝑃 𝐷𝐷 = individual + 𝐷𝐷 + 𝐷𝐷 + ⋯ the harmonic distortions by: ($ ) * $ 𝐷𝐷 = ;𝐷𝐷(( + 𝐷𝐷)( + 𝐷𝐷*( + ⋯ BACK ISSUES Practical Electronics – N NEW E EW PE D NA – ES M IG E N ! – N NEW E EW PE D NA – ES M IG E N ! BACK ISSUES – ONLY £6.49 The UK’s premier electronics and computing maker magazine Circuit Surgery Timing and metastability in synchronous circuits Build an RGB display project using a Micromite Plus The UK’s premier electronics and computing maker magazine Circuit Surgery Audio Out Make it with Micromite Timing and metastability in synchronous circuits Construct a transistor radio Frequency Reference Mastering Signal Distributor RFID tags for your projects WIN! Microchip Curiosity HPC Development Board Make it with Micromite Fun display project using a Micromite Plus Nutube Guitar Overdrive and Distortion Pedal WIN! <at>practicalelec Circuit Surgery Transformers and LTspice Audio Out Make it with Micromite Accessing Internet data with your MKC Superb microphone preamplifier Touchscreen Wide-range RCL Box Programmable Thermal Regulator WIN! Microchip MCP19114 Flyback Standalone Evaluation Board Apr 2021 £4.99 04 9 772632 573016 practicalelectronics PLUS! Techno Talk – No blame, no shame? Cool Beans – Round-up of NeoPixel effects Net Work – Videoconference cameras www.electronpublishing.com <at>practicalelec Mar 2021 £4.99 03 9 772632 573016 practicalelectronics PLUS! PIC n’ Mix Software tools for the PIC18F Ultrabrite LED bike light WIN! Microchip Explorer 16/32 Development Kit WIN! Fabulous low-cost Concrete speakers! <at>practicalelec Jun 2021 £4.99 06 9 772632 573016 practicalelectronics Analogue inputs and using servomotors Random Number Generator Meet the Micromite Explore-28 Audio Out Constructing the PE Theremin amplifier Circuit Surgery Micro-Cap 12 simulator review WIN! Microchip MPLAB Starter Kit for Serial Memory Products WIN! Clever Controller for dumb chargers Hi-Fi amp on the cheap! Completing the High-power 45V/8A Variable Linear Supply Building the Low-noise theremin PSU PLUS! Sep 2020 £4.99 Cool Beans – Even cooler ping-pong ball lights! Net Work – IP security cameras Techno Talk – The perils of an enquiring mind... www.electronpublishing.com The UK’s premier electronics and computing maker magazine Make it with Micromite Circuit Surgery Understanding Differential amplifiers Don’t miss our Super Summer Sale! Robot Buggy Ultrasound sensing! Techno Talk – Bad science and good Cool Beans – Smoothing LED colour transitions Net Work – Lockdown technology and how we now work www.electronpublishing.com The UK’s premier electronics and computing maker magazine Flowerpot speakers! A low-cost route to high-quality Hi-Fi Mastering stepper motor drivers Roadies’ Test Signal Generator Tunable HF Preamplifier Techno Talk – Tin whiskers scourge Cool Beans – Bouncing around the Maxiverse Net Work – Hydrogen: a viable alternative to batteries? www.electronpublishing.com The UK’s premier electronics and computing maker magazine WIN! Microchip PIC24F LCD and USB Curiosity Development Board Meet the Cricket: making IoT designs super easy! Programmable Thermal Regulator Make your own PCBs with our precision Solder Reflow Oven PLUS! Audio Out How to make a transistor radio Superb PE PIC Development Board <at>practicalelec 09 9 772632 573016 practicalelectronics ( 𝐷𝐷 = ;𝐷𝐷(( +We 𝐷𝐷)(can + 𝐷𝐷supply * + ⋯ back issues of PE/EPE by post. Making a splash with NeoPixels! Fun LED Christmas Tree offer! PLUS! Techno Talk – Triumph or travesty? Cool Beans – Mastering NeoPixel programming Net Work – The (electric) car’s the star! www.electronpublishing.com <at>practicalelec Dec 2020 £4.99 12 9 772632 573016 practicalelectronics We stock magazines back to 2006, except for the following: 2006 Jan, Feb, Mar, Apr, May, Jul ( ( ( 2007 Jun, Jul, Aug <𝑃𝑃0 <𝑣𝑣 ( + 𝑣𝑣) + 𝑣𝑣* + ⋯ 𝐷𝐷 = = 2008 Aug, Nov, Dec 𝑣𝑣 <𝑃𝑃$ 2009 $ Jan, Mar, Apr 2010 May, Jun, Jul, Aug, Oct, Nov 2011 Jan 2014 Jan 2018 Jan, Nov, Dec 2019 Jan, Feb, Apr, May, Jun Issues from Jan 1999 are available on CD-ROM / DVD-ROM If we do not have a a paper version of a particular issue, then a PDF can be supplied – your email address must be included on your order. Please make sure all components are still available before commencing any project from a back-dated issue. 52 𝐷𝐷 = ;𝐷𝐷(( + 𝐷𝐷)( + 𝐷𝐷*( + ⋯ <𝑃𝑃0 <𝑣𝑣(( + 𝑣𝑣)(( + 𝑣𝑣*((( + ⋯ +⋯ ⋯ 𝐷𝐷 = <𝑃𝑃𝐷𝐷0 = = ;𝐷𝐷 <𝑣𝑣(( + 𝐷𝐷 𝑣𝑣) + 𝑣𝑣𝐷𝐷** + 𝐷𝐷 =Power =is proportional the $( + 𝑣𝑣 (to <𝑃𝑃 $ 0 <𝑣𝑣(( + 𝑣𝑣 𝑣𝑣 + ⋯ square of the voltages concerned, <𝑃𝑃 * ) 𝑣𝑣$ 𝐷𝐷so =<𝑃𝑃 = also write $ can we the THD as: ( ( 𝑣𝑣 ( <𝑃𝑃 <𝑃𝑃 0 $ <𝑣𝑣( + 𝑣𝑣) +$𝑣𝑣* + ⋯ 𝐷𝐷 = = 𝑣𝑣$𝑣𝑣 ( + 𝑣𝑣*( + ⋯ <𝑃𝑃$<𝑃𝑃0 <𝑣𝑣(( + ) 𝐷𝐷 = = 𝑣𝑣$ <𝑃𝑃$ Here, v1 is the amplitude (or RMS) value of the fundamental and v 2, v 3 … are the amplitudes (or RMS) values of the distortion products. THD can be expressed as a percentage or as a value in decibels 20log10(D). Unfortunately, this is not the only definition of THD in use. The alternative approach is to define D directly as the power ratio PD/P1. Expressing the power version in decibels (using 10log10) gives the same value as the voltage-based version in decibels, but the percentage figures are different – so take care when looking at THD figures to make sure you know how it is being expressed. Practical Electronics | June | 2022