Saturday, June 25, 2011

Another New Guitar Tone Circuit

After a long hiatus for which I will not beat myself up, I have gotten back to the guitar circuit.  Since my last post, I have gotten married, moved in to a new house, and dealt with several car issues.  So things have been pretty busy, but I have managed in the last couple of days to put some work in on the guitar circuit.  Here's a new simulation for a circuit that I plan to breadboard soon, maybe tonight.  My wife is studying for the BAR exam coming up, so I'm basically left to my own devices to amuse myself.

The New Circuit
The circuit is really not all that groundbreaking.  I realized a long time ago (as documented in this blog) that the pickup's internal resistance played a large part in determining the cutoff frequency for the tone circuit in my guitar.  Since I've been planning an active circuit with the pickups feeding opamp buffers instead of the normal passive circuit, I've had to reconsider what I want the tone circuit to be.

Having done a lot of design, research, and simulation on active circuits, I put one together to test.  Unfortunately, I wasn't all that happy with the results.  I realized that in all my effort to make the cutoff frequency adjustable, I had managed to change the way that the tone circuit modified the sound.  I though that it would be better that way, but it just didn't adjust the same way.  Not that that should have been surprising.  So I decided to try to preserve the original functionality while also adding the ability to adjust the cutoff frequency.

This is the simplest circuit imaginable.  So much so, that I don't really feel bad about not having a diagram.  Also I don't currently have access to Autocad.
  1. Take the original tone circuit, consisting of a tone pot in series with a capacitor and separate it from the rest of the original passive circuit.
  2. Now I'll put in all the opamp buffers, the summing amplifier, the rotary switches, all the fun stuff I've been desigining.  So we replace the rest of the circuit.
  3. Now we need to put the tone control back in the circuit.  But wait, we don't want to load down the pickups at the beginning.  That's one of the things that we tried to accomplish with all this opamp buffering in the first place.  
  4. We can replace the 10Kish pickup equivalent resistance with an actual resistor to bring back the tone circuit, but I still need to be able to adjust the frequency.
  5. To adjust the frequency, replace the pickup equivalent resistance with a series resistor (100 ohm) and a series tone pot (20 Kohm).
So our tone circuit goes in this order: 
  1. Opamp voltage source  
  2. fixed 100 ohm resistor
  3. 20Kohm variable resistor (2 terminals of a pot)
  4. Output voltage tap
  5. 50Kohm variable resistor (2 terminals of a second pot)
  6. 0.22 uF Capacitor
  7. Ground
Why use a 50K tone pot in the original tone pot position you ask?  Well as I discussed in the first Guitar Tone Analysis post, you really only use the first 30K or so of the tone pot in the first place.  At last that's what my simulations say.  We'll have to see how this sounds.  A 50K pot is a lot closer to 30K than 500K, so we should have a lot more control of our tone.  Also, I will use a log pot for reasons mentioned in the same article.

Simulation Results
I decided that the best way to display the results of the simulation would be an animated gif.  We have three variables here:  frequency (x), Rtone(y), and Rtone2(z).  Rtone is the original tone pot.  I kept its name for some continuity in my code.  So what we will see in the gif is a series of images that represent the same thing that I showed in the original post.

I plotted the magnitude of the gain from 0 Hz to 20KHz on a semilogx plot.  Each successive plot represents a different setting on the new tone pot (Rtone2).  Remember that the input of the filter is a series combination of a 100 Ohm resistor and the pot.  100 Ohms is about where the cutoff frequency gets too high to be useful.  In fact, it may still be still too high a cutoff frequency at that point.  I didn't listen to it, I just estimated. 

Note that when we hit about 11KOhms on the new tone pot (Rtone2) the graph should be virtually identical to the original graph.  I've standardized the y scale so that seeing the graphs back to back will make sense.  And without further ado, here's the graph.

Ok, a brief discussion.  All of the graphs look simliar.  This makes sense.  We didn't really change much in the circuit.  But it is obvious that the cutoff frequency does change as we adjust the value of Rtone2.  Also the original behavior of the flattening out of the frequency response by adjusting Rtone is preserved. 

