Chapter 6

AC circuits

Chapter 3 looked at direct current (DC) circuit theory, where the voltage and current levels in a circuit do not change over time. This chapter introduces AC circuit theory using the sine wave, which is the fundamental component of all pitched sounds in an audio signal. The chapter begins by introducing the fundamental elements of a sine wave – amplitude, frequency and phase (though an in-depth discussion of phase is outwith the scope of this book). The most common time-varying component in electronics is the capacitor, which stores charge over time. Capacitance is defined in terms of charge and voltage, with the charging time being dictated by the time constant within an RC series circuit. Capacitors change their reactance based on the frequency of the alternating signal applied across their plates – this is how audio filters are constructed. In DC circuits, resistors are used to oppose the flow of current, whereas in AC the time-varying nature of the circuit requires the definition of impedance – the combination of resistance, frequency and phase. The chapter will cover how to combine resistors and capacitors to determine the impedance magnitude of a circuit. This analysis is much more involved than with DC circuit equations, and requires a new analysis tool, LTspice, that will perform AC circuit analysis and simulation with speed and accuracy. The chapter shows how to use LTspice to analyse both impulse and sine wave time-varying signals, to determine how the capacitor time constant and phase shift affect an input signal.

6.1 Audio signal fundamentals – sine waves

This book focusses on audio signals, to learn how to detect and process sounds for output in audio systems. As discussed in chapter 2, all audio systems use some form of sensor (e.g. microphone) and transducer (loudspeaker) to convert sound to and from electricity for processing by audio electronics circuits. This chapter begins by covering the basic building block of all sounds that are detectable by the human ear – the sinusoidal waveform. Sine waves are periodic in nature, they continuously vary their amplitude in a repeating pattern over time (Figure 6.1).

Figure 6.1A sine wave. The diagram shows a sinusoidal waveform that is a continuous signal – it is constantly varying its output. A sine wave has a peak amplitude when the output is highest, and its periodicity (T) is the amount of time before the sine wave begins to repeat itself. As shown in the diagram, the frequency of the sine wave is the reciprocal of the wavelength.

The diagram shows a sine wave that repeats periodically over time (defined by the Period, T). The amplitude of the sine wave (also called the magnitude in electronics) varies over the period of the sine wave, beginning at 0 and then steadily increasing to the highest peak value. The wave then decreases in amplitude until it reaches the trough value, which can often be a negative value depending on the scale used. The period of the wave is measured between two points of the same amplitude (the diagram defines the period between two downward zero-crossing points). The sine wave is a fundamental concept in both mathematics and science and is used in many different ways by different domains and disciplines that work with continuous signals of some form (you will probably have encountered sine waves at some point in your learning). In audio terms, a sine wave is used to describe the changes in air pressure created by vibrations that are detectable by the human ear as sound (Figure 6.2).

Figure 6.2Air pressure changes due to sound vibration. In the diagram, a loudspeaker diaphragm vibrates air molecules, causing them to compress. The dark bands show where compression occurs, alongside the lighter areas that experience a corresponding reduction in density (rarefaction) as a result of the movement. These points correspond to the peaks and troughs of a sine wave, which can be used to describe the changes in air pressure over time.

In the diagram, a loudspeaker diaphragm is displaced by the movement of its voice coil due to electromagnetic induction (see chapter 2, Figure 2.32) which vibrates the surrounding air molecules (only the forward direction of this vibration is shown). These vibrations cause the air molecules to compress, which increases the air pressure at certain points, whilst also reducing the pressure at other points due to this movement of air (known as rarefaction). If measured, the air pressure values would ideally plot a sine wave over time, where the higher pressure areas of compression correspond to peaks in the sine wave, whilst reduction in pressure due to rarefaction creates the troughs of lowest pressure in the wave. Chapter 4 (section 4.10) noted that that periodic waves are defined as sounds of a particular frequency, where frequency is the number of times a sine wave repeats in one second (Figure 6.3).

Figure 6.3Pitch perception by the human ear (adapted from chapter 4, Figure 4.22). At its simplest level, the human ear detects changes in air pressure as sound. When these changes in pressure are periodic they have a specific frequency and are perceived as a sound of a certain pitch. As the frequency of a sound doubles its perceived pitch increases in octaves (F0, 2 × F0, 4 × F0), but its wavelength decreases – frequency and wavelength are inversely related to one another.

In the diagram, octaves are defined as multiples of the frequency of an arbitrary fundamental pitch, where the first octave is double the frequency of the fundamental (2 × F0) and the second octave is double the frequency of the first octave (hence 4 × F0). This doubling of frequency also corresponds to a halving of the wavelength, where the wavelength of a sound is the distance over which it repeats (measured in metres). This is a good example of the changing terms and quantities you will encounter when learning how to describe (or measure) sounds, where the wavelength of the sound is defined as a distance (usually in metres), as opposed to defining the period of the sine wave in Figure 6.1, which is defined in time (usually in seconds).

It is important to note that an octave is double the frequency of the lower note, hence three octaves above the fundamental will actually be a frequency of 8 × F0 (or 4 × F1) – this distinction will make more sense when discussing harmonics later in the section. Frequency can be related to wavelength by using the speed of sound in air:

Frequency, F=Speed of sound in air, cairWavelength, λ(6.1)
F is the frequency (or number of cycles per second) of the sound in hertz (Hz)
cair is the speed of sound in air in metres per second (ms−1)
is the wavelength of the sound in metres (m)

The speed of sound is normally defined as 343 ms−1 (for an air temperature of 20°C) and is therefore used as a constant to relate the other two quantities of frequency (number of cycles per second) and wavelength. In practice, the speed of sound varies between ~331 ms−1 at 0°C and ~355 ms−1 at 40°C and thus for live sound (and indeed some high-end recordings) temperature can be an important factor. To understand this, consider how an instrument (or voice) will emit a sound of a specific wavelength based on its construction (e.g. length of vibrating string, distance to air hole). If the instrument plays the same note then this wavelength does not change, but if the speed of sound has increased due to temperature then the frequency of the sound will also increase, as the following worked example will illustrate:

6.1.1 Worked example – varying the speed of sound

These calculations are illustrative only, and thus approximate the actual value for the speed of sound in air at various temperatures. Also note that a piano tuner would never tune an instrument at such a low temperature!

Q1: A piano tuner tunes a note to A4 (concert pitch 440Hz) in a concert hall that is very cold – the thermometer reads 0 °C. If the hall is heated by the presence of the audience (who also generate heat) to 20°C before the performance, how much will the frequency of the note A4 on the piano be increased when played?

Answer: A note tuned to A4 (440Hz) at 0°C, when played at 20°C, will have increased in frequency by 17.33Hz to 457.33Hz.

In Western music, musical pitches are defined around concert pitch, where the note A4 (fourth octave on a piano keyboard) equates to 440Hz – though opinions on this value differ, it is the standard value defined in ISO 16. The human ear can detect pitches between 20 and 20kHz, though in practice the high range of human hearing degrades with time and exposure to high-intensity sound sources. Chapter 8 will discuss the human hearing range in more detail when considering how audio filters must map onto the non-linear human hearing response, but for reference this range can be considered relative to some of the frequency ranges of common musical instruments (Figure 6.4).

Figure 6.4Musical instrument frequency ranges. The diagram shows the indicative frequency range (from low to high) of some common instrument types, including piano, violin, guitar and bass. The lowest (bass) and highest (soprano) human vocal ranges are included for indicative purposes – these are the ranges which composers have traditionally used. Synthesizers are not included as they are not limited in the pitch they can output (i.e. 20–20kHz) – the only limitation is in the mapping to specific MIDI Note Numbers on the MIDI controller used to trigger them in that system.

The diagram shows a broadly indicative range of pitches for some common instrument types, though in practice these can vary widely for a variety of design and construction reasons (e.g. 5-string bass, 7-string guitar, R&B snare drum). Notice that the frequency scale (in hertz) of the chart is defined in octave bands rather than a linear range of frequency – because the human ear has such a wide range, a logarithmic (order of magnitude) axis is normally used to keep data graphs and charts manageable in size. The frequency bands used are taken from ISO 266:1997, which provides a standard set of frequency values across the audible range – though you will encounter different interpretations of these values in practice). Common instrument ranges are provided as a broad reference for later work in chapter 8 on audio filters, where the range of each instrument in a production will dictate not only the filter used but also how that filter may overlap with the other instruments involved. It is not uncommon to boost a snare drum and find that the low end of an acoustic guitar (or vocals) is now less defined – that range of frequencies is now more amplified in general.

This problem would seem manageable if the overlaps in range were used to adjust filters accordingly, but this definition of frequency range only relates to the fundamental frequency of the note involved. In reality, it is important to understand that most instruments (other than very basic synthesizers) do not produce sounds that are simple sinusoids, but rather emit much more complex combinations of multiple periodic waveforms (Figure 6.5).

Figure 6.5Sine wave combination. The diagram shows how combining three sine waves of different frequency multiples (F0, 2F0 and 3F0) creates a more complex output waveform as a result. The first wave addition equates to sin(x) + sin(2x), whilst the second wave addition is sin(x) + sin(2x) + sin(3x). The result of adding these waves is a very broad approximation of the audio waveform shown on the right, which is a recording of a guitar string at 108Hz (A2) zoomed to 8 times magnification for comparison.

