Bass Boost
Please Log In for full access to the web site.
Note that this link will take you to an external site (https://shimmer.mit.edu) to authenticate, and then you will be redirected back to this page.
In this lab, we're going to apply some of the ideas we've seen over the last few weeks to an authentic signal processing problem, implementing a "bass boost" filter for music. By the end of this lab, we should have a circuit that we can plug music into from an arbitrary source, and hear that same music but with the low frequencies amplified.
We'll bring to bear a lot of what we refreshed ourselves on in the prelab for this week, so if you haven't done that yet, it would be a good idea to do it now (though don't worry too much if you don't have a complete schematic for the system yet, as we'll step through one workable design in this document).
We'll approach this problem piece-by-piece, building up small "modules" to perform various analog computations, and then we'll combine those things together to make our overall circuit.
Our high-level outline will look like this:
-
We'll use four AA batteries in series (via one of the battery connectors you can grab up front) to provide 6V to our circuit.
-
We'll start by making a stable 3-Volt source (relative to the "-" sign of our battery) and do our work around that point, so as to avoid output limitations of the op-amp. For the rest of the time, we'll consider this to be our 0-Volt reference voltage (so all of the voltages discussed below are assumed to be measured with respect to this value).
-
We'll get two audio inputs from our TRS connector, which we'll offset so that they are centered around the midpoint of the battery, V_L(t) and V_R(t); then we'll average them together (to get a single signal for the audio which we can then manipulate). Let's call this new signal v_a(t) ("a" for "average").
-
We'll then buffer v_a(t) so that we can make use of it in multiple places.
-
We'll use an RC circuit to filter v_a(t), making a version containing only the bass frequencies (let's call that new signal v_b(t), "b" for "bass").
-
We'll then amplify v_b(t) in such a way that we avoid output limitations of the op-amp, getting a new voltage kv_b(t).
-
Finally, we'll average together v_a(t) and kv_b(t) to get our final output (which should emphasize low-end frequencies while not losing high-end frequencies).
-
This new signal can then be hooked up to another TRS connector so that we can listen to it via headphones :) but we'll want to be careful to measure relative to our e_{\rm ref} instead of the "-" side of our battery.
This seems like a lot (and it is!), but like any big problem, we'll tackle it one small piece at a time as the lab goes on. And as you're working through, feel free to stop, think, and/or ask for help if you get stuck or if things aren't making sense.
Before we Start: Components
A few things to note before we get started:
-
Today is probably going to be a day for the big breadboards, rather than the small ones, given the amount of stuff we're going to have on our board by the end; we're going to be building a lot of pieces, and it might be a good idea to space them out on your board as well (rather than building all of the pieces in close proximity).
If you're feeling bold, you can use one of the small breadboards instead; but the big ones are just fine.
-
We have a bunch of pre-cut wires available from the cabinets where the resistors are (in the bottom left). These are cut perfectly to size for skipping over 0, 1, 2, or 3 holes in the breadboard. The orange and/or yelow ones are good for jumping across the gaps in the breadboard, and the shorter ones can be useful for some kinds of op-amp connections. Feel free to use those, or to cut your own wires.
-
We're going to be using some op-amps today, but we're going to use a different package than before. We used the L272 op-amps when powering the motors because those op-amps were designed to be able to source a lot of current (which the motors needed in order to spin). For today, though, we don't particularly need a lot of current; rather, we need op-amps that can respond really quickly to their inputs. As such, we'll use a different op-amp: an MCP6002. Like the L272's, there are two op-amps in each MCP6002 package; but be really careful, because this chip has a different pin layout than the L272's do. The pinout for the MCP6002s is shown here (and clicking it will open a copy in a new tab):
Like with the other op-amps, a small dot on the surface of the chip marks pin 1. For any of these that you use, make sure to connect V_{\rm CC+} (pin 8) to the "+" terminal of the battery connector and V_{\rm CC-} (pin 4) to the "-" terminal of the battery.
Note that the packages are labeled with "MCP6002" so you can tell that you've got the right component. And these packages should fit nicely right across the gap in the middle of the breadboard, like so:
If you don't do things carefully and correctly in this lab, there is a risk of messing up the sound card on whatever device you're working with. We'll steer you in the right direction, but just be extra careful to read everything, do all of the check yourself boxes, etc.
We're also happy to help with things, look over schematics before you start building, etc.
Additionally, it's a good idea to disconnect the battery (or just flip the on/off switch) every time you're building anything, and only plug it back in to test.
Table of Contents
1) Audio Signals
The circuit we're building here will involve processing audio, which we'll get from your computer/phone/whatever via a "TRS" cable (tip, ring, sleeve), named for the various regions of the connector, each of which carries a different signal. In order to grab those signals, we'll use a connector like this one, which will allow us to get access to those signals on our breadboard:

This connector can act either as an input or an output (and we'll actually use two of them in this lab, one for each purpose). These connectors are designed to connect to a 3.5mm audio cable:

The various regions on the connectors carry different audio signals. Generally, these cables are meant to carry "stereo" audio signals, which have separate values for the left and right audio channels.
The pin labeled "S" (for "sleeve") is a reference node, and the pins labeled "T" (for "tip") and "R" (for "ring") carry the left and right audio signals, respectively. Once we have audio playing through a cable connected here, we can model this connector like so:
The connector just wires us up (via the cable) to something in your device that is making sound (which comes to us as a voltage).
Ultimately, we'll use one of these connectors to get an audio signal from your computer/phone/whatever onto the breadboard somewhere, create a circuit to manipulate that signal, and then use another connector to send that processed signal to a set of headphones.
2) Offset
Alright, now we're actually ready to get rolling. For starters, we want to take our 6V battery (actually four 1.5-Volt AA batteries in series) and make a stable source at the midpoint of the two terminals (where "stable" here means that, in principle, it remains at that voltage regardless of what we hook up there). This spot will be at 3 Volts relative to the - side of the battery, but we'll consider it to be our 0-Volt reference for the remainder of the lab.
For resistor values for this part, you probably want to use resistances around 10{\rm k}\Omega.
Once you have your schematic in hand, go ahead and build your circuit. Put it somewhere near the middle of your board, not all the way to one end.
We suggest connecting both blue rails to the "-" side of the battery so that we have an easy way to get at that voltage.
We also suggest putting the "+" side of the battery on one of the red rails, and your new midpoint value on the other red rail, so that we have easy access to both of those as well. Then you can orient your op-amp so that its pin 8 is on the side of the breadboard where you connected the "+" side of the battery so that the connection to V_{\rm CC+} is easy to make with one of the orange or yellow pre-cut wires.
Also make sure that this value doesn't change much if you connect, say, a
10{\rm k}\Omega resistor between that spot and the "-" side of the battery.
2.1) Choosing a Good Reference Voltage
For the rest of the lab, we're going to refer to this potential (halfway between the potentials at the battery's terminals) as our 0-Volt reference potential (below, we'll often refer to it as e_{\rm ref}), and, moving forward, we'll measure everything relative to that point.
It's natural to think about the - side of the battery as being 0V, the "+" terminal as 6V, and this new voltage as 3V. But moving forward, we're going to think of the "-" terminal of the battery as -3V, the "+" terminal as +3V, and the voltage we just made in the previous section as 0V. This is a choice we can freely make (choosing our reference voltage), and it'll be convenient for us to think about the whole circuit as being referenced to that spot instead of to the - terminal of the battery.
3) Wiring Up the TRS Connectors
We're going to connect the pin labeled SLEEVE
to our reference voltage so
that the voltages on the pins labeled TIP
and RING
can be thought of as
being relative to e_{\rm ref}.
Now, we would like to average these voltages together using the ideas from the prelab. Go ahead and do this, using resistances of around 100\Omega.
4) Buffer
We're going to use this voltage v_a in a couple of different ways, and so we'll want to make sure that it's not susceptible to loading effects as we connect various things up to it. As such, we'll make a buffer to create a copy of this voltage that is stable (i.e., it won't change when we connect things up to it).
Use the second op-amp in the same package you used for your first buffer, rather than using a second MCP6002 package.
4.1) Reference Voltage Revisited
But, wait...why did we even bother making that e_{\rm ref} voltage? Why not just use the - terminal of the battery for everything? Let's go ahead and do a little experiment to see why this is such a useful abstraction:
- Turn off any music you had playing, open up https://onlinetonegenerator.com/binauralbeats.html on your laptop/phone/whatever, set both numbers to 500, and hit play
- Temporarily, connect
SLEEVE
to the - terminal of your battery instead of to e_{\rm ref}. - Use CH1 to measure the input to your buffer, relative to the - side of the battery. You should see a nice, clean sine wave on the scope.
Now, hook up CH2
to measure the output of the buffer, again relative to the -
terminal of the battery.
TAKE A PHOTO OF THE OUTPUT ON YOUR SCOPE BEFORE CONTINUING; WE'LL WANT TO TALK ABOUT IT IN CHECKOFF 1.
Then put SLEEVE
back where it belongs (at our chosen reference voltage,
not the - terminal of the battery), and move your probes so that you're
measuring the input and output of the buffer relative to e_{\rm ref} instead.
You're likely to see a dramatically different shape.
4.2) Another Test: Listening
Now that we have an audio signal, let's go ahead and listen to it! Plug your other TRS connector into the breadboard. On this one:
TIP
andRING
to each other, and also to your buffered v_a- connect
SLEEVE
to e_{\rm ref}
We'll connect this up to headphones so that we can hear our audio. If you have headphones that have a 3.5mm audio connector (that fits into the TRS connectors), you can feel free to use those; if not, we have some at the front of the room (which you can keep). And, if your audio source (computer or phone) doesn't have a 3.5mm headphone jack, we also have USB-C to headphone converters.
Start some audio playing. Feel free to use whatever audio you like, but something with a good bass line is probably a good bet. Our recommended song for this lab is "Toxic" by Britney Spears, since it has a really nice bassline that our circuit will be able to emphasize.
Other suggested songs if you're unsure of what to use are: "Superstition" by Stevie Wonder, "I Want You Back" by the Jackson 5, "Cruel" by St Vincent, or "Always Straight Ahead" by This Day and Age. But definitely feel free to choose something you like, too, don't just blindly go with whatever songs we suggest. Be your own person.
Once you have things connected like this and have some music playing, we'll get a voltage drop proportional to v_a - e_{\rm ref} across the headphones, which should result in audible music!
Once you're satisfied, disconnect the battery from your circuit until we're ready to test again.
5) Schematic
Discuss your results so far to a staff member.
6) RC Low-Pass Filter
Here's where the real magic is going to start to happen. We're going to take that buffered v_a signal and connect it up to a circuit like the following:
6.1) A Sine of Great Things to Come
Let's call the potential in between the resistor and capacitor v_b, as shown above.
Think back to this week's lectures, where we saw that, if v_a were a pure sine wave, the v_b would (after some small amount of time) be a pure sine wave at that same frequency, but shifted and scaled down by some amount. And as the frequency of v_a increased, the amplitude of v_b would decrease. In particular, we found that if v_a = V\cos(\omega t), then:
In a second, we're going to try an experiment. But before we do that experiment, we need to make sure we know what to expect.
6.1.1) Run the Experiment!
Now let's try an experiment to make sure that reality matches our expectations!
Turn off any music you had playing and open https://onlinetonegenerator.com/binauralbeats.html on whatever device you were using to play the sound. Leave the audio cable connected to the TRS jack, and then set both outputs on that page to 20Hz and click play.
Using your scope, measure both v_a and v_b (on separate channels), and use the scope to verify your experiment from before. Use the cursors to measure both the frequency and the amplitude of each wave and make sure that everything matches your expectations. Take a photo of your scope output so that we can talk about it during checkoff.
Then on that website, set "right ear frequency" to 1000Hz and click "Play" again. Note that v_a now looks like the sum of a 20Hz wave and a 1000Hz wave. What does v_b look like? Take a photo of your scope output so that we can talk about it during checkoff.
Something cool is happening here. When our input is a single sine wave, it gets scaled and shifted in a particular way according to the formula we found above. When our input is a sum of sine waves, they are each scaled and shifted by that same formula, independently of each other.
6.2) Play That Funky Music
Here, we're going to exploit that property of this circuit. We can think of v_a, when a song is playing, as being a sum of a whole bunch of sinusoids (you can take 6.300 or other classes about Fourier analysis to learn more of the theory behind that assertion!), and our little RC circuit works on each of those sinusoids independently; this has the effect of letting the low frequencies in v_a through roughly unchanged (things with low pitch in the song, like bass guitars and other low notes, or bass drums), but heavily attenuating the higher frequencies (higher pitches, the vocals, etc).
How do v_a and v_b relate to each other? What are the obvious
similarities/differences?
Show your results so far to a staff member. Be prepared to discuss your
results (including audio and oscilloscope outputs), as well as a schematic
drawing of your circuit so far and a description of how it is working.
7) Booooost
Since our goal is not just to isolate the low frequencies but also to amplify them, we're going to add another piece here, to scale up v_b by some amount. We can do this with a non-inverting amplifier offset by our e_{\rm ref}, something like the following:
We're also going to get a little bit fancy here and make it so that we can adjust the gain by turning a knob. We'll do this by using a potentiometer to create a variable resistance and use that resistance as part of our amplifier setup. Remember that a potentiometer consists of two variable resistances that change as we turn a knob:
Here, we'll use a 220\Omega resistor for R_2. For R_1, we'll use one leg of a 10{\rm k}\Omega potentiometer, for example the \alpha R_{\rm P} one. Thus, as we turn the knob on the potentiometer, then, R_1 will vary from approximately 0\Omega to approximately 10{\rm k}\Omega.
Now go ahead and add this module to your breadboard.
The pots fit nicely into one side of the breadboard without needing to bend their legs at all, leaving one row of holes on either side of the breadboard to which you can connect wires.
Given this layout, it's a good idea to put the pot off on its own somewhere and run wires from the op-amp's terminals over to the pot and back, rather than trying to make the pot fit in the same rows that the op-amp's terminals are occupying.
8) Output
Finally, use 100\Omega resistors to average v_a (the output of our buffer
from way near the start of the lab) and kv_b (the output of the non-inverting
amplifier from the last section), and connect that output to TIP
on the TRS
so we can hear it (and make sure that you've also removed any previous
connections you made to that spot).
Also connect your probes to measure this average relative to e_{\rm ref}.
On one extreme end, the song should sound unchanged, but on the other end
we should hear a lot more bass!
Everything is yours to keep if you want it (including the circuit, the
headphones, the connectors, op-amps, breadboard, etc), except for the USB-C to
audio adapters; we don't have enough of those to go around, so if you took one,
please return it. You can also stick the battery case to the back of the breadboard if you want;
we have some double-sided tape up front for that purpose.
Show your results to a staff member, and be prepared to discuss not only your
results but a complete schematic drawing of the circuit, as well as
describing how it accomplishes the result we see.