Here is a plot of the cutoff frequency with respect to Rtone2 with Rtone set equal to 0.  So we're basically looking at a single pole filter while adjusting the input resistor. 

I tend to think of this plot as the starting point.  Here are all of the cutoff frequencies that we can achieve with an unaltered low-pass filter.  From there, we can flatten out the attenuation using the other pot.

I really make no claim that this circuit is in any way revolutionary.  Ok maybe not particularly creative either.  But I was interested to see the theory behind how it might work, and it will definitely accomplish the design goals that I wanted.  Whether it will sound good remains to be seen.  However, I believe that it can hardly sound bad, since it should function exactly like the original tone circuit if you just leave the new pot alone.  I'll probably do  this with concentric pots.  I'll have to think about it and maybe swap out some wafers.  For the breadboarding, I'll just use separate pots.

I did pick up some code from the interwebs that allowed me to create the gif file from inside Matlab.  So that's a nice bit of code to have.  The whole source code follows.

% my adjustable tone control simulation % 0.022 uF capacitor Ctone = 0.22e-6; % 500 Kohms Original Tone Pot Rtone = 50e3; % steps on the tone resistor toneres = logspace(0, log10(Rtone)); %toneres = linspace(0, Rtone, 50); %toneres = logspace(1,log10(30e3)); %toneres = linspace(0,30e3,50); % Added series tone pot to take the place of Rpickup Rtone2ser = 100; Rtone2 = 20e3; % steps on the series tone resistor toneres2 = logspace(0,log10(Rtone2)) + Rtone2ser; % steps in frequency freq = logspace(log10(20), log10(20e3), 100); ZCtone = repmat( (-j./(2*pi*Ctone.*freq))' , [1 size(toneres,2) size(toneres2,2)]); Ztone = repmat(toneres,[size(ZCtone,1) 1 size(ZCtone,3)]) + ZCtone; Ztone2 = ones(1,1,size(Ztone,3)); Ztone2(1,1,:) = toneres2; Ztone2 = repmat(Ztone2, [size(Ztone,1) size(Ztone,2), 1]); gain = abs(Ztone ./ (Ztone + Ztone2) ); % fc = 1/ (2pi * Ctone * sqrt( Rtone2^2 + Rtone2*Rtone - Rtone^2) % we set up the matrices so that % x(down) = constant Rtone2 / changing Rtone % y(across) = constant Rtone / changing Rtone2 Rtone_fc = repmat(toneres', [1 size(toneres,2)]); Rtone2_fc = repmat(toneres2, [size(toneres2,2) 1]); fc = 1./(2*pi*Ctone*sqrt(Rtone2_fc.^2 + Rtone2_fc.*Rtone_fc - Rtone_fc.^2)); % create Gain Gif figure(1) filename = 'Gain.gif'; for n = 1:size(gain,3) semilogx(freq,20*log10(gain(:,:,n))); title(sprintf('Rtone2(KOhms) = %.3f ; Rtone(KOhms) = 0 - %.3f', Ztone2(1,1,n)/1000, Rtone/1000)); ylim([-12 0]); xlabel('Frequency (Hz)'); ylabel('Gain (dB)'); drawnow frame = getframe(1); im = frame2im(frame); [imind,cm] = rgb2ind(im,256); if n == 1; imwrite(imind,cm,filename,'gif', 'Loopcount',inf); else imwrite(imind,cm,filename,'gif','WriteMode','append'); end end % plot fc of circuit figure(4); semilogx(toneres2,real(fc(1,:))); xlabel('Rtone2 (Ohms)'); ylabel('Cutoff Frequency (Hz)'); title ('Cutoff Frequency with Rtone = 0');

Thanks for reading,

1 comment:

  1. Hey Bill, You have done some grand work on this tone control. Although you do not have access to AutoCAD there is an alternative called TinyCad. It is a great little schematic drawing program that I use all the time. You can check it out at . Best of all, it is a free!
    Kevin S.