In this post we'll start a project and introduce a few tools that should be very helpful along the way.
First I would like to state the pre-requisites for this project, or the things you should probably know in order to get the most out of this discussion. This is difficult to say. I'm not a teacher, and also I can't expect that you would know everything that I needed to figure this project out. Roughly, then, you should know:
- Algebra
- Ohm's Law
- Hopefully a little more circuit theory, ala Kirchoff's Laws
To help illustrate what I'm talking about in this post, I'll be taking advantage of some really nice, free tools. For displaying math, like $$\mu = r_p g_m,$$ I'll be using a script called MathJax, which is an easy to use plug-in of sorts to allow high-quality, cross-browser support for rendering mathematics. I'm pretty sure any questions you ask in the comments can take advantage of this. Just couch your math statements in back-ticks, like this: `y = 2*x^2` . It support several syntaxes for input, including ASCIIMathML, which is pretty close to what you would type with a standard text interface anyway.
For drawing schematics, there a couple of good options that are cross-platform, and both are web-based. There is Upverter and CircuitLab. Both have nice HTML5 (not Flash!) interfaces for drawing schematics, you can share schematics with your friends and hot-link them on forums all you like. I'll probably be using CircuitLab more though, because it has integrated simulation functionality and has easier access to the more common circuit elements.
For more involved simulations I'll be using a version of Spice. There are many of these around, most derived from Berkeley Spice 3f5, developed at the University of California, Berkeley. For those of us working on Macs, there is MacSpice, as well as ng-spice, which is available through MacPorts or Fink. Linux has several versions of Spice available, and Windows users have access to the GUI-oriented LTSpice and TINA from Texas Instruments. However, MacSpice and other command-line versions of Spice are extremely powerful and useful, and have a surprisingly shallow learning curve, especially if you've ever done any programming.
I feel it's important to lay out the programs I'll be using for these posts clearly, because if you like my diagrams or schematics or whatever, you'll be able to use them too. I have been frustrated before trying to figure out how some guy made his graphs or where he got his cool charts.
Okay, now let's talk about a circuit and what we want it to do. Imagine we have a signal source, like an electric guitar. Guitars produce a signal composed of a series of sine-waves. If you play an A, you'll get a sine-wave output with a frequency near 440 Hz, or an integer multiple of 440 Hz, like 880 Hz, for an A one octave up in pitch. The signal would look like this:
For drawing schematics, there a couple of good options that are cross-platform, and both are web-based. There is Upverter and CircuitLab. Both have nice HTML5 (not Flash!) interfaces for drawing schematics, you can share schematics with your friends and hot-link them on forums all you like. I'll probably be using CircuitLab more though, because it has integrated simulation functionality and has easier access to the more common circuit elements.
![]() |
| A beautiful circuit drawn with CircuitLab |
For more involved simulations I'll be using a version of Spice. There are many of these around, most derived from Berkeley Spice 3f5, developed at the University of California, Berkeley. For those of us working on Macs, there is MacSpice, as well as ng-spice, which is available through MacPorts or Fink. Linux has several versions of Spice available, and Windows users have access to the GUI-oriented LTSpice and TINA from Texas Instruments. However, MacSpice and other command-line versions of Spice are extremely powerful and useful, and have a surprisingly shallow learning curve, especially if you've ever done any programming.
I feel it's important to lay out the programs I'll be using for these posts clearly, because if you like my diagrams or schematics or whatever, you'll be able to use them too. I have been frustrated before trying to figure out how some guy made his graphs or where he got his cool charts.
Okay, now let's talk about a circuit and what we want it to do. Imagine we have a signal source, like an electric guitar. Guitars produce a signal composed of a series of sine-waves. If you play an A, you'll get a sine-wave output with a frequency near 440 Hz, or an integer multiple of 440 Hz, like 880 Hz, for an A one octave up in pitch. The signal would look like this:
![]() |
| A 440 Hz sine wave |
What if we wanted to change that signal? We could do lots of things, like increasing the amplitude of the signal, or inverting the signal. Both of those operations could be done pretty easily with a basic amplifying circuit. But let's do something more interesting; let's change the frequency of the signal. How can we do that? Well, if we look at a rectifier circuit, like one might find after the transformer in an AC power supply, we'll get a clue:
![]() |
| A center-tapped rectifier circuit |
![]() |
| Simulation showing input signal and output signal |
Take a look at the blue squiggle. The first peak looks a lot like the `In` signal, but with a smaller amplitude. Then there's a little null area, a flat spot, followed by another peak. But notice, the second peak comes when the `In` signal is having a valley. We've doubled the frequency! But not quite. The out `Out` waveform is not exactly a sine wave. Mathematical analysis would show that the new signal is composed of not just one sine wave, but of in fact a whole slew of sine waves of vary frequency, starting with the primary, or fundamental frequency, of `2*440 Hz = 880 Hz`. So we have succeeded in some respects: we have created a filter that transforms the frequency that is fed into it. Mathematically, we have $$f_{out} = 2f_{in}.$$ For those who haven't dealt with diodes before or need a refresher: the way this circuit works is during the input signal's positive half-cycle, diode `D1` conducts the input signal into the load resistor, while diode `D2` blocks the input signal from passing through it. Therefore the only path for current from the input signal is through `D1`, through the resistor, and then to ground. On the next half-cycle, when the input signal is negative, the diodes reverse roles and allow the input signal to pass through `D2` and into the load resistor. The result is that the `Out` signal is never negative; the diodes "rectify" the flow of current such that it always flows in the same direction.
Also, notice that it takes a while before the `Out` signal leaves the horizontal axis and takes on some positive value. If you draw a vertical line, from the point where the `Out` signal starts to rise, to the curve of the `In` signal, you will see that the input voltage is around `600 mV = 0.6 V`. This is a feature of silicon diodes. They require a minimum voltage between their terminals of around `0.6 V` before they begin to conduct appreciable current. This is called a diode's forward voltage drop. As long as the circuit driving the diode has a potential higher than the diode's forward voltage, or `v_f`, the voltage across the diode will remain fairly constant, close to `0.6 V`.
So, to recap, we have a circuit that doubles the input signal's frequency, but due to the realities of silicon diodes, it produces a distorted output. In the next post, we'll introduce a useful circuit element that will help us overcome some of these limitations.




No comments:
Post a Comment