AudioSharp

Music, Programming, and other topics related to the modern Music Engineering Scene.

More Op-Amps

A new week brings a few more op-amp circuits. Let's dive right in.

This is a summing op-amp. It will add together the signals labeled Va, Vb and Vc. Basically, this is an audio mixer! You can change the levels of each signal by changing the value of its resistor. You can think of it as three inverting amplifiers combined into one summing op-amp.

This is the Subtracting/Difference Amp. This handy circuit will subtract the two signals, Va and Vb. This is very handy in converting a balanced signal to an unbalanced signal. Recall our discussion of a subtracting amplifier from last month. If you subtract two signals that are 180 degrees out of phase with each other, you will eliminate any noise that was added to the signal, as well as double the output. Very useful, and very effective.
This last circuit is hardly a circuit at all. The Comparator is essentially an op-amp hooked up into your circuit without anything crazy coming off of it. This will tell you the which signal is the strongest, either the one at the positive terminal or the negative terminal. To do this, it will output the rail voltage, either positive or negative. Look back for a brief discussion on rails.

And that's all there is to it. There are, of course, more complex circuits you can build with op-amps, but I feel like these are the most fundamental ones. Get to know them, as they appear very often in audio hardware schematics.

Next up, we'll discuss features you can add to these circuits and their effects on your output.

The Operational Amplifier

Or Op-Amp, for short. This little device has done wonders for electronics. It's represented by a triangle, with a positive and negative input, and one output:
It might not look like much, but this is a very powerful little device which is at the heart of many audio hardware units. But how's it work exactly? A triangle doesn't tell us much, so let's look at what happens behind the scenes.

An op-amp must be connected to a power source (i.e. +/- 9v). This power source defines the "Rails" of the op-amp. The rails denote the maximum output of the amp. For example, if you connect an op-amp to a 9V battery with rails -4.5 and 4.5v, you can only get 4.5V out of the op-amp before it "rails out." This voltage allows the op-amp to perform a few different functions that I'll outline briefly below.

The Inverting Amplifier:
In this model, the signal is put into the negative terminal, and the positive terminal is connected to ground. This is why it's inverting, because the output gets multiplied by negative one (-1), completely inverting the signal. Notice that the output is connected back in to the input. This is how it amplifies, by feeding a negative feedback loop. The gain of this design is -Rf/Ri, where Rf is the resistor in the feedback path and Ri is the resistor on the input.

Noninverting Amplifier:
In this model, you see the input is connected to the positive terminal, so there is no inversion. You can still see the negative feedback loop, but this time the negative terminal is attached to ground, after a resistor which we called Ri. The gain of this amplifier is 1 + Rf/Ri. This means that the minimum output is 1, which can be undesirable in some cases. But the signal is not inverted, so that's a plus.

There's a few more op-amp circuits I'd like to go over, but too much at once can be pretty overwhelming. We'll leave it there for today and hit up summing amps, difference amps, and the comparator next time.

Schematics: An Introduction

When faced with malfunctioning gear, what's the first thing you should do? No, don't panic. You probably don't even have to take it to the repair shop for most things. Being able to read a schematic diagram is useful in debugging your device.

First, try to isolate the problem. Is it the input, output, or do you have no idea? Are there any strange smells (blown capacitors tend to smell like burnt electronics)? Is your speaker noisy? Try to find out where to start looking, then pull out your circuit diagrams and try to figure out what possibly could have gone wrong.

But wait, every schematic you've ever seen is overly complicated, intimidating, and filled with lots of strange symbols! Don't worry, we already know the symbols for a resistor, capacitor, inductor, transformer, and ground. There's a few more symbols to learn, but we'll go over those later. Now I can't just post a schematic on here and look at it, as I'm not sure what the legal bounds on that sort of thing are, but I can give you a useful guide to interpreting schematics.

  1. Start at the input. I can't stress this enough. Find where it says "input" on the diagram, and trace the path from there. Chances are, the first thing you'll do is go through a gain stage of some sort, usually involving an op-amp (to be covered later) or transformer. Knowing where the flow of signal starts is a good first step to figuring out exactly what's going on.
  2. Pick out parts that you recognize. We went over high and low pass filters, so you should be able to skim through a schematic and circle them, confident in what that one part is doing. You might not understand why they're doing it yet, but we'll get there.
  3. Try to find the spot that you think's broken. If you know the problem is in the input, look towards the beginning. If it's at the speaker/output, look towards the end. If you have no idea, look at anything that has a chance of breaking if you overload it with too much voltage (like capacitors).