The diagram shows how sine waves can be combined to create a much more complex waveform as the output, where three multiples of the fundamental frequency F0 (defined as sin(x)) are added together. Although the resulting waveform is not the same as the actual audio waveform of a 108Hz (A2) guitar string being plucked, there are enough similarities in the number of peaks present in both waveforms to show that each wave is created by a combination of different frequencies being added together. These sine waves are all linear multiples of the first frequency F0 (unlike octaves) and are known as the harmonics of a sine wave – where the fundamental F0 is the first harmonic, the second harmonic would be 2F0, the third harmonic would be 3F0 (and so on).

Musical harmonics are a complex subject that is outwith the scope of this book, but they are presented here to show that we are dealing not only with the pitched frequency range (i.e. the fundamental) of an instrument, but also its additional harmonic components. To highlight this more clearly, let us look at the frequency spectrum of the 108Hz (A2) guitar string waveform shown in the previous diagram (Figure 6.6).

Figure 6.6Audio frequency spectrum example. The diagram shows the frequency spectrum for an open A guitar string (A2 is 108Hz). The first five harmonics above the fundamental frequency (110.35Hz), are labelled at 220.71Hz, 331.07Hz, 438.74Hz, 561.79Hz and 659.45Hz respectively.

This frequency spectrum was created by running a fast Fourier transform (FFT) on the audio file containing the samples of the A2 guitar sound. An FFT takes short sections (known as windows) of the sampled audio data and multiplies them by sine waves of increasing frequency across the audio spectrum (each frequency is known as a bin). If the sample window contains that specific frequency bin, then the result of the multiplication will be greater than zero (Figure 6.7).

Figure 6.7Sine wave multiplication examples. In the diagram, the left-hand graph shows the result of multiplying sin(x) by itself, where the average value of the resulting waveform is greater than zero. The right-hand graph shows the result of multiplying sin(x) with sin(2x). The overall average value of this waveform is 0, which shows that sin(2x) is not present in the sample.

The diagram in Figure 6.7 shows a very simplified demonstration of Fourier analysis, where the presence of a specific frequency is detected by multiplying the input sample window by that frequency. The result of each multiplication is analysed based on the average of the entire waveform, where any single frequency sine wave centred on zero will average zero because exactly half of the wave is negative (+/− signs are included in the diagram to show where the cancellation occurs). If the result of multiplication is greater than zero, it indicates the presence of that frequency in the sample. By multiplying each window by every bin, a frequency profile of the entire sample is created – this is how the frequency spectrum in Figure 6.6 was produced. Although digital signal processing is not covered in this book, it is important to have a basic understanding of how a frequency spectrum is produced for your future learning. This section aims to provide some indication of the importance of sine waves in audio – thus the following discussion of AC circuit theory will have a more concrete application, rather than a purely mathematical explanation of the variation of an electrical signal over time.

6.2 AC signals – amplitude, frequency and phase

The sine wave is of fundamental importance in audio, and is similarly fundamental in the analysis of alternating current (AC) circuits. Alternating current was first introduced by Hippolyte Pixii in 1832 as part of an induction generator (which used magnets rotating in a coil to generate current), but is more famously documented in the battle for control of electrical power transmission that occurred in the United States between Thomas Edison (proposing DC) and Nikola Tesla – who had produced a huge number of significant innovations like the AC motor. In modern times, alternating current is used throughout electronics for the transmission of both electrical power and communication signals, where protocols such as WiFi and Bluetooth send wireless AC signals that are then decoded into data.

The previous chapter used time-varying signals to send MIDI Note messages as serial binary data where the signal varied between HIGH (+5V) and LOW (0V) over time. Time-varying signals were also used with pulse width modulation to output tones to a piezo loudspeaker, which again are a form of AC signal. Unlike direct current circuits that remain constant, the common factor in all AC circuits is that the signal changes over time. To analyse such circuits, a sine wave can be used as the mathematical model for a continuous signal input (Figure 6.8).

Figure 6.8An AC signal. The diagram shows how a sine wave can be used as a simple model of a time-varying signal, allowing it to be used in electronic circuit analysis. The peak voltage Vp (measured from 0V) is shown, alongside the peak-to-peak voltage Vpk-pk, the average voltage VAVG and the root mean square voltage VRMS – all representing different ways to measure an AC signal.

The diagram shows how the peak voltage (Vp) of an AC signal is measured relative to a reference value of 0V, and this is an important point to remember – the reference level must be known. It is common for a signal to alternate between two voltages that are both above the 0V ground reference, and this needs to be taken into account when working with peak voltage values from other parts of an audio system to ensure that levels are consistent. A more general level is the peak-to-peak voltage (Vpk–pk), which describes the difference between the lowest and highest voltage levels in the signal. The Vpk–pk level is often used to define the peak voltage (i.e. divide by 2) but, as noted, this does not take the ground reference level required for measuring Vp. Instead, the amplitude of the signal is better defined as being half of the peak-to-peak voltage ( Amplitude=Vpkpk2)). The next element to consider is the frequency of the sine wave – how often it repeats over a given time. This can be calculated using the period of the wave (in seconds):

Frequency, F=1Period, T(6.2)
F is the frequency of the wave in hertz (Hz)
T is the period of the wave in seconds (s)

As discussed in the previous section, frequency is crucial to any audio signal. Analysing voltage and current in a circuit effectively extends from prior knowledge of DC circuits, but when frequency is included this analysis now relates to how the circuit will respond over time. Note that the relationship between frequency and time shown in the equation above is distinct from the previous relationship defined in equation 6.1 for acoustic measurement of frequency (which used speed and distance). Time-based measurements of electrical signals will be used for the remainder of this book, so it important to remember that wavelength is not an electrical quantity.

When describing a sine wave, the phase angle defines the wave position within its periodic cycle. This aspect of trigonometry can be confusing when learning how to analyse AC circuits, as the relationship between signal amplitude and sine angle values is often stated in both radians and degrees – many new students see the symbol π in an electronics equation and think of triangles or circles, rather than the position of a sine wave. There are many ways to explain this relationship between amplitude and angles in a sine wave, including the rotating-wheel example (Figure 6.9).

Figure 6.9Rotating wheel sine angles. In the diagram, a point on a wheel rotates anti-clockwise. If this point is measured over time it will trace out a sinusoidal waveform, where the angle of the sine wave is defined by the angle of the rotating wheel. The sine angle is shown in degrees at the bottom of the diagram, and the major radian measurements ( ,2, etc) are marked at the top for reference.

The angle values are also given in radians at the top of the diagram as these are commonly used in AC circuit calculations, where a radian is a portion of the radius of a circle (with a value of ~57.3o). Radians will not be used (other than

 2π
) for the calculations in this book, but it is important to know about them if you wish to progress your studies into more complex AC circuit theory at a later time (many textbooks will provide radian calculations). For now, the diagram shows how the amplitude of a sine wave at any point in time can be referenced to a specific angle between 0 and 360°. As the wheel rotates, the point marked begins at time 0 with an angle of 0° on our amplitude/time graph (where the x-axis is time). As time increases, so does the angle of rotation and also the amplitude of the sine wave until it reaches its peak value at 90° (or π2 radians). From this point, the amplitude of the sine wave decreases back to 0, but the angle of rotation increases to 180° ( π radians). The amplitude decreases again until it reaches the trough value at 270° degrees ( 3π2 radians), before increasing again until it returns to 0 at 360° ( 2π radians).

Any point on a sine wave can be described by combining the peak amplitude of the wave and the specific time at which the point occurs. This leads to the standard equation for the instantaneous (at a specific time) voltage and current of a sinusoidal input signal:

Instantaneous Voltage, V=Vp sin(t)Instantaneous Current,I=Ip sin(t)(6.3)
V is the instantaneous voltage in volts (V)
Vp is the peak voltage in volts (V)
Ip is the peak current in amps (A)
is the angle of the sine wave in radians (rad)
t is the time in seconds(s)

The equation above uses the symbol omega ( ω) to represent the angle of the sine wave at a given point (in radians). This value for ω can be derived using the frequency of the sine wave in question:

Sine Wave Angle, =2f(6.4)
is the angle of the sine wave in radians per second (rad/s)
f is the frequency of the sine wave in hertz (Hz)
2 equates to 6.283 for our calculations

The equation combines both known elements of a sine wave: each cycle of a sine wave will pass through a total angle of 2π radians (0–360°), and frequency is the number of cycles of a wave per second. Thus, the radian angle for a sine wave of a particular frequency can be calculated by multiplying that frequency by the value for a single cycle ( 2π). These equations can be used to calculate the instantaneous voltage for an input sine wave, as the following examples demonstrate.

6.2.1 Worked examples – finding the instantaneous voltage of a sine wave input signal

The first example will use a known frequency, while the second will use the period of the wave. In both cases, the relationship between the period, T (in seconds), and the measurement time, t (in seconds), is a good indicator of the value of the sine wave – note that both symbols are the same, so be sure to check for capitals!

Q2: An AC electronic circuit has an input signal that is a sine wave of peak voltage +5V and frequency 200Hz. If the input is measured 50 milliseconds after the signal is connected, what would be the amplitude of the signal?

Answer: The voltage level of a sine wave signal at 200Hz measured at a time of 50 milliseconds is ~0V.

Q3: An AC electronic circuit has a sine wave input signal with a peak voltage +5V and a period of 10ms. If the input is measured 52.5 milliseconds after the signal is connected, what would be the amplitude of the signal?

Answer: The voltage level of a sine wave signal of period 10ms (100Hz) measured at a time of 52.5 milliseconds is ~5V.

Using the instantaneous voltage calculation for an input sine wave, some practical measurements can be made that are used in audio circuits. In Figure 6.8, both the average (VAVG) and the root mean square (VRMS) voltage levels were marked, which are less than the peak value. At first glance, the average voltage would seem straightforward to calculate, but it must be remembered that a sine wave is half positive and negative parts in a single cycle – as shown in Figure 6.7, a normal sinusoid will cancel itself out to give an average value of zero. Instead, the first half of a sine wave cycle is measured as the average of the sum of a number of points within it, which are known as mid-ordinates (Figure 6.10).

Figure 6.10Measuring mid-ordinate points on a sine wave. The diagram shows how measuring a set of points in the positive half cycle of a sine wave can be used to find the average value (VAVG) of that wave. For a pure sinusoid, this value equates to 0.636*Vp. We can also calculate the root mean square (VRMS) voltage, which at 0.7071*Vp is the equivalent DC voltage level that would be applied to the circuit.

The diagram shows two methods of defining the average voltage for a sine wave, each using a set of mid-ordinate points that represent the voltage level measured at regular intervals along the positive half of the cycle. In the case of average voltage, the values are summed and divided by the number of points involved. More commonly, the values are squared, summed, divided by the number of points and then the square root of this result is taken – the root mean square (RMS) voltage:

Root Mean Square Voltage, VRMS=V12+V22+V32+Vn2n=0.7071×Vp(6.5)
VRMS is the equivalent DC voltage signal in volts (V)
Vn is the voltage at a specific mid-ordinate point n in volts (V)
n  is the number of mid-ordinate points

The root of the mean of the sum of squares (RMS) equates to a value of  0.7071×Vp for any pure sinusoidal circuit – the value comes from 12 as a factor of ω (the derivation of the full equation is not required in this book). RMS voltage measurements are used throughout electronics to represent the equivalent DC signal voltage that the AC input would generate. This allows the power in a circuit or system to be calculated by substituting the equivalent DC value into the electrical power equation introduced in chapter 4 (section 4.9, equation 4.2) – Power, P = Current × Voltage = I. VRMS measurements are often included as part of the specification for a piece of electronics equipment, particularly in the case of audio amplifiers and loudspeakers. By using equivalent DC voltage, the power output to a loudspeaker can quickly be calculated to ensure that an amplifier will not damage it. The final element used to describe an AC signal is its phase, which can be difficult to learn because the calculations require more detailed mathematical models that involve complex numbers (combining two quantities as a real and imaginary pair). Having said this, the conceptual aspect of phase is much more straightforward, as it relates to the relative position of one sine wave to another (Figure 6.11).

Figure 6.11Sine wave phase example. In the diagram, two sine waves of equal amplitude and frequency are shown. The first wave (solid line) begins with amplitude 0 at time 0, but the second wave (dashed line) does not cross the amplitude axis until later in time, therefore it lags the first wave and there is a phase difference between them – only one cycle of the second wave is shown for clarity.

The diagram shows two sine waves, where both have equal amplitude (Vp) and frequency (Period, T, is shown). The first wave crosses the origin at time 0, so it begins with an amplitude of 0. The second wave (shown as a dashed line) crosses the 0 amplitude point much later in time, and thus the second wave lags the first wave. This can be confusing when you first look at the diagram, as the second sine wave appears visually to be ‘ahead of’ the first, but it must be remembered that the x axis denotes time, and the greater the time value the later the wave will be – it is lagging behind a wave that started its cycle earlier in time. Conversely, it can be said that the first wave leads the second wave, as it begins its cycle first. The phase difference between these two waves is defined in terms of the rotational angle between them, where the angles can be compared at a specific point in time to determine the relative lead or lag (Figure 6.12).

Figure 6.12Phase angle difference between two sine waves. The diagram shows the same sine waves as Figure 6.11, but as both waves have the same amplitude the y-axis is omitted for clarity. The x-axis indicates the angle of the first wave (in degrees), where it can be seen that the second wave has a 0° angle when the first wave has an angle of 90°. The second wave lags the first wave by 90°, which is defined by the phase angle .

The diagram shows the main phase angles for each sine wave over time, where by inspection it can be seen that the second wave is at 0° when the first wave is at 90°. This means the phase relationship can be stated as the angle difference between the two waves in either direction as required, where the second wave lags the first wave by 90°. The equations for instantaneous voltage and current can thus be updated, to take into account the phase angle θ of the signal relative to a known reference:

Instantaneous Voltage, V=Vp sin(t+)Instantaneous Current, I=Ip sin(t+)(6.6)
V is the instantaneous voltage in volts (V)
Vp is the peak voltage in volts (V)
Ip is the peak current in amps (A)
is the angle of the sine wave in radians per second (rad/s)
t is the time in seconds(s)
is the phase angle difference in radians (rad)

In the equation, the value for θ is calculated in radians relative to a known reference. In practice, either a sine wave that has amplitude 0 at time 0 or another wave is used for reference. It is important to reiterate that a positive phase angle means the signal leads the reference – addition means the wave will cycle earlier in time (Figure 6.13).

Figure 6.13Leading and lagging phase angles. The diagram shows how a positive phase angle means the wave is leading the reference – in this case amplitude 0 at time 0. A lagging wave occurs later in time, so the phase angle must be subtracted in the calculation.

The diagram shows how phase angles are calculated, where a positive angle leads and a negative angle lags. It may seem that this point is being repeated, but the most important thing for your understanding of phase is the use of the words lead and lag: because the x-axis is time, the wave furthest left in the graph is leading any other wave that comes later in time. This chapter also introduces capacitors, which behave differently depending on the frequency of the input signal (only resistors remain constant as frequency changes). Other components (e.g. amplifiers) also change the phase of an input signal, and thus a system containing any of those components (effectively all of them!) has an impact on signal phase. As a final note on phase, note the result of combining (adding) two sine waves of the same amplitude and frequency but with different phase – this illustrates the effect of phase cancellation on signal output (Figure 6.14).

Figure 6.14Sine wave phase cancellation. The diagram shows two sine wave addition examples, where the left-hand example adds two sine waves of the same amplitude, frequency and phase angle – the output is also in phase with these signals. The right-hand example adds two sine waves of the same amplitude and frequency, but the second wave lags the first by 90°. The resulting output wave is lower in amplitude than the first output, and also lags the input signal by 45° (as shown by the phasor diagrams to the right of each wave).

The diagram shows how phase cancellation can occur when combining signals, where the output signal in the right-hand graph is now lower in amplitude and lagging the original input signal by 45°. A simple example of a phasor diagram for each wave is shown to the right of this graph, which uses trigonometry to calculate the resulting phase angle produced when combining multiple signals. At this point, any further discussion of phasors requires mathematical explanation involving complex numbers, which is not needed at an introductory level. Having said this, phase is crucial to working with audio signals and it is something you will learn more about as you progress your audio electronics learning – simulation tools (like LTspice) allow phase angles to be visualized quickly, so their impact can be modelled and evaluated in your own circuits without knowing how to perform the derivations on paper.

Phase cancellation is a potential issue in any instance where different audio signals are combined. Everything from effects processors with multiple paths (e.g. sidechains), buffer amplifiers on a preamp, power amplifiers that provide separate monophonic amplification and indeed any form of stereo signal path may potentially lead to phase alignment issues. The reduction in amplitude seen in the right-hand example will increase as the phase angle increases, until a 180° lag between the inputs will completely cancel out the output signal. This amplitude reduction is compounded by the overall phase lag introduced (in the example, a lag of 90° on one input creates an overall lag of 45°), which will now be carried into the next stage of the audio circuit or system. In this book, the 2-band equalizer used in chapters 8 and 9 is a multiple-path circuit and although each filter stage will introduce phase shifts due to the use of capacitors they are not analysed. This deliberate omission aims to focus instead on the use of simple components to build audio filters, where the frequency-dependent behaviour of the capacitor allows us to build practical audio circuits. In more advanced high-fidelity audio, the issue of phase cancellation cannot be so easily ignored.

6.3 Capacitance – storing charge over time

This section provides several equations for capacitors (e.g. charge, reactance, time constant) that are mathematically derived by a combination of Ohm’s Law, Kirchoff’s Laws, trigonometry and calculus. These derivations are provided purely for your understanding of the conceptual relationships involved, but as this is not an engineering mathematics textbook the aim is not to work extensively with paper-based derivations and calculations. In practice, you will probably not need to derive these equations very often, only know how to use them:

To discuss capacitance, a fundamental concept from chapter 1 (section 1.2) must be reintroduced (Figure 6.15).

Figure 6.15Movement of electrical charge (adapted from chapter 1, Figure 1.5). Chapter 1 showed that electrical charge is the net sum of negative (electrons) and positive (holes) at a given point in space. The crucial element is that although electrons are displaced from atom to atom, the flow of charge is the relative change in balance between electrons and holes – not the movement of electrons from one point to another.

This diagram is crucial to understanding capacitors, because it illustrates a fundamental concept that can often be forgotten when learning circuit theory:

What this statement means is that though an electron may move from one atom to another, the net movement of charge is not dependent on this electron moving the entire length of the circuit. As one electron moves into a valence shell, other electrons can move out of it – and thus the net charge will change. This is an important distinction to make, as the book has referred to the movement of electrons so far – no distinction was needed when working with DC circuits. Now it is important to note the fundamental distinction between the local movement of an electron (which displaces others in a chain) and the global movement of charge that passes between atoms. The charge is carried by electrons, but the specific electrons moving may change. This is crucial to understanding the capacitor, where electrons are prevented from moving across an insulated gap (dielectric), yet the net charge can still move through the capacitor as an AC signal.

Chapter 2 briefly introduced the capacitor. A capacitor stores electrical charge in an electrostatic field that is created when a charge is applied between two conducting surfaces (Figure 6.16).

Figure 6.16Capacitor example, adapted from chapter 2. In the diagram, a voltage source is used to supply electrical charge to the conductive plates (one positive, one negative). The build-up of charge between the plates becomes stored electrostatically in the air (or another insulator) between them. Thus, as the charge between the plates builds the capacitor will store more charge over time.

An electrostatic field occurs between two stationary charges (one negative, one positive) that are physically close together. You may have encountered static electricity before if you have rubbed an inflated balloon against a piece of cloth. The rubber in the balloon acts as an insulator that can store charge on its surface and rubbing the balloon against a conductor like cloth (wool is a good conductor) creates static electricity. The movement stimulates electrons to leave the surface of the cloth and travel towards the balloon and this electrostatic charge is then held on the surface of the balloon where the insulating rubber prevents the electrons from moving any further. If the balloon is now placed near a neutral (or positive) surface such as a wall then the charged particles on the surface of the balloon will be attracted to it – hence the balloon ‘sticks’ to the wall due to the attraction of the charged particles present. This simple example exploits the same principle as lightning strokes, where electrostatic charge is built up under certain cloud conditions and this creates an electric field in those clouds (the formation of a semi-ice water known as graupel is believed to be part of the cause). The Earth’s atmosphere acts as an insulator, so a huge electrostatic charge can build up in the clouds that is then attracted towards oppositely charged particles on the Earth’s surface. When a suitable conductor is introduced, the charge can flow through it – often with devastating effect given the electrical power in a lightning stroke. This is an important point about electrostatic charge that has direct relevance to capacitors:

A large capacitor (such as those used in audio power amplifiers) can store a significant amount of charge, and under certain conditions this charge can remain in the capacitor even after the power source that originally charged it disconnects. Thus, large capacitors can be dangerous if touched as the human body becomes a conductor for the charge they have stored. This book does not work with audio power circuits, but if you own an audio or instrument amplifier of significant wattage then it has the potential to store this power within its internal components – you must always be careful to ensure your own safety when working with such systems, to avoid coming into direct contact with dangerous components. In a capacitor, charge is stored in a dielectric insulator (such as mica, ceramic or plastic film) that is placed between conductive plates, where the plates can be flat (parallel plate) or rolled into a cylinder (Figure 6.17).

Figure 6.17Common capacitor examples. The diagram shows the common parallel plate and cylindrical capacitor designs, where the dielectric material acts as a barrier between the two conductive plates. The parallel plate capacitor has two metal plates with the dielectric sandwiched in between, whilst the cylindrical capacitor has a dielectric rolled between two sheets of metal foil. The right-hand image shows some common cylindrical capacitors.

A capacitor stores charge in the area between the conductive plates, so a larger surface area allows more charge to be stored. At the same time, the distance between the plates also dictates the charge that can be stored – less plate distance allows more charge to be stored as the electrostatic field is stronger. Physically larger capacitors can usually store more charge because of their larger surface area, and depending on their use can be significant in size. A capacitor stores charge when connected to a voltage source, where the build-up of negative electrons on one plate repels the electrons on the other plate to increase its overall positive net charge (Figure 6.18).

Figure 6.18Movement of charge in a capacitor. In the diagram, when the switch is closed at time 0 the increase in electrons on plate A repels electrons from plate B – which thus becomes more positive. Although the electrons on plate A are now attracted to the holes on plate B, the dielectric prevents them from moving. This creates an electrostatic field between the plates, which stores the charge. The difference in potential between the plates also creates a voltage (potential difference) across them.

The most important element of this diagram for your understanding is the difference between the net movement of charge and the physical movement of electrons – the electrons cannot cross the dielectric barrier, but more electrons have moved to plate A so the net charge on plate B becomes more positive. Thus, charge can flow through a capacitor, even though electrons cannot cross the dielectric. The circuit in Figure 6.18 actually uses a DC power source with a switch to simulate the simplest form of time-varying circuit, where the signal goes from 0 amplitude at time 0 to full amplitude immediately after the switch is closed. Although not an oscillating signal like a sine wave, this signal shows how the build-up of charge between the plates occurs in a capacitor. A capacitor does not fully charge up immediately – it takes time for the charge to build up across the plates (Figure 6.19).

Figure 6.19Graph of a capacitor charging over time. In the diagram, the switch in our circuit from Figure 6.18 is closed at time 0, allowing current to flow. As time increases, the middle graph shows how the capacitor charges up until the voltage across it is equal to that of the supply (Vs). Conversely, the right-hand graph shows how the current flowing through the capacitor reduces until it reaches 0 when the capacitor is fully charged – the capacitor effectively becomes a short circuit.

The diagram illustrates the importance of capacitors for time-varying signals. Unlike a resistor, the capacitor reacts differently to an input signal over time. A capacitor begins to charge up when a voltage is applied to its plates, but it will take a finite time (known as the time constant, ) for the charge between the plates to build up to full capacity (known as the capacitance, C). When the capacitor is fully charged, the potential difference between its plates is now at the same level as the voltage supplied to them – this is a crucial point, because it also explains why the current in a capacitor falls to 0 when it is fully charged. Once the potential at each capacitor plate is the same as the supply then there is no potential difference between them to move charge – the capacitor has effectively become a short circuit.

This can seem confusing at first, as capacitors are used so often in circuits it would seem bizarre for them to completely prevent current from flowing! The reason for this is the example above relates to a DC circuit, where the signal does not change. The case of a switch activating the circuit is used to provide a before and after at time 0, to help illustrate how a capacitor charges up. The amount of charge a capacitor can store is defined as its capacitance (in farads), based on the voltage across its plates:

Capacitance, C=QV(6.7)
C is the capacitance in farads (F)
Q is the charge in coulombs (C)
V is the potential difference between the capacitor plates in volts (V)

The equation defines capacitance in farads (F), but for audio signals capacitance values in the range μF (10−6) to nF (10−9) and even pF (10−12) are normally used, so it is important to remember that scaling factors will be a significant part of calculations (see chapter 1, Table 1.1). The relationship between charge and voltage determines how much charge is held in the capacitor, as the following example shows:

6.3.1 Worked example – calculating the charge on a capacitor

This example is mathematically straightforward, but it aims to show the relationship between charge and voltage for a capacitor – they both increase until the supply voltage is reached.

Q4: (a) A 5μF capacitor has a voltage of 2.5V across its plates – what is the charge stored in the capacitor?

(b) The same 5μF capacitor now has a voltage of 5V across its plates – what is the charge stored in the capacitor?

Answer: (a) The charge stored in the capacitor for 2.5V voltage supply is 12.5μC.

(b)The charge stored in the capacitor for a 5V voltage supply is 25μC.

A capacitor takes time to charge, and this is part of what makes them very useful for time-varying AC circuits. In a DC circuit, a capacitor has time to fully charge up and thus become a short circuit, but in an AC circuit the changing polarity of the voltage signals means the capacitor does not have time to do this. Electrical charge is proportional to voltage, so if the supply voltage decreases so will the charge on the capacitor – this circuit can then be combined with a resistor (to give the capacitor a path to discharge through), as an example (Figure 6.20).

Figure 6.20Discharging capacitor example. In this example, the effect of switching on a power supply to a capacitor that is initially uncharged (switch position A) is shown. The switch changes to position B at time = 0, and shortly after the capacitor will be fully. If at a later time (t >> 0) the supply is disconnected (switch position B), the capacitor will discharge through the resistor R1 until the capacitor voltage returns to 0 – there is then no potential difference to move charge.

This example circuit has a charging graph as shown in Figure 6.21.

Figure 6.21Graph of capacitor charging and discharging over time. In the diagram, the switch in the circuit from Figure 6.18 is in position A at time 0, allowing current to flow into the capacitor. As time increases, the middle graph shows how the capacitor charges up until the voltage equals the supply (VC = Vs) and no current can now flow (right-hand graph), before the switch is returned to position B at time >> 0. At this point, current can flow in the opposite direction (−Imax) and the capacitor can discharge through the resistor R1.

The diagram shows how a capacitor takes time to charge by applying a voltage pulse (i.e. switching from position B to A and then back again). The capacitor builds up charge based on the applied input voltage, so when the switch is moved to position A the full supply (VS) is applied across its plates and it begins to store charge. Once full charge has been reached, the capacitor effectively becomes a short circuit, and so if the switch was not moved back to position B it would oppose any current flow (which drops to 0). Once the capacitor can discharge again (through the resistor R1) current can flow, but this time it is flowing in the opposite direction to the initial supply voltage – hence the value of −Imax shown in the graph.

The idea of a time constant (τ) that governs the charge and discharge time of a capacitor was introduced earlier in this section. Now capacitance has been defined (and also how a capacitor’s voltage and current change over time), the time constant (τ) that describes the rate of change in a resistor/capacitor (RC) circuit can also be considered (Figure 6.22).

Figure 6.22Time constant in an RC circuit. The diagram shows the charge/discharge graph for the series combination of a resistor and capacitor. The values of both components dictate how long it takes for the capacitor to reach ~63% of its final charge level, which is known as the time constant (τ). The capacitor takes 5 time constants to reach full charge, and from there reduces to ~37% charge after a further time constant (6τ) – decreasing to zero after 5 time constants (10τ in total). This allows the charge graph to be defined by the number of time constants taken to fully charge or discharge.

The time constant (τ) denotes how long it takes for the capacitor to reach ~63% of the supply voltage, using the following equation:

Time Constant,=RC(6.8)
τ is the time constant in seconds (s)
R is the resistance in ohms (Ω)
C is the capacitance in farads (F)

The time constant equates to ~63% because the charging curve is exponential in shape (this equation is derived in the appendix). It will take a total of 5 time constants to reach full charge (when the plate voltage is equivalent to the supply), as each time constant increases the voltage by a further 63% of the previous value. Once fully charged, it will take the capacitor a further 5 time constants to discharge again, where 6τ defines when the discharge cycle reaches ~37% (100 − 63). The circuit above demonstrates a capacitor’s ability to store charge, which means they can become a source of charge at a later time. This is a common use of capacitors in power-supply circuits, where they are used to provide extra charge at points where the power-supply levels may not be guaranteed.

For example, car audio systems cannot rely on a constant current from the battery, given that the draw from other systems like headlights and windscreen wipers may vary widely over time depending on driving conditions. Even if a separate battery is used for the car audio system, the charge/discharge graphs shown in Figure 6.21 highlight another important use of capacitors – smoothing input signals. In chapter 4 (section 4.9), PWM output was used from the Arduino to light an LED. In that case, the duty cycle of the PWM output was used to approximate the same power (and hence average voltage) required to light the LED, but in practice the binary on/off nature of a digital signal does not provide a smooth enough supply to power electronic systems (particularly audio systems). Smoothing out a time-varying signal (such as PWM) is performed as part of a process known as rectification – the negative portion of the AC input voltage is inverted and smoothed to produce a DC output for consistent power supply (Figure 6.23).

Figure 6.23Full wave rectification example. An input AC power signal (such as a 240V 50Hz mains signal in Europe) must be converted to DC to provide a constant supply for an electronic circuit. To do this, a bridge rectifier circuit is used to invert the negative portion of the sine wave input cycle. Once inverted, the rectified signal must be smoothed using a capacitor to reduce the ripples in the output. In so doing, a rectifier uses a capacitor as a simple form of filter.

In the diagram, the AC signal is rectified by inverting the negative portion of the wave to produce a fully positive output (diode rectification will be discussed in the next chapter). After inversion, the rectified signal is smoothed by passing it through a parallel capacitor that charges up while the voltage signal is increasing to Vp, and then discharges as the signal decreases from Vp back to 0. Looking at the graphs in Figure 6.21, it can be seen that although the input signal is a square wave, it still rises and falls like a sine wave (just with a gradient of 1 and minus 1). Thus with a sine wave, the current flowing out of the capacitor also increases to peak value (Imax) as the input voltage goes to 0 – this is what happens in a rectifier.

Using a capacitor to smooth these types of binary signal is also part of digital to analogue conversion, where the discrete output levels of the digital audio sample data must be smoothed by filtering to produce a more suitable output. We will learn more about filters in chapter 8, where we will build circuits for both low- and high-pass filters that use a capacitor as the component that varies with input signal frequency. To do this, we need to know how a capacitor will react at different frequencies, which is defined as its reactance. In the appendix, the equation for capacitor voltage in terms of current and capacitance is derived:

Capacitor Voltage, VC=IpCcost(6.9)
Ip is the instantaneous current in amperes (A)
C is the capacitance in farads (F)
is the angle of the sine wave signal in radians (rad)
t is the time in seconds (s)

This can then be used to derive the equation for capacitive reactance (XC):

Capacitive Reactance, XC=1C(6.10)
XC is the reactance of the capacitor in ohms (Ω)
C is the capacitance in farads (F)
is the angle of the sine wave signal in radians (rad)

Looking at this equation, it can be seen that the reactance of a capacitor is effectively defined by its capacitance and also frequency (recall that ω=2πf). This means that capacitors vary their reactance with frequency, which is a crucial point for audio electronics. Returning to the diagram in Figure 6.18, the switched DC voltage source can now be replaced with an AC signal to show how the change in polarity of the input allows the capacitor to charge/discharge without ever becoming a short circuit (Figure 6.24).

Figure 6.24Charge movement for an AC signal in a capacitor. In the diagram, the alternating signal is constantly changing polarity, and so the voltage at each capacitor plate changes polarity too. This means charge does not have time to build up and so the electrostatic field is not as strong – current can still flow across the plates. If the frequency of the AC signal is high enough, the capacitor will not have time to charge up at all – it effectively becomes an open circuit.

In the diagram, the constantly varying AC input signal provides a different voltage polarity to each capacitor plate at different points in its wave cycle. When the input signal is highest (stage 1), plate A will be negative and plate B positive and an electrostatic charge starts to build up between them. As the input signal now decreases again, the voltage between the plates decreases and current can flow to discharge the capacitor (see Figure 6.21). When the input signal decreases further to its lowest point (stage 2) plate A will now be positive and plate B will be negative – an electrostatic charge starts to build up between them again. The input signal will now increase (towards stage 3), and as the voltage between the plates decreases current can flow once again and discharge the capacitor. Thus, the capacitor never fully charges up, and so current can flow throughout the wave cycle. If the frequency of the input signal is high enough, the capacitor effectively becomes an open circuit – it does not react to the input signal and current can flow.

It is important to understand the charging ability of capacitors, as they are used extensively in both amplifier and filter circuits. A capacitor can be used to smooth signals, filter input, block DC signals (chapter 9) and provide charge to different parts of a circuit – they are an incredibly versatile component and used throughout electronics. Returning to our equation 6.10 for capacitive reactance, a short example is provided to show how signal frequency changes reactance.

6.3.2 Worked example – calculating capacitive reactance for different input frequencies

This example shows how capacitive reactance varies with the frequency of the input signal – this is used in chapter 8 to build audio filter circuits.

Q4: (a) A 5μF capacitor has an AC input voltage of 5V at a frequency of 100Hz – what is the reactance of the capacitor?

(b) The same input voltage now has a frequency of 1kHz – what is the reactance of the capacitor?

Answer: (a) For a 100Hz AC signal input, the capacitor has a reactance of 318.32Ω.

(b)For a 1kHz AC signal input, the capacitor has a reactance of 31.83Ω.

This example gives a basic demonstration of how capacitive reactance decreases with frequency. Taking these examples further, scaling to a 10kHz signal would give a reactance of 3.183Ω – effectively negligible in most circuits. Note in the examples above that reactance is measured in ohms (Ω), which is part of the AC definition of resistance – impedance. The next section will show how to combine capacitors in series and parallel, and also how to determine overall circuit impedance when they are combined with resistors. It is recommended that you reread this section again after completing this chapter, to ensure you are comfortable with the behaviour of capacitors – they are arguably the most versatile (and commonly used) component in electronics, and for AC signals (like audio) they are essential.

6.4 Impedance – combining AC components

The previous section reintroduced the chapter 3 concept of resistance to the flow of current as being proportional to voltage over current ( R=VI). This relationship was then used to define the reactance of a capacitor, also in ohms (Ω), which varies with frequency. Resistance is a time-invariant quantity, in that a resistor will not change with the frequency of the input signal. When working with components like capacitors that do vary their response based on signal frequency, a term is needed that will encompass both resistive and reactive elements. This term is called impedance, which reflects the time-varying nature of the signals it is used with.

Capacitors can be combined in both series and parallel – they effectively behave in the opposite manner to resistors in DC circuits (Figure 6.25).

Figure 6.25Series capacitor circuit. The diagram shows two capacitors connected in series, where the sum of the voltages across each capacitor (VC1 and VC2) is equivalent to the total voltage (Vtot) for the circuit. An AC supply is shown, but time is not included in magnitude calculations.

In the appendix, the equation for total series circuit capacitance is derived:

Total Series Capacitance, 1Ctot=1C1+1C2+1Cn(6.11)
Ctot is the total series capacitance in ohms (Ω)
n is the number of capacitors in series

This equation may initially seem slightly counterintuitive – chapter 3 showed that series resistors combine by addition, so why would capacitors behave differently? Although the mathematical proof is reasonably straightforward, it can help to remember that capacitance is dictated by the distance between the plates that hold the charge – the greater the distance, the lower the charge that can be held. Thus, if capacitors are added in series the physical distance between the total charge from the circuit supply becomes greater than the sum of each individual capacitor distance (Figure 6.26).

Figure 6.26Capacitor plate distance in series circuits. In the left-hand diagram, a capacitor has a specific plate distance (d1) that separates the overall charge provided by the supply VS. When two capacitors are combined in series in the right-hand diagram, the gap between the overall supply charge now includes an additional distance (d2) due to the physical connection of each capacitor – the total distance of (2 × d1) + d2 is greater than d1 + d1 and so the overall capacitance is reduced.

