Modeling an electric guitar with LTSpice
Dec 15, 2016 23:29:49 GMT -5
ssstonelover, pasqualino, and 3 more like this
Post by antigua on Dec 15, 2016 23:29:49 GMT -5
Here in the future, electrical circuits can be simulated with software before anyone ever has to worry about the practical matter of how they will be made. As electric guitars are literally electrical circuits, they too can be simulated with software.
Guitarists spend a lot of time experimenting with different pot and capacitor values, and even spend a lot of time and money trying out various guitar pickups. To a very large extent, a lot of time and money can be saved by modelling these circuit modifications through software. The trick is just knowing where to start, and that's the purpose of this post.
First of all, what software to use? Software circuit simulators are called "EDA's". My EDA of choice is LTSpice, which can be downloaded here. It's free and has existed for decades. It's user interface will take you all the way back to Windows 95.
This forum's own JohnH has created a dynamic spreadsheet called GuitarFreak that offers this same sort of modelling in a convenient, interactive way. The major difference is that his dynamic spread sheet already has the models built, you just plug in the values and choose options, whereas this walk through will have you making a model from scratch, using free EDA software.
Pickup Theory
So where do we start? It's all begins with the guitar pickup. For all the magic that supposedly goes into a guitar pickup, the truth is that they are cold, unfeeling "low pass filters with resonance". It's the first and most essentially electrical component in an electric guitar, so the first thing to do is model a pickup.
Helmuth Lemme published a useful representation of a guitar pickup, it can be seen here:
This representation proves to work well for modeling single coil pickups with AlNiCo rods, though for humbuckers and other pickups with steel parts, the model has to be expanded slightly, but that will be detailed later.
To quickly explain what these things represent to the pickup:
The AC source is the moving guitar string. Through Faraday' law of induction, the magnetized string creates an alternating current in the pickup coil.
The "L", or the inductor, is the inductance that comes from the pickup's coil. The pickup is primarily an inductor, and the several henries of inductance that most pickups produce is considered a high value of inductance.
The "C" is the capacitance that occurs due to the close proximity of the wire in the coil. This unwanted capacitance is a phenomena that inflicts nearly all electrical components to one degree or another. When there is more space between the wire, this unwanted capacitance is reduced. Thicker insulation coats on the wire, or a more scattered coil, will create such space, and therefore reduce the capacitance. In reality, it's like there is an infinite number of little capacitors along the length of the coil's wire, but it so happens that we can define it theoretically as a single parallel capacitor.
The "R" is series resistance, defined by the conductivity and the gauge of the copper wire. If the wire were silver, the resistance would be lower. If the wire is thicker, the resistance will be lower.
Getting started
- Download and install LTSpice
- Open LTSpice
- Click File > New Schematic
This next step is an optional, quality of life issue. This is what LTSpice looks like with it's default colors.
I find this hard on the eyes. To improve the color scheme...
- Click Tools > Color Preferences
- Select "Background"
- Move the Red/Green/Blue sliders all the way right to make the background white, or whatever you like.
- Click OK
Then to make the wires and plot lines bold...
- Click Tools > Control Panel > "Drafting Options" tab
- Check "Draft with thick lines"
- Click OK
It should look something like this:
Creating a Pickup
The first thing to do is create the AC source, the (~) to the left.
Note that "undo" is the "F9" key.
- Click Edit > Component
- Select "Voltage" from the menu
- Click "OK"
- Place the "voltage" somewhere to the left:
- Right-click on the new "voltage" component
- Click "Advanced"
- Set "AC Amplitude" to "0.2"
This AC source essentially represents a moving guitar string. Next, the coil must be represented with an inductor, a capacitor and a resistor.
- Click Edit > "Draw wire"
- Draw a wire connecting to the ends of the AC source like this, and one wire in parallel to the AC source, like this:
Note: use "Edit > Move" to rearrange elements, and the magnifying glass icons to zoom in or out.
- Click Edit > Inductor, then click ctrl+r to rotate the inductor horizontally.
- Place the inductor along the top wire as seen below.
- Click Edit > Resistor, then click ctrl+r to rotate the inductor horizontally.
- Place the resistor along the top wire as seen below.
- Click Edit > Capacitor
- Place the capacitor on the parallel wire.
The final requirement is to specify a "ground".
- Click Edit > "Place GND"
- Put the component at the far right end of the lower wire.
The next step is to give these components values that are realistic to a guitar pickup. I'll state values that are typical of a Stratocaster pickup.
- Right-click the inductor
- Enter "2.2" in the Inductance(H) input, click"OK" (2.2 henries)
- Right click the resistor
- Enter "5.8k" in the "Resistance" input, click "OK" (5.8 kilohms)
- Right click the capacitor
- Enter "120p" in the "Capacitance" input, click "OK" (120p = 120 picofarads)
All the values are now set:
We now have a model of a Strat type pickup, an RLC (resistance inductance capacitance) low pass filter, that matches the circuit diagram provided by Helmuth Lemme.
In order to simulate this circuit, we need one more thing, a "input impedance", representing the guitar amplifier, or test equipment, and which serves as a "point of view" when evaluating the output voltage by frequency.
- Click Edit > Draw wire, and draw a wire parallel to the capacitor and AC source, far right, as seen below
- Click Edit > Resistor, place the resistor on the new wire
- Right click the new resistor, enter "1000k" int the Resistance input
Here is where we're at:
With an "input impedance" in place, we can now simulate the frequency response of the pickup (RLC circuit).
- Click "Simulate" > "Edit Simulation Cmd"
- Select the "AC Sweep" Tab
- Enter "100" in the "Number of points per octave"
- Enter "1" in the "Start Frequency" input
- Enter "20000" in the "Stop Frequency" input
- Click "OK"
- Place the text box anywhere in the schematic, here I have it at the bottom:
The text ".ac oct 100 1 20000" is an LTSpice directive, which tells LTSpice what sort of test conditions we want to put the circuit through. We want to test most of the audible range, from 1Hz to 15,000Hz, in 100Hz increments.
- Click Simulate > Run
When you first run the simulation, you will see an empty black window appear, and it will look something like this.
- Resize the windows to be taller and/or wider
- Click Window > Tile Horizontally
- Click on the "1000k resistor", this will cause the upper window to show a voltage-by-frequency plot from this location within the circuit
At this point, a plot should appear:
The black plot is now showing two things:
1) a solid green line, showing the voltage seen at the "input" over a range of frequencies
2) a dashed green line, showing the phase of the voltage and the current
For tonal analysis, only the solid green "amplitude" line is needed. To get rid of the phase plot, click on the dB scale to the right of the plot, a popup window will appear, click the button "Don't plot phase", and the dashed green line will disappear:
This shows us something interesting in it's own right, as this represents the EQ profile of a guitar pickup with 2.2 henries inductance, 5.8k resistance and 120 picofarads capacitance, which is very close to the electrical values of the Fender 57/62.
This curve arises from is the fact that, below a particular frequency, the inductance wins out over the capacitance, and then at that particular frequency, the capacitance and inductance interact with each other, or "resonate", and create a greater impedance than an ideal inductor would achieve by itself. Then, above that frequency, the parasitic capacitance takes over, and the inductor is no longer able to provide an inductance, so the impedance, and therefore voltage, drop off thereafter. Check out this web page regarding low pass filters with resonance for more insight into what makes this particular response curve interesting, and defining of "electric guitar tone". An electric guitar's tone is characterized by the fact that it's harmonics are boosted slightly at that resonant frequency, and then almost completely chopped off above that point, as it falls quickly out of audible range. This is why "50's guitar technology" persists to this day, because that particular technology inadvertently gave rise to a tonal aesthetic which everyone has come to know and love.
If you place the cursor over the peak, you can see that the resonant peak calculates out to 9.6kHz. A fun thing about this is that you can now change the inductance and capacitance values, and get a feel for how much the resonant peak moves with a pickup has 3 henries of inductance, or twice as much capacitance, etc.
Modelling a Guitar Rig
We're not done yet though. You never hear a guitar pickup with a frequency curve like this for two big reasons: 1) the volume and tone pot add parallel resistance in relation to the pickup, about 125 kilohms total (two 250k ohm pots in parallel), and 2) the guitar cable adds parallel capacitance, which might land around 500 picofarads, though this varies widely from one guitar cable to the next.
In order to simulate a real rig, we have to add fake pots and a guitar cable.
- Return focus to the circuit
- Zoom out to make more room
- Click Edit > Draw Wire and extend the lead wire out to the right
- Click Edit > Move, draw a box around the "ground" symbol and move it to the end of the wire:
- Click Edit > Move, draw a box around the wire and 1000k resistor, and move both simultaneously to the far right:
You now have space for more parallel components in between the "pickup" and the "guitar amp"
- Click Edit > Draw Wire, draw three evenly spaced parallel wires in between the "pickup" and the "guitar amp"
Next, we add representative components
- Click Edit > Resistor, and place resistors on the first two new wires.
- Right click the new resistors, give them values of "250k" each (these represent 250K ohm volume and tone potentiometers)
- Click Edit > Capacitor, and place one capacitor on the third new wire.
- Right click the capacitor, give it a value of "500p" (this represents a typical guitar cable)
At this point, there are enough components that they can become confused with one another. The names "L1", "R1" etc. can be renamed by right clicking on the name, and entering a new name. The names have to be alphanumeric, which includes the underscore, or "_". Convention is to use an underscore in place of spaces, which are not allowed.
Here are names I chose for the components:
With LTSpice you can also add generic labels wherever they might be helpful, by clicking Edit > Text.
I've added some labels:
Now when we run this simulation, it should return a plot that more realistically represents what we hear in real life.
Repeating the simulation steps above produces this plot:
Placing the cursor over the peak reveals that the resonant peak is 3.95kHz, and that the resonant peak rises about 5dB ahead of the roll off. This is a realistic value, a Fender 57/62 pickup chops off everything right around 4kHz, when you have them wired into a typical Strat with 250K ohm pots, using a typical guitar cable.
If you want to model a Les Paul, you can actually model two coils (and eddy current losses) for a highly accurate model, but if you want something that is useful without all the hassle, you can simply assign typical PAF values to the single coil pickup model. That means 4 to 5 henries of inductance, 7.5k to 8.5k DC resistance, and about the same 120pF capacitance (note that the capacitance is less critical), and then by changing the tone and volume pot values to 500k each. This will give you reasonably accurate resonant peaks, though the Q factor (how tall the peak is) will be higher than in reality due to the fact that the steel parts, and the nickel silver cover on a typical PAF causes eddy currents, which reduce the height of the Q factor. Where as it's seen above that the Strat pickup rises about 5dB at the resonance, a PAF pickup will only rise above 1dB to 2dB covered, and 2dB to 3dB with the cover removed. Those eddy current losses can be modeled as well, using an eddy current model that I will detail in a later post (it involves an inductor and a resistor in series, parallel to the pickup).
Real-life results compared to modeling
There is an important difference to be aware of between modeling and real-life results. In this modeling, the AC voltage is a consistent amplitude throughout the sweep of tested frequencies, but since a guitar string "induces" current through magnetic induction, and inductors cause impedance, and impedance increasingly "impedes" as frequency rises, there is a +6dBV per octave impedance slope in real life, that instead looks perfectly horizontal in these fixed-amplitude simulations. This means the voltage is not flat as it appear in the model, but actually slopes upwards with frequency.
The oscilloscope generated graph below shows both types of plot; the "raw" gray plot which starts very low, and slopes towards the resonance demonstrates the +6dB/octave transfer of a guitar pickup, while the "integrated" red plot line has been compensated (using a device designed by Ken Willmott) with a -6dB per octave filter in order to flatten it out. This "flat" plot is how the LTSpice models will portray the circuit. In real life, that +6dB slope exists, and it has the effect of greatly decreasing the bass response, and increasing treble response, relative to, say, a piezo pickup, which has a flat response by nature.
It is actually worthwhile to consider the transfer characteristic of pickups with that +6dB/octave slope removed, as it is with the red line, and as it is in the LTSpice model, because it allows us to see the equalization of a pickup in isolation. Every electric guitar pickup will exhibit this +6dB/octave slope, and since it is not unique to a given pickup, the slope only serves to obfuscate what makes one pickup, or wiring scheme, different from the next. In other words, by extracting the +6dB slope, we can more easily see what makes a pickup different from another. It is also easier to identify things like eddy currents, because the losses will contrast against a horizontal plane, rather than a sloped angle.
It would be nice if LTSpice allowed for a voltage that increased or decreased with test frequency, so that we could model both types of plots, integrated and non-integrated, but LTSpice does not support it.
As far as modeling accuracy goes, just as a matter of demonstration, the plot below was made using an actual Fender 57/62 pickup set. The higher "unloaded" peaks correspond to the first model, where the guitar cable, tone and volume pot was left out, and the lower "loaded" plots correspond to the modelling that did include those things. There are three overlapping plot lines for all three pickups in the set. The values shows in the plot below vary slightly from the modeled values, as the modeled values were a little different from the actual values, but JohnH has shown on a number of occasions that model used here curve matches actual measurements to an extremely high degree, especially when the eddy current damping is added in, which will be detailed in the next post.
Here is an example where JohnH overlayed his calculated curves modeled through GuitarFreak with the actual measured bode plot:
Based on the extent to which these curves overlap, you can get a sense of how well the modeling approximates a pickup's actual electrical performance. They say that humans can only discern volume differences greater than 1dB in amplitude. The vertical scale is 1dB per division, and you can see that the deviation is hardly a fraction of a decibel, so there is good cause to have faith in pickup modeling, as an alternative to doing things the hard way, with a soldering iron, and a junk box of assorted components and values.
Dynamically altering component values...
Once you have created a model of a pickup, or an electric guitar, a powerful capability you now have is to compare multiple component values, and see the results side by side.
For example, suppose you want to see how much the resonant peak increases in amplitude when you change the 250k tone and volume pot to 300k, 500k or 1 meg. The trick is to change the values of the components whose values will change in a "variable", meaning the value will become several different values during the simulation. You would then use the LTSpice "step" command to specify those different values: 250k, 300k, 500k and 1 meg.
- Right click on the value of the tone and volume resistors, change the values to {POT_VAL} in both resistors.
- Click Edit > SPICE Directive, and enter this text:
.step param POT_VAL list 250K 300K 500K 1meg
- Click "OK", and place the text somewhere
As you can see, "POT_VAL" is the name of the variable, and the SPICE directive will cause the simulation to "step" through these values.
- Click Simulate > "Run"
- Click on the 1000k "imp" resistor at the far right side.
- Click on the "phase" scale on the right side of the plot and click "Don't plot phase"
You now see several plots, each with different colors. The bright green trace represents the first value, 250k, and it has the lowest peak. The highest peak corresponds to the 1 meg value, and so this is visual and mathematical proof that using 1meg pots will make a guitar brighter than 250k pots.
If you click Tools > Color Preferences, you can view and edit the trace colors:
Dynamically altering multiples component values...
Often times you want to edit two or more parameters at once.
Suppose you want to simulate how well a treble bleed capacitor value will retain treble as you turn down the volume knob. The problem is, a potentiometer is like two resistor value changing in tandem; the portion to the left of the wiper, and the portion to the right (voltage divider setup). The step command as shown above only provided a single value, but we need two values in order to model the two sides of the volume pot at different volume settings.
The solution is an LTSpice "list" and it's "table" feature. Suppose you name your resistor variables "POT_UPPER" and "POT_LOWER" to represent the two halves of the potentiometer, and you want to plot six different points along the volume knob turn, with a different division of resistance at each point, the command would look like this:
.step param COUNT list 1 2 3 4 5 6
.param POT_UPPER table( COUNT, 1,1, 2,50k, 3,100k, 4,150k, 5,200k, 6,240k )
.param POT_LOWER table( COUNT, 1,250K, 2,200k, 3,150k, 4,100k, 5,50k, 6,10k )
The first line says that you want to step through six values, using a variable called "COUNT".
The second line says you want to create a table that maps all six steps of COUNT to specific values. These values will represent various resistances on one side of the pot, and assign those values to "POT_UPPER"
The third line does the same thing as line two, but this time the values are inverted, in order to represent the other side of the pot, and those values are assigned to "POT_LOWER".
Note that zero can't be used as a resistor value in SPICE, so "1 ohm" is used as a stand-in value.
- Click Edit > Resistor, ctrl+r to rotate it flat, and place it beside the "vol_pot" resistor.
- Right click the resistor, name it "vol_pot_up" and set it's value to {POT_UPPER}
- Rename the existing "vol_pot" to "vol_pot_down", and set its value to {POT_LOWER}
It should look like about this:
- Click Edit > SPICE Directive, enter the list and table directives above, click OK and place it somwhere.
- Click Simulate > "Run"
- Click on the 1000k resistor at the far right side.
- Click on the "phase" scale on the right side of the plot and click "Don't plot phase"
The result should look like this:
You can see that the step and tables directive is below the circuit, the volume pot is represented by two resistors, and the plot shows how the frequency varies as the voltage is divided between the pickup and ground. The green line is the first step, where most of the voltage from the pickup is sent to the amp, this is "10" on the volume dial. You can see a bump at the resonance, but notice that the bump disappears in all but the lowest plot line, which correlates with the heard experience of the volume pot diminishing the treble response of the pickup.
So let's add a treble bleed capacitor and see what happens..
Click Edit > Draw Wire, and draw a wire up and over the "vol_pot_up" as shown in the circuit below.
Click Edit > Capacitor, ctrl+r to rotate the capacitor, and place it on the new wire
Right-click the capacitor and name it "treble_bleed" and give it a value of 500p (500 picofarads)
Click Simulate > Run, and click on the far-right 1000k resistor.
The result should look like this:
Notice now that not only is there a high peak at the resonance for all of the different plots lines, but some of them are even higher than the green peak "at 10 on the dial". This demonstrates visually and mathematically what a treble bleed is doing in order to retain treble throughout the sweep of the dial. The fact that the peaks vary in size is a testament to the fact that treble bleeds can be hard to perfect. Different capacitor values and different combinations of capacitors and resistors in series and parallel will yield difference curves. In general, you would want values that roughly yield the same shape of peak for every plot line. Notice how, with this 500p treble bleed, just before you hit "zero" on the volume, there is a lot of treble coming through, so this cap value might cause the lower portion of the sweep to sound too bright.
If you are able to guess within reasonable certainty the electrical values on your pickups, you can use this dynamic modelling to preview the dynamic behavior of different treble bleed values, or tone and vol pot values, or different tone capacitor values. Even if you don't know the exact pickup values, you can assume 2.5 henries for a Strat pickup, 5 henries for a PAF type humbucker, 100p capacitance for each, and the resistance is usually easy to determine, and from those general values, you can figure out what values or wiring scheme is right for you.
Modeling a humbucker wired in series...
To model a humbucker in series, all you have to do duplicate the "pickup" portion of the circuit, attack them together with "wire", and connect the ends to the rest of the circuit. Here is what this looks like:
This resulting plot shows a resonant peak of 3kHz, which is realistic for a typical PAF neck humbucker.
The step taken to get here from a simple single coils schematic were
- Click Edit > Move and grab everything left of "vol pot", and drag it upwards.
- Click Edit > Duplicate, draw a box around the pickup, and move the mouse down below the pickup, and click again to place a duplicate copy of the pickup below the first pickup.
- Click Edit > Draw wire, and connect the two pickups/coil to each other in series, and the other end of each to the other half of the circuit, as shown.
The two pickups now represent the screw and the slug coil of a humbucker, so click to rename all the components "screw" and "slug" as seen in the screen shot.
The resistance values should be reduced to 3.5k to 4.5k, or half of whatever actual humbucker's resistance comes out to. Inductor values of 2.2 henries are still realistic for a PAF type coil, because the steel slugs and screws give them a higher inductance for a smaller coil. The capacitance should be about half for each coil, so I set that to 60p for each. I also set the vol and tone pots to 500k to mimick a Less Paul wiring scheme. Note that no tone cap is shown in the diagram since it has almost no effect where there is such a high resistance in series with it.
This diagram is very useful for previewing the effects of coil splitting, and trying out exotic splitting schemes, such as splitting with a capacitor:
In the diagram above, you can see that I've added a 4 nanofarad capacitor called "split_cap", with one end between the two coils, and the other end to ground, and the result is an interesting "mid scoop" or "band stop" at 2.3kHz, which makes for an interesting new tone. Changing the cap value moves the band stop, and this modelling is very helpful in determining which capacitor values will have which effect for a pickup of given values.
In conclusion...
Pretty much any crazy wiring scheme can be evaluated with LTSpice before you commit to the time and cost of actually rigging in real life. The draw back here of course is that you can't hear a visual frequency plot, but over time you will come to relate what you see to what you have heard, and know what you are hearing by sight, and vice versa.
You can also vastly improve the accuracy of the modelling if you are able to determine the exact electrical values, such as the resistance and inductance of the pickup, the capacitance of the guitar cable, and the input impedance of your guitar amp. The capacitance of the pickup can be determined through various means, but more often than not, the guitar cable's capacitance will be so high as to overpower the capacitance of the pickup. In general, Stratocaster and Tele bridge pickups have capacitance values between 90pF and 140pF, while Tele neck pickups have capacitances closer to 200pF.
Guitarists spend a lot of time experimenting with different pot and capacitor values, and even spend a lot of time and money trying out various guitar pickups. To a very large extent, a lot of time and money can be saved by modelling these circuit modifications through software. The trick is just knowing where to start, and that's the purpose of this post.
First of all, what software to use? Software circuit simulators are called "EDA's". My EDA of choice is LTSpice, which can be downloaded here. It's free and has existed for decades. It's user interface will take you all the way back to Windows 95.
This forum's own JohnH has created a dynamic spreadsheet called GuitarFreak that offers this same sort of modelling in a convenient, interactive way. The major difference is that his dynamic spread sheet already has the models built, you just plug in the values and choose options, whereas this walk through will have you making a model from scratch, using free EDA software.
Pickup Theory
So where do we start? It's all begins with the guitar pickup. For all the magic that supposedly goes into a guitar pickup, the truth is that they are cold, unfeeling "low pass filters with resonance". It's the first and most essentially electrical component in an electric guitar, so the first thing to do is model a pickup.
Helmuth Lemme published a useful representation of a guitar pickup, it can be seen here:
This representation proves to work well for modeling single coil pickups with AlNiCo rods, though for humbuckers and other pickups with steel parts, the model has to be expanded slightly, but that will be detailed later.
To quickly explain what these things represent to the pickup:
The AC source is the moving guitar string. Through Faraday' law of induction, the magnetized string creates an alternating current in the pickup coil.
The "L", or the inductor, is the inductance that comes from the pickup's coil. The pickup is primarily an inductor, and the several henries of inductance that most pickups produce is considered a high value of inductance.
The "C" is the capacitance that occurs due to the close proximity of the wire in the coil. This unwanted capacitance is a phenomena that inflicts nearly all electrical components to one degree or another. When there is more space between the wire, this unwanted capacitance is reduced. Thicker insulation coats on the wire, or a more scattered coil, will create such space, and therefore reduce the capacitance. In reality, it's like there is an infinite number of little capacitors along the length of the coil's wire, but it so happens that we can define it theoretically as a single parallel capacitor.
The "R" is series resistance, defined by the conductivity and the gauge of the copper wire. If the wire were silver, the resistance would be lower. If the wire is thicker, the resistance will be lower.
Getting started
- Download and install LTSpice
- Open LTSpice
- Click File > New Schematic
This next step is an optional, quality of life issue. This is what LTSpice looks like with it's default colors.
I find this hard on the eyes. To improve the color scheme...
- Click Tools > Color Preferences
- Select "Background"
- Move the Red/Green/Blue sliders all the way right to make the background white, or whatever you like.
- Click OK
Then to make the wires and plot lines bold...
- Click Tools > Control Panel > "Drafting Options" tab
- Check "Draft with thick lines"
- Click OK
It should look something like this:
Creating a Pickup
The first thing to do is create the AC source, the (~) to the left.
Note that "undo" is the "F9" key.
- Click Edit > Component
- Select "Voltage" from the menu
- Click "OK"
- Place the "voltage" somewhere to the left:
- Right-click on the new "voltage" component
- Click "Advanced"
- Set "AC Amplitude" to "0.2"
This AC source essentially represents a moving guitar string. Next, the coil must be represented with an inductor, a capacitor and a resistor.
- Click Edit > "Draw wire"
- Draw a wire connecting to the ends of the AC source like this, and one wire in parallel to the AC source, like this:
Note: use "Edit > Move" to rearrange elements, and the magnifying glass icons to zoom in or out.
- Click Edit > Inductor, then click ctrl+r to rotate the inductor horizontally.
- Place the inductor along the top wire as seen below.
- Click Edit > Resistor, then click ctrl+r to rotate the inductor horizontally.
- Place the resistor along the top wire as seen below.
- Click Edit > Capacitor
- Place the capacitor on the parallel wire.
The final requirement is to specify a "ground".
- Click Edit > "Place GND"
- Put the component at the far right end of the lower wire.
The next step is to give these components values that are realistic to a guitar pickup. I'll state values that are typical of a Stratocaster pickup.
- Right-click the inductor
- Enter "2.2" in the Inductance(H) input, click"OK" (2.2 henries)
- Right click the resistor
- Enter "5.8k" in the "Resistance" input, click "OK" (5.8 kilohms)
- Right click the capacitor
- Enter "120p" in the "Capacitance" input, click "OK" (120p = 120 picofarads)
All the values are now set:
We now have a model of a Strat type pickup, an RLC (resistance inductance capacitance) low pass filter, that matches the circuit diagram provided by Helmuth Lemme.
In order to simulate this circuit, we need one more thing, a "input impedance", representing the guitar amplifier, or test equipment, and which serves as a "point of view" when evaluating the output voltage by frequency.
- Click Edit > Draw wire, and draw a wire parallel to the capacitor and AC source, far right, as seen below
- Click Edit > Resistor, place the resistor on the new wire
- Right click the new resistor, enter "1000k" int the Resistance input
Here is where we're at:
With an "input impedance" in place, we can now simulate the frequency response of the pickup (RLC circuit).
- Click "Simulate" > "Edit Simulation Cmd"
- Select the "AC Sweep" Tab
- Enter "100" in the "Number of points per octave"
- Enter "1" in the "Start Frequency" input
- Enter "20000" in the "Stop Frequency" input
- Click "OK"
- Place the text box anywhere in the schematic, here I have it at the bottom:
The text ".ac oct 100 1 20000" is an LTSpice directive, which tells LTSpice what sort of test conditions we want to put the circuit through. We want to test most of the audible range, from 1Hz to 15,000Hz, in 100Hz increments.
- Click Simulate > Run
When you first run the simulation, you will see an empty black window appear, and it will look something like this.
- Resize the windows to be taller and/or wider
- Click Window > Tile Horizontally
- Click on the "1000k resistor", this will cause the upper window to show a voltage-by-frequency plot from this location within the circuit
At this point, a plot should appear:
The black plot is now showing two things:
1) a solid green line, showing the voltage seen at the "input" over a range of frequencies
2) a dashed green line, showing the phase of the voltage and the current
For tonal analysis, only the solid green "amplitude" line is needed. To get rid of the phase plot, click on the dB scale to the right of the plot, a popup window will appear, click the button "Don't plot phase", and the dashed green line will disappear:
This shows us something interesting in it's own right, as this represents the EQ profile of a guitar pickup with 2.2 henries inductance, 5.8k resistance and 120 picofarads capacitance, which is very close to the electrical values of the Fender 57/62.
This curve arises from is the fact that, below a particular frequency, the inductance wins out over the capacitance, and then at that particular frequency, the capacitance and inductance interact with each other, or "resonate", and create a greater impedance than an ideal inductor would achieve by itself. Then, above that frequency, the parasitic capacitance takes over, and the inductor is no longer able to provide an inductance, so the impedance, and therefore voltage, drop off thereafter. Check out this web page regarding low pass filters with resonance for more insight into what makes this particular response curve interesting, and defining of "electric guitar tone". An electric guitar's tone is characterized by the fact that it's harmonics are boosted slightly at that resonant frequency, and then almost completely chopped off above that point, as it falls quickly out of audible range. This is why "50's guitar technology" persists to this day, because that particular technology inadvertently gave rise to a tonal aesthetic which everyone has come to know and love.
If you place the cursor over the peak, you can see that the resonant peak calculates out to 9.6kHz. A fun thing about this is that you can now change the inductance and capacitance values, and get a feel for how much the resonant peak moves with a pickup has 3 henries of inductance, or twice as much capacitance, etc.
Modelling a Guitar Rig
We're not done yet though. You never hear a guitar pickup with a frequency curve like this for two big reasons: 1) the volume and tone pot add parallel resistance in relation to the pickup, about 125 kilohms total (two 250k ohm pots in parallel), and 2) the guitar cable adds parallel capacitance, which might land around 500 picofarads, though this varies widely from one guitar cable to the next.
In order to simulate a real rig, we have to add fake pots and a guitar cable.
- Return focus to the circuit
- Zoom out to make more room
- Click Edit > Draw Wire and extend the lead wire out to the right
- Click Edit > Move, draw a box around the "ground" symbol and move it to the end of the wire:
- Click Edit > Move, draw a box around the wire and 1000k resistor, and move both simultaneously to the far right:
You now have space for more parallel components in between the "pickup" and the "guitar amp"
- Click Edit > Draw Wire, draw three evenly spaced parallel wires in between the "pickup" and the "guitar amp"
Next, we add representative components
- Click Edit > Resistor, and place resistors on the first two new wires.
- Right click the new resistors, give them values of "250k" each (these represent 250K ohm volume and tone potentiometers)
- Click Edit > Capacitor, and place one capacitor on the third new wire.
- Right click the capacitor, give it a value of "500p" (this represents a typical guitar cable)
At this point, there are enough components that they can become confused with one another. The names "L1", "R1" etc. can be renamed by right clicking on the name, and entering a new name. The names have to be alphanumeric, which includes the underscore, or "_". Convention is to use an underscore in place of spaces, which are not allowed.
Here are names I chose for the components:
With LTSpice you can also add generic labels wherever they might be helpful, by clicking Edit > Text.
I've added some labels:
Now when we run this simulation, it should return a plot that more realistically represents what we hear in real life.
Repeating the simulation steps above produces this plot:
Placing the cursor over the peak reveals that the resonant peak is 3.95kHz, and that the resonant peak rises about 5dB ahead of the roll off. This is a realistic value, a Fender 57/62 pickup chops off everything right around 4kHz, when you have them wired into a typical Strat with 250K ohm pots, using a typical guitar cable.
If you want to model a Les Paul, you can actually model two coils (and eddy current losses) for a highly accurate model, but if you want something that is useful without all the hassle, you can simply assign typical PAF values to the single coil pickup model. That means 4 to 5 henries of inductance, 7.5k to 8.5k DC resistance, and about the same 120pF capacitance (note that the capacitance is less critical), and then by changing the tone and volume pot values to 500k each. This will give you reasonably accurate resonant peaks, though the Q factor (how tall the peak is) will be higher than in reality due to the fact that the steel parts, and the nickel silver cover on a typical PAF causes eddy currents, which reduce the height of the Q factor. Where as it's seen above that the Strat pickup rises about 5dB at the resonance, a PAF pickup will only rise above 1dB to 2dB covered, and 2dB to 3dB with the cover removed. Those eddy current losses can be modeled as well, using an eddy current model that I will detail in a later post (it involves an inductor and a resistor in series, parallel to the pickup).
Real-life results compared to modeling
There is an important difference to be aware of between modeling and real-life results. In this modeling, the AC voltage is a consistent amplitude throughout the sweep of tested frequencies, but since a guitar string "induces" current through magnetic induction, and inductors cause impedance, and impedance increasingly "impedes" as frequency rises, there is a +6dBV per octave impedance slope in real life, that instead looks perfectly horizontal in these fixed-amplitude simulations. This means the voltage is not flat as it appear in the model, but actually slopes upwards with frequency.
The oscilloscope generated graph below shows both types of plot; the "raw" gray plot which starts very low, and slopes towards the resonance demonstrates the +6dB/octave transfer of a guitar pickup, while the "integrated" red plot line has been compensated (using a device designed by Ken Willmott) with a -6dB per octave filter in order to flatten it out. This "flat" plot is how the LTSpice models will portray the circuit. In real life, that +6dB slope exists, and it has the effect of greatly decreasing the bass response, and increasing treble response, relative to, say, a piezo pickup, which has a flat response by nature.
It is actually worthwhile to consider the transfer characteristic of pickups with that +6dB/octave slope removed, as it is with the red line, and as it is in the LTSpice model, because it allows us to see the equalization of a pickup in isolation. Every electric guitar pickup will exhibit this +6dB/octave slope, and since it is not unique to a given pickup, the slope only serves to obfuscate what makes one pickup, or wiring scheme, different from the next. In other words, by extracting the +6dB slope, we can more easily see what makes a pickup different from another. It is also easier to identify things like eddy currents, because the losses will contrast against a horizontal plane, rather than a sloped angle.
It would be nice if LTSpice allowed for a voltage that increased or decreased with test frequency, so that we could model both types of plots, integrated and non-integrated, but LTSpice does not support it.
As far as modeling accuracy goes, just as a matter of demonstration, the plot below was made using an actual Fender 57/62 pickup set. The higher "unloaded" peaks correspond to the first model, where the guitar cable, tone and volume pot was left out, and the lower "loaded" plots correspond to the modelling that did include those things. There are three overlapping plot lines for all three pickups in the set. The values shows in the plot below vary slightly from the modeled values, as the modeled values were a little different from the actual values, but JohnH has shown on a number of occasions that model used here curve matches actual measurements to an extremely high degree, especially when the eddy current damping is added in, which will be detailed in the next post.
Here is an example where JohnH overlayed his calculated curves modeled through GuitarFreak with the actual measured bode plot:
Based on the extent to which these curves overlap, you can get a sense of how well the modeling approximates a pickup's actual electrical performance. They say that humans can only discern volume differences greater than 1dB in amplitude. The vertical scale is 1dB per division, and you can see that the deviation is hardly a fraction of a decibel, so there is good cause to have faith in pickup modeling, as an alternative to doing things the hard way, with a soldering iron, and a junk box of assorted components and values.
Dynamically altering component values...
Once you have created a model of a pickup, or an electric guitar, a powerful capability you now have is to compare multiple component values, and see the results side by side.
For example, suppose you want to see how much the resonant peak increases in amplitude when you change the 250k tone and volume pot to 300k, 500k or 1 meg. The trick is to change the values of the components whose values will change in a "variable", meaning the value will become several different values during the simulation. You would then use the LTSpice "step" command to specify those different values: 250k, 300k, 500k and 1 meg.
- Right click on the value of the tone and volume resistors, change the values to {POT_VAL} in both resistors.
- Click Edit > SPICE Directive, and enter this text:
.step param POT_VAL list 250K 300K 500K 1meg
- Click "OK", and place the text somewhere
As you can see, "POT_VAL" is the name of the variable, and the SPICE directive will cause the simulation to "step" through these values.
- Click Simulate > "Run"
- Click on the 1000k "imp" resistor at the far right side.
- Click on the "phase" scale on the right side of the plot and click "Don't plot phase"
You now see several plots, each with different colors. The bright green trace represents the first value, 250k, and it has the lowest peak. The highest peak corresponds to the 1 meg value, and so this is visual and mathematical proof that using 1meg pots will make a guitar brighter than 250k pots.
If you click Tools > Color Preferences, you can view and edit the trace colors:
Dynamically altering multiples component values...
Often times you want to edit two or more parameters at once.
Suppose you want to simulate how well a treble bleed capacitor value will retain treble as you turn down the volume knob. The problem is, a potentiometer is like two resistor value changing in tandem; the portion to the left of the wiper, and the portion to the right (voltage divider setup). The step command as shown above only provided a single value, but we need two values in order to model the two sides of the volume pot at different volume settings.
The solution is an LTSpice "list" and it's "table" feature. Suppose you name your resistor variables "POT_UPPER" and "POT_LOWER" to represent the two halves of the potentiometer, and you want to plot six different points along the volume knob turn, with a different division of resistance at each point, the command would look like this:
.step param COUNT list 1 2 3 4 5 6
.param POT_UPPER table( COUNT, 1,1, 2,50k, 3,100k, 4,150k, 5,200k, 6,240k )
.param POT_LOWER table( COUNT, 1,250K, 2,200k, 3,150k, 4,100k, 5,50k, 6,10k )
The first line says that you want to step through six values, using a variable called "COUNT".
The second line says you want to create a table that maps all six steps of COUNT to specific values. These values will represent various resistances on one side of the pot, and assign those values to "POT_UPPER"
The third line does the same thing as line two, but this time the values are inverted, in order to represent the other side of the pot, and those values are assigned to "POT_LOWER".
Note that zero can't be used as a resistor value in SPICE, so "1 ohm" is used as a stand-in value.
- Click Edit > Resistor, ctrl+r to rotate it flat, and place it beside the "vol_pot" resistor.
- Right click the resistor, name it "vol_pot_up" and set it's value to {POT_UPPER}
- Rename the existing "vol_pot" to "vol_pot_down", and set its value to {POT_LOWER}
It should look like about this:
- Click Edit > SPICE Directive, enter the list and table directives above, click OK and place it somwhere.
- Click Simulate > "Run"
- Click on the 1000k resistor at the far right side.
- Click on the "phase" scale on the right side of the plot and click "Don't plot phase"
The result should look like this:
You can see that the step and tables directive is below the circuit, the volume pot is represented by two resistors, and the plot shows how the frequency varies as the voltage is divided between the pickup and ground. The green line is the first step, where most of the voltage from the pickup is sent to the amp, this is "10" on the volume dial. You can see a bump at the resonance, but notice that the bump disappears in all but the lowest plot line, which correlates with the heard experience of the volume pot diminishing the treble response of the pickup.
So let's add a treble bleed capacitor and see what happens..
Click Edit > Draw Wire, and draw a wire up and over the "vol_pot_up" as shown in the circuit below.
Click Edit > Capacitor, ctrl+r to rotate the capacitor, and place it on the new wire
Right-click the capacitor and name it "treble_bleed" and give it a value of 500p (500 picofarads)
Click Simulate > Run, and click on the far-right 1000k resistor.
The result should look like this:
Notice now that not only is there a high peak at the resonance for all of the different plots lines, but some of them are even higher than the green peak "at 10 on the dial". This demonstrates visually and mathematically what a treble bleed is doing in order to retain treble throughout the sweep of the dial. The fact that the peaks vary in size is a testament to the fact that treble bleeds can be hard to perfect. Different capacitor values and different combinations of capacitors and resistors in series and parallel will yield difference curves. In general, you would want values that roughly yield the same shape of peak for every plot line. Notice how, with this 500p treble bleed, just before you hit "zero" on the volume, there is a lot of treble coming through, so this cap value might cause the lower portion of the sweep to sound too bright.
If you are able to guess within reasonable certainty the electrical values on your pickups, you can use this dynamic modelling to preview the dynamic behavior of different treble bleed values, or tone and vol pot values, or different tone capacitor values. Even if you don't know the exact pickup values, you can assume 2.5 henries for a Strat pickup, 5 henries for a PAF type humbucker, 100p capacitance for each, and the resistance is usually easy to determine, and from those general values, you can figure out what values or wiring scheme is right for you.
Modeling a humbucker wired in series...
To model a humbucker in series, all you have to do duplicate the "pickup" portion of the circuit, attack them together with "wire", and connect the ends to the rest of the circuit. Here is what this looks like:
This resulting plot shows a resonant peak of 3kHz, which is realistic for a typical PAF neck humbucker.
The step taken to get here from a simple single coils schematic were
- Click Edit > Move and grab everything left of "vol pot", and drag it upwards.
- Click Edit > Duplicate, draw a box around the pickup, and move the mouse down below the pickup, and click again to place a duplicate copy of the pickup below the first pickup.
- Click Edit > Draw wire, and connect the two pickups/coil to each other in series, and the other end of each to the other half of the circuit, as shown.
The two pickups now represent the screw and the slug coil of a humbucker, so click to rename all the components "screw" and "slug" as seen in the screen shot.
The resistance values should be reduced to 3.5k to 4.5k, or half of whatever actual humbucker's resistance comes out to. Inductor values of 2.2 henries are still realistic for a PAF type coil, because the steel slugs and screws give them a higher inductance for a smaller coil. The capacitance should be about half for each coil, so I set that to 60p for each. I also set the vol and tone pots to 500k to mimick a Less Paul wiring scheme. Note that no tone cap is shown in the diagram since it has almost no effect where there is such a high resistance in series with it.
This diagram is very useful for previewing the effects of coil splitting, and trying out exotic splitting schemes, such as splitting with a capacitor:
In the diagram above, you can see that I've added a 4 nanofarad capacitor called "split_cap", with one end between the two coils, and the other end to ground, and the result is an interesting "mid scoop" or "band stop" at 2.3kHz, which makes for an interesting new tone. Changing the cap value moves the band stop, and this modelling is very helpful in determining which capacitor values will have which effect for a pickup of given values.
In conclusion...
Pretty much any crazy wiring scheme can be evaluated with LTSpice before you commit to the time and cost of actually rigging in real life. The draw back here of course is that you can't hear a visual frequency plot, but over time you will come to relate what you see to what you have heard, and know what you are hearing by sight, and vice versa.
You can also vastly improve the accuracy of the modelling if you are able to determine the exact electrical values, such as the resistance and inductance of the pickup, the capacitance of the guitar cable, and the input impedance of your guitar amp. The capacitance of the pickup can be determined through various means, but more often than not, the guitar cable's capacitance will be so high as to overpower the capacitance of the pickup. In general, Stratocaster and Tele bridge pickups have capacitance values between 90pF and 140pF, while Tele neck pickups have capacitances closer to 200pF.