Once you see in the schematics the problem area, you can try to take your gear apart and fix it. Now this isn't always easy, so a repair shop might be the best choice. But there's always that level of satisfaction in fixing something yourself and still having it function properly.

Before we can get too in depth with schematics, we must cover the op-amp, and a bunch of different uses for capacitors. The next few posts will cover these topics in depth, and at the end I'll sketch some basic designs for us to look at.

Transformers

Transformers are essentially two inductors placed right next to each other, but not physically connected. In schematics, they look like this:
The black dots at the top represent the top of the transformer. Since both dots are at the top of the diagram, this transformer is non-inverting. What goes in is on the left is in phase with what comes out on the right.

What is all this phase stuff, and what do you mean charge travels across that gap? Well, inductors create a magnetic field around themselves whenever alternating current is pumped through them. Since these inductors are so close, the magnetic field of one touches the other one, inducing a current. The strength of this current depends on the amount of coils on each inductor. If the they both have the same amount of coils, the current is the same on each side. If the left side (input) has more twists than the right, there will be a voltage drop, but an increase in current on the right side (output). Having more twists on the output side creates an increase in voltage, but a drop in current.

Why is this useful? Well, it prevents grounding issues with DC. Remember that DC does not have an effect on inductors, and no magnetic field is produced for DC currents. This means you can prevent ground loops by having your devices physically disconnected. Also, being able to step up or down in voltage is very useful. Transformers are at the heart of many analog audio devices because of their ability to step up the output of an audio signal. You can imagine running a balanced signal into a device, and then converting it to an unbalanced signal by doing the following:
This is called a center-tapped transformer. You feed a balanced signal in on the left, with the center of the left inductor being tapped to ground. The right side has no tap, and thus subtracts the two signals, creating a subtracting amplifier.

There are many more uses for transformers that we won't cover here, but the above is a very common one. We'll go over more uses for transformers in the future when we start to look at the inner workings of some serious audio hardware.

Inductors

Last week we went over a high pass filter using a capacitor. This week, we'll go over two ways to make a low pass filter, one with a capacitor and the other with an inductor.

Let's start with the capacitor since we went over it last week. Take our picture from last time, and flip flop the resistor and capacitor like this:
Let's remember what we know about capacitors. As low frequencies pass through them, they act like open circuits, and as high frequencies pass through them, they act like short circuits. So at low frequencies, it's almost as if the capacitor doesn't exist. Audio flows straight from input to ouput, without losing anything. As your frequency increases, however, more of your signal starts to go to ground through the capacitor. Once your capacitor becomes an open circuit at super high frequencies, all of your signal gets routed straight to ground, and you don't have any output. Seem reasonable enough? Remember, this is all because current flows through the path of least resistance.

Let's start looking at inductors. Basically, an inductor is a coil of wire. Thanks to Faraday's law, inductors induce current when you pass an AC signal through them (audio is AC, because it is not a single frequency, but always changes). We won't do any crazy equations dealing with that part of an inductor, because we're not too concerned about it right now. Right now, the important thing about inductors is their equation for impedance, which is as follows:
ZL = jwL
where ZL is the impedance through the inductor, j is the square root of negative one, w is the frequency of the signal, and L is the inductance of the inductor (measured in Henries). So as the frequency decreases, the less resistance there is and more signal gets through. As the frequency increases, so does the resistance, and less signal gets through.

Now, let's look at how you could make a low pass filter with an inductor:
Basically, we replaced last week's sketch's capacitor with an inductor. At low frequencies, the inductor lets most of the signal through, but at high frequencies it all but stops anything from going through, serving as a low pass filter.

Many really cool things in audio are based off of these two components, and we'll look into those in the posts ahead. Speaker cross-overs, band-pass filters, and many other important devices all use a series of capacitors and inductors. So let's make sure we're at least semi-comfortable with them before moving on.

Followers

Disclaimer

Chemzoar does not intend to provide complete walkthroughs of everything covered on this website. Before undertaking any projects proposed by this website, be sure to do your own research on top of what's listed here. Chemzoar does not take any responsibility for decisions made based on the content of this site.