The diagram shows how combining two series capacitors includes an additional distance d2, which reduces the overall capacitance as a result. The charge on each capacitor is less important than the total charge held between the left plate of C1 and the right plate of C2 – this is the total capacitance when components are combined in series. The extra physical distance d2 reduces this total capacitance, which explains why combining two capacitors in series will create a total capacitance that is less than their sum. The equation for total capacitance when capacitors are connected together in parallel can also be stated (Figure 6.27):

Figure 6.27Parallel capacitor circuit. The diagram shows two capacitors connected in parallel, where the total charge (Qtot) is the sum of all branch charges (Q1 and Q2) in the circuit. Again, an AC supply is shown but time is not included in the magnitude calculations.

Total Parallel Capacitance, Ctot=C1+C2+Cn(6.12)
Ctot is the total parallel capacitance in ohms (Ω)
n is the number of capacitors in parallel

In this case, the voltage across each branch in the circuit is equal, and so an equal amount of charge can develop across each capacitor (see the appendix for a full derivation). This means that the total capacitance in a parallel circuit is equal to the sum of all capacitances within it. These two equations show how capacitors can be combined to define an overall capacitance value in the opposite manner to that used for resistors (where the reciprocal value is used for parallel combinations). This is useful when working with more complex component combinations, but what happens when combining resistors and capacitors within the same circuit? The previous section showed that a capacitor has a reactance in ohms (Ω) that varies with the frequency of the input signal voltage applied to it. Ignoring frequency, the reactance becomes the ratio of voltage over current ( XC=VI), in much the same way as it is for resistance ( R=VI). This relationship can be used to determine the total impedance (symbol Z) for a series circuit that contains both a resistor and capacitor (known as an RC circuit). To do this, each component voltage must be defined with its associated phase angle using a phasor diagram (Figure 6.28).

Figure 6.28RC series circuit phasor diagram. The left-hand diagram shows a resistor and capacitor in series, connected to an AC voltage supply (VS). The right-hand diagram shows the resulting phasor diagram for this circuit, where the voltages in the circuit are combined to include the phase angle of each component. As it does not vary with frequency the resistor has phase angle 0°, whilst the capacitor has a phase angle of −90°. The overall phase angle can be found using the arctangent of the reactance divided by resistance: ϕ=tan1(XCR).

The phasor diagram is a common way of analysing an AC circuit by combining component voltages (or currents) with their associated AC phase angles. From trigonometry, ϕ=tan1XCR can be used to calculate the overall phase of an RC circuit. Although this book does not go into detail on phase angles, a phasor diagram can be used to show how to derive the overall impedance (Z) of the circuit. The resistor voltage (VR) is shown with a phase angle of 0o, as resistive components do not vary with frequency. The previous section derived the voltage across a capacitor as VC=IpCcost and the negative cosine component of this equation explains why the capacitor voltage in the diagram has a phase angle of −90o. The overall voltage (VS) of the circuit forms the hypotenuse of this triangle, and trigonometry can be used to define the magnitude of this voltage. A similar equation can also be defined for the total circuit impedance (Z) in an RC series circuit:

Voltage Magnitude, VS=VR2+VC2Series Impedance, Z=R2+XC2
(6.13)
VS is the supply voltage in volts (V)
VR is the series resistor voltage in volts (V)
VC is the series capacitor voltage in volts (V)
Z is the total series impedance in ohms (Ω)
R is the series resistance in ohms (Ω)
XC is the reactance of the series capacitor in ohms (Ω)

The magnitude of the overall current (I) can also be stated for a parallel circuit (Figure 6.29).

Figure 6.29RC parallel circuit phasor diagram. The left-hand diagram shows a resistor and capacitor in parallel, connected to an AC voltage supply (VS). The right-hand diagram shows the resulting phasor diagram for this circuit, where the currents in the circuit are combined to include the phase angle of each component. As it does not vary with frequency the resistor has phase angle 0°, whilst the capacitor has a phase angle of −90°.

As the voltage (VS) in a parallel circuit will be constant across branches, this also allows the total parallel impedance (Z) to be calculated using Ohm’s Law:

Current Magnitude, IS=IR2+IC2Parallel Impedance, Z=VSIS(6.14)
IS is the total parallel current in amps (A)
IR is the parallel resistor current in amps (A)
IC is the parallel capacitor current in amps (V)
VS is the supply voltage in volts (V)
Z is the total parallel impedance in ohms (Ω)

These equations allow a series AC circuit to be analysed in much the same way as DC series circuits in chapter 3. Resistive and capacitive components can be combined by determining their overall impedance as the root sum of squares of the resistance and reactance terms. Thus, to determine the overall current in an AC circuit the total impedance (Z) can be calculated and then Ohm’s Law used to solve for a known supply voltage. Extending this thinking, the reactance equations from 6.12 and 6.13 can be combined with their total resistance equivalents (chapter 3, equations 3.3 and 3.5) to analyse more complex component combinations in terms of their total resistance and reactance – as the following examples show.

6.4.1 Worked examples – analysing combined resistive and reactive circuits

These examples show how to analyse combinations of resistors and capacitors within an AC circuit. In the second example, equivalent capacitors and resistors are used to represent the total value for a parallel branch within the circuit – this is a common technique that is worth practising. Phase is also ignored in these calculations for brevity and to reduce complexity, but note that it is crucial to more advanced circuit analysis.

Q5: The schematic below shows an AC circuit combining a 10kΩ resistor in series with a 5μF capacitor. The circuit has an input voltage of 5V at a frequency of 1kHz:

(a) What is the reactance of the capacitor?

(b) What is the magnitude of the total impedance of the circuit?

(c) What is the current flowing through the circuit?

(d) What are the voltage drops across the resistor (VR) and the capacitor (VC)?

Answer: (a) For a 5V 1kHz AC signal input, the capacitor has a reactance of 31.83Ω.

(b)The total impedance of the circuit is ~10k .

(c)The current flowing through the circuit is 0.5mA.

(d)The resistor voltage (VR) is 5V, and the capacitor voltage (VC) is 16mV.

Q6: This circuit combines two series 10kΩ resistors in parallel with a 5μF capacitor and another parallel branch containing two series 5μF capacitors. The circuit can be broken into stages to analyse each parallel branch, to then represent the total resistance or reactance as a single equivalent value. The circuit has an input voltage of 5V at a frequency of 1kHz:

(a) What is the total reactance of the capacitors?

(b) What are the individual branch currents in the circuit?

(c) What is the magnitude of the total impedance of the circuit?

(d) What is the magnitude of the total current flowing through the circuit?

Answer: (a) For a 5V 1kHz AC signal input, the total reactance in the circuit is of 21.22.

(b)The branch currents are I1 = 0.25mA, I2 = 157mA and I3 = 78.5mA.

(c)The magnitude of the total impedance in the circuit is ≈ 20kΩ.

(d)The magnitude of the total current in the circuit is 235mA.

This second circuit example is significantly more complex, as it includes multiple components and uses various circuit analysis techniques to get the required results. It is also important to note that had a parallel branch containing both resistive and reactive elements been included then the calculations would have become significantly more involved, and this is where phasor diagrams become essential. The mathematical calculations required when working with phasors are beyond the scope of an introductory textbook in some ways, as this can often lead to learners losing interest in electronics at an early stage. These examples are included to aid in your understanding, and also demonstrate why simulation tools are so important to practical electronics work. This section has focussed on deriving and demonstrating the basic equations that govern AC circuits, to show why a simulation tool that could automate this process would be preferable. LTspice is capable of calculating these equations both at speed and to a high degree of accuracy, so the next section covers its installation and use.

6.5 Tutorial: installing LTspice

The previous examples help to illustrate the amount of time and effort needed to work through the calculations needed to analyse even simple resistor capacitor circuit combinations. In addition, it is very easy to make mistakes with scales and quantities, and so automated simulation tools become an essential part of designing and prototyping circuits. Tinkercad is a great simulation tool, but it does not carry out some of the more advanced analysis needed for audio signals and circuits. LTspice is a very powerful software tool for electronic circuit analysis and simulation. LTspice is free to use and runs on both the OSX and Windows platforms. This section provides a brief overview of how to use LTspice, prior to analysing two circuits in the example projects that follow. LTspice can be downloaded from the Analog Devices website (www.analog.com) at the following link: www.analog.com/en/design-center/design-tools-and-calculators/LTspice-simulator.html#.

From there, the installation is reasonably straightforward and provides you with a fully functional copy of LTspice – along with a large set of demo circuits. It is important to note that although in many ways a very powerful tool that significantly reduces the time needed to design electronic circuits, LTspice is perhaps not the easiest user interface to work with. It is recommended to spend some time learning this interface by practice, as some elements of LTspice can initially be frustrating until you become familiar with the thinking behind them. Screenshots for the OSX platform are provided for information only, so your own interface configuration may be slightly different. One of the first things that can help is to change the interface colour scheme from the control panel – accessed by the hammer icon (Figure 6.30).

Figure 6.30LTspice control panel. Clicking the hammer icon (dashed line inset) brings up the control panel, where the Configure Colors options can be accessed. From there, setting the background to white (255,255,255) is recommended, alongside setting wires and components to black (0,0,0).

From this point onwards, the default colour scheme has been changed in the control panel to make it easier to see the schematic in black on a white background – this is also useful if you cannot see certain colours easily. With a new (empty) schematic created, a blank screen is shown; on OSX you can right-click to access most of the main editing commands – on Windows these are provided in a button bar at the top of the screen (Figure 6.31).

Figure 6.31LTspice main command set. By right-clicking on a blank space within the authoring area (grey window) the main command sets are shown (both Edit> and Draft> are overlaid in this image). These commands cover most of the common tasks in LTspice, but working with them can take a little time to get used to.

The diagram shows both the Edit and Draft command sets, which cover most common operations within LTspice. The Edit set provides tools for moving, deleting and duplicating components, which can initially confuse as the component will be moved without its connecting wires! Similarly, the delete tool will either delete what is between the scissors in the icon or allow you to drag a bounding box for group deletion (Figure 6.32).

Figure 6.32Moving and deleting components in LTspice. The left-hand image (dashed line box) shows how a single deletion is performed by moving the scissors icon over the component – group deletion (by bounding box) is not recommended until you are familiar with LTspice! The right-hand image shows how the second component is moved without retaining its connecting wires: these broken connections will now cause errors during analysis and simulation.

Adding components is fairly straightforward (on OSX you can rotate a component using CTRL>R, but it is recommended to spend a little time thinking through the schematic layout (even sketching it quickly on a piece of paper for reference) to help set things out quickly – moving them afterwards can often take more time! When adding a component on OSX, a list of libraries is provided where different options can be chosen. We will be working with some of the most common components, which include voltage sources, resistors and capacitors (Figure 6.33).

Figure 6.33Common component libraries in LTspice. The voltage source (left-hand image) is probably the most common component in LTspice, and it is capable of simulating a wide range of input signals. LTspice defaults to North American symbols for resistors – a European equivalent (right-hand image) can be found under the misc folder (these will be used for consistency with the rest of the book).

Voltage sources are flexible and powerful input components, and will be used for all simulations with LTspice in this book. Both DC and AC inputs are possible, alongside sine and pulse waveforms – even loading an audio wave file into LTspice is possible as a voltage source input for simulation! The voltage source is effectively the core of an LTspice circuit, as its configuration determines how the circuit can subsequently be analysed and simulated. The various configuration options will be covered in each example, to introduce them to you in a practical context. The right-hand image shows a European resistor symbol, which is stored in the [Misc]> folder – this symbol is used for consistency with the other schematics in this book, but the North American version (listed as res in the main folder) is exactly equivalent so either can be used in your own circuits. Once the components are added, we need to specify values for them. To do this, right-click on a component to bring up the dialog options box for values (Figure 6.34).

Figure 6.34LTspice component dialogs. The diagram shows dialog boxes for voltage (left-hand image), resistor (middle image) and capacitor (right-hand image) component settings. Notice that capacitors require a capital F to be added after the value – otherwise LTspice will not see it as a capacitance!

LTspice will accept voltage and resistor values with scaling factors only (i.e. no measurement units), but for capacitors you must include the farad (F) units alongside your scaling factor (μ = u, n = n, ρ = p) or LTspice will not factor it into the simulation as a valid capacitance value. There are exceptions to this rule – 1 MEG for 1MΩ and 1 (no unit) for 1 farad capacitance. With components added, the next thing to include is a ground (GND) node for the circuit – no simulation can be performed without a valid GND node (Figure 6.35).

Figure 6.35LTspice ground node. Adding a ground (GND) node is straightforward, where a new Net Name is selected, a GND (node 0) is specified and then the component is moved to a place where it can be connected to the rest of the circuit.

With a voltage source, components and a ground node (GND) added, wires can now be drawn to connect them into a full circuit (Figure 6.36).

Figure 6.36LTspice example circuit. The diagram shows the simplest possible LTspice circuit for simulation – a 5V DC voltage source connected in series with a 10kΩ resistor. The GND node at the bottom of the circuit is essential, as is a valid Spice Directive to tell the application how to begin analysing the circuit.

This circuit uses a 5V DC voltage source in series with a 10kΩ resistor, where the DC voltage is the simplest form of input signal that can be provided to the circuit. The other essential component to be added is a valid Spice Directive, which tells LTspice how to analyse the circuit when running a simulation. The circuit in Figure 6.36 shows DC 5V, but the example projects will introduce some of the more useful voltage source functions when the input source is changed from a pulse signal to an AC sine wave. For now, the simplest form of Spice Directive is a transient analysis command (Figure 6.37).

Figure 6.37An LTspice transient analysis Spice Directive. The diagram shows how to add a Spice Directive (left-hand image), what command to type (middle image) and a suggested location to place the command in the schematic (right-hand image). This command uses the syntax (.tran) to specify a transient (time) analysis window, followed by the number of points to calculate for analysis (200), the end time (1 second) and the start time (0 seconds).

The transient analysis command is a Spice Directive (the original Spice simulator significantly predates LTspice) that simulates the behaviour of the circuit over a specific time window. This command is structured as follows:

The example above shows a transient command that will start at time 0 and calculate 200 data points before stopping at time 1 second (the command is spaced to align with the structure). LTspice automatically determines the time difference between data points, and if the syntax is correct, a simulation can now be performed by clicking the run icon (Figure 6.38).

Figure 6.38LTspice circuit simulation window. In the diagram, when the run icon (dashed box, top left) is clicked the simulation begins. The left-hand image shows the full circuit (with transient directive) and the right-hand image shows the resulting simulation window displaying a 5V DC signal trace over 1 second. Note the probe icon above the resistor – this is how simulation values are measured in the circuit.

LTspice will be used to simulate circuits with a variety of signal inputs (e.g. sine, pulse) and chapter 8 (worked example 8.4.3) will demonstrate how audio wave data can also be loaded for simulation. For now, the tutorial will work through all of the steps discussed above to perform a transient analysis of a 5V DC source connected to a 10kΩ series resistor.

Tutorial steps

Create a new circuit in LTspice and name it chp6_tutorial.

Add a voltage source component (on OSX, right-click and select Add Component, scroll down to <V> in the list).

Add a resistor in parallel to the voltage source – a European resistor is shown for consistency, but North American symbols are functionally equivalent.

Add connecting wires between the two components, so they are connected in series. LTspice provides a set of coordinate crosshairs when drawing wires to allow accurate measurement of right angles in the circuit.

Add a GND connection for the circuit by selecting Draft>Net Name.

In the Net Name dialog, click GND and it will automatically assign it a Node number.

Now place the GND connection under the existing circuit layout and connect it to the bottom wire – LTspice will not simulate a circuit without a valid GND connection.

Now specify values for the voltage source (5V DC) and the resistor (10kΩ).

Add a transient analysis command to create a 1 second simulation window (starting at time 0 seconds) with 200 data points.

Run the circuit simulation (clicking the run icon) and use the voltage probe (it will only appear at potential measurement points on the schematic) to measure the DC voltage from the source – it should create an output trace in the simulation window that is a straight-line 5V (y-axis) over 1 second of time (x-axis).

6.6 Example project – AC analysis with LTspice

This project will build two series resistor and capacitor (RC) circuits to practise simulating circuits with LTspice. Although the component values will differ, both circuits will use the series component layout shown in Figure 6.39.

Figure 6.39Example project schematic. The diagram shows an RC circuit, where a resistor and capacitor are connected in series. In each example project, the values of R and C will change (to define a time constant, and to show phase shift at output) but the layout will remain the same. The measurement nodes for the circuit (V(n001) and V(n002)) are also marked – this is where the analysis probe will be placed during simulation (Spice numbers circuit nodes sequentially by measurement).

6.6.1 Example project – circuit 1

The first example will analyse an RC circuit to show the charge/discharge curve of a capacitor responding to an input pulse waveform (Figure 6.40).

Figure 6.40Example circuit 1 input waveform, adapted from Figure 6.21. In the diagram, a pulse input waveform causes the capacitor to charge and discharge over time based on the time constant (τ) of the circuit. The pulse must remain HIGH (5V) until the capacitor has fully charged, which will take 5 time constants (5τ). Thus, R and C values must be calculated that will align with the duration of the input pulse.

To set up the LTspice analysis window properly, an input pulse must be defined and then component values calculated for the resistor and capacitor that will produce a manageable time constant (τ) to allow this pulse to be analysed. Equation 6.8 states that the

Time Constant,τ=RC
and knowing that the pulse must remain HIGH (5V) for 5 time constants (5τ) to allow the capacitor time to fully charge up, a reasonable length for the input pulse (say 1 second) can be chosen to work backwards to find values for R and C that will produce the time constant (τ) required:

Now this RC circuit can be built in LTspice, using component values of R = 40kΩ and C = 5μF. Create a new circuit in LTspice and name it chp6_proj1. The process for creating the schematic is as follows:

1.Lay out the components: voltage source, resistor, capacitor and the GND node.

2.Connect the wires to form a series circuit between Vs, R, C and GND.

3.Specify resistor and capacitor values of R = 40kΩ and C = 5μF.

4.Configure the voltage source to be a pulse input waveform of 1 second duration (choose Vs = 5V for consistency with previous circuits) – setting up this command will be discussed below.

5.Add a Spice Directive to perform a transient analysis of 2 seconds (10τ) to analyse the full charge/discharge curve of the capacitor.

Setting up the voltage source as a pulse input requires the advanced option in the editor dialog (Figure 6.41).

Figure 6.41Creating a pulse input source in LTspice. In the diagram, on OSX clicking on the advanced option in the editor dialog (left-hand image) provides access to a range of settings for various waveforms. Selecting a pulse function from the dropdown options (right-hand image) allows the input to be configured for 0V (LOW) and 5V (HIGH) starting at time, t = 0 (Tdelay = 0) for a duration of 1 second (Ton = 1) with a very short rise and fall time (Trise = Tfall = 0.001 seconds).

In the configuration window in Figure 6.41, a very short rise and fall time (Trise = Tfall = 0.001 seconds) are used to get the input pulse as close to a square wave as possible – if you continue your studies in digital electronics you will learn more about these kinds of practicality when working with binary signals. For now, a Spice Directive for transient analysis can be used to set up the full circuit for analysis (Figure 6.42).

Figure 6.42Example circuit 1 final LTspice circuit. The diagram shows a voltage source (Vs) configured for pulse input, connected in series with a 40kΩ resistor and a 5μF capacitor. A Spice Directive defines a transient analysis command, where the circuit will be analysed for 2 seconds, which should allow the full capacitor charge/discharge cycle (10τ = 2 seconds) to complete. The current probe is also shown near the capacitor C1, which can be combined with the voltage probe to measure all data for the circuit.

With the simulation running, the voltage and current probes can be used to analyse the V(n001), V(n002) and I(C1) points (see Figure 6.39 schematic) to compare the input pulse with the capacitor charge/discharge response curve (Figure 6.43).

Figure 6.43Example circuit 1 LTspice simulation. The image shows the V(n001) input pulse signal (light grey) that rises to 5V (HIGH) at ~time = 0 seconds (rise time 0.001 seconds) and then falls to 0V (LOW) at time = 1 second. The other traces show the capacitor charge/discharge curves for both voltage V(n002) and current I(C1) (range provided by second y-axis on the right of the graph), where at t = 1 second (5τ) the capacitor has fully charged (so Vc = Vs = 5V and Ic = 0A). At t = 2 seconds (10τ) the capacitor has fully discharged again. The dotted line shows the added cursor for V(n002), which gives a value of 3.15V (~63% of 5V) at time t = 0.2 seconds (τ).

In this simulation window, the traces show capacitor voltage V(n002) and current I(C1) for an input pulse wave of 5V (HIGH) that lasts for 1 second (5τ). The transient analysis window runs for a further 1 second to capture the discharge curve (10τ), where the reversal of current polarity (−Imax = −120μA) and the reduction in capacitor voltage Vc can be seen. Clicking on the V(n002) trace label (at the top of the simulation window) will add a cursor, which can be dragged (using the hand icon) to get close to a value for V(n002) at time, t = 0.2 seconds – the time constant (τ). The properties window for the cursor shows a value of 3.15V at ~200ms, which is effectively ~63% of the 5V supply to the capacitor. Thus, an RC circuit with a time constant τ = 0.2 seconds has been simulated, which produces an output simulation that aligns with the theoretical derivations for capacitor voltage, current and time constant.

6.6.2 Example project – circuit 2

This circuit can now be adapted to show the 90° phase angle of a capacitor, by reconfiguring the input source with a sine wave function. Before doing this, it is recommended to save a copy of the current circuit and name it chp6_proj2 to allow you to compare the two circuits at a later date. From the new circuit, the voltage source (and transient window) can be reconfigured to work with a sine wave input. The process for editing this schematic is as follows:

1.Specify resistor and capacitor values of R = 16Ω and C = 100μF.

2.Configure the voltage source to be a 100Hz sine input waveform.

3.Add a Spice Directive to perform a transient analysis of 0.05 seconds (5 cycles of a 100Hz wave).

Set up the voltage source as a sine input by choosing the advanced option in the editor dialog (Figure 6.44).

Figure 6.44Creating a sine input source in LTspice. In the diagram, a Sine function is selected from the dropdown menu in the Voltage Source editor window to specify an Amplitude of 5V with a frequency of 100Hz (other parameters are not used).

In the configuration window, an input voltage of 5V amplitude and 100Hz frequency is defined – the other parameters (such as DC offset, cycles, delay) are not needed for this analysis. The component values have also changed from the previous circuit, where the resistance (R1 = 16Ω) and capacitance (C1 = 100μF) values have been chosen to show the phase shift of the sine input signal created by the capacitor. The full circuit can now be set up for analysis (Figure 6.45).

Figure 6.45Example circuit 2 final LTspice circuit. The diagram shows a 5V 100Hz sine wave voltage source in series with a 16Ω resistor (R1) and a 100μF capacitor (C1). A transient analysis window of 0.005 seconds is used to capture 5 cycles of the 100Hz waveform for analysis.

The LTspice schematic shows the voltage source configuration for a sine wave input, alongside the transient analysis window of 0.005 seconds. Knowing that the input signal will have a frequency of 100Hz, equation 6.2 (from section 6.2) can be used to find the period of one cycle of the wave:

Using a transient analysis window of 0.05 seconds will show 5 cycles of the input sine wave V(n001), including the phase shift created by the capacitor at the output V(n002). Run the simulation, and use the voltage probe to analyse the V(n001) and V(n002) signals to compare the sine waves at both nodes (Figure 6.46).

Figure 6.46Example circuit 2 LTspice simulation. The image shows the input sine wave V(n001) in light grey, with the capacitor voltage V(n002) shown in black as the output. The phase angle of the capacitor means the output signal V(n002) lags the input signal – the exact value is calculated below.

The analysis window shows how the output voltage V(n002) trace lags the input voltage signal V(n001). Recall from Figure 6.28 that the overall phase angle of an RC circuit can be calculated using ϕ=tan1XCR, to verify what is seen in the graph:

The calculation shows that the output phase angle for V(n002) is 45°, which is half of the resistor (0°) and capacitor (90°) phase angles. These values of R and C were chosen to illustrate what happens when the resistive and reactive terms in a circuit are balanced – the resultant phase angle is ~45°. This will be discussed again in chapter 8 to show that the −3dB down point in a filter occurs when the resistive and reactive terms are equal – at a phase angle of 45°.

6.7 Conclusions

This chapter has provided an overview of AC circuit theory, to assist in later work on amplifiers and filters in this book. It is nevertheless important to restate that as this book is not a full introductory electronics text, elements such as induction and phase have either been completely omitted or simply given brief discussion. The chapter began by discussing the importance of sinusoidal waveforms in audio, as they are the building block of all pitched sounds. The harmonics of a sound were introduced, to show that filtering and equalization do not just affect the fundamental frequency of a sound – the higher-order harmonics of different instruments can often clash in more complex audio mixes. The basic components of an AC signal are amplitude, frequency and phase – these were discussed in turn whilst noting that phase, though essential to more advanced electronics circuit analysis, has not been covered in detail. Capacitors are a fundamental building block in electronics and are used extensively in audio circuits for amplification and filtering (alongside other signal conditioning). It was shown that capacitance is defined in terms of charge and voltage, and this relationship was used to derive equations for both the time constant and also the reactance of a capacitor. These resistive and reactive elements were then combined as AC impedance, though to focus on an introductory use of RC circuits again no detailed discussion of the role of phase in impedance was provided.

The tutorial covered the use of LTspice, a very powerful cross-platform tool that performs complex circuit analysis tasks without recourse to manual calculations (which can take time and are prone to errors). Although LTspice can take a little time to get used to as an interface, the speed and power of the tool are obvious when compared to the examples in the previous section – it will be used for AC circuit analysis from now on. The final example project showed how to use LTspice with an RC circuit to measure the time constant for a pulse input, and also to show the phase shift introduced by a capacitor for a sine wave input. These two examples can be used as templates for future work, where chapter 8 will show how to configure LTspice for audio wave data input for analysis. This chapter will also show how Bode plots are used to examine a sweep of frequencies as the input to a circuit – they are a very useful tool for working with audio circuits.

The next chapter will look at operational amplifiers as a means of signal amplification. Operational Amplifiers (Op-Amps) are examples of integrated circuits, where many transistors are combined within a single chip that keeps size, cost and noise to a minimum. The chapter will introduce transistor theory both as an explanation of Op-Amps and also to assist in future study, as many well-known audio effects circuits (e.g. pedals) are built around some form of transistor. Transistors can take time to learn in detail, so don’t be too concerned if you find this section difficult – it is not essential for practical Op-Amp work in the amplification of audio signals. The chapter contains the first analogue audio project in this book, taking a headphone signal as a sensor input and amplifying it to drive an output loudspeaker as a transducer. A systems approach will be used (as in previous chapters) to help demonstrate how Op-Amps can be used to build a circuit that will be extended in later chapters to include filtering (chapter 8) and Arduino control (chapter 9). In so doing, the chapter moves towards practical audio systems that can inform future study of more advanced topics.

6.8 Self-study questions

For this chapter, the self-study uses LTspice to simulate (and validate) the example circuits in section 6.4.1 (Q5 and Q6). For each circuit, use a sine wave of 5V 1kHz as input, and measure the output voltages and currents using the probe. These exercises will help you to become more familiar with LTspice, which though not very user friendly is powerful enough to warrant the effort! The LTspice schematic is provided below for reference, and the relevant sub-questions listed.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.250.203