I am an old school electronics engineer, but I worked almost forever doing software development for the big telecommunication companies suppliers.
I have recently decided that it was time to start digging into my old knowledge and make a hobby out of it. I have several subjects in mind that I would like to explore: robotics, electronic musical instruments, home automation, and so forth.
Let’s make this journey together! We can surely learn a lot of new things from each other.
Drop me a comment! I look forward to hear your thoughts!
Noises are sound effects, they have nothing to do with the light. So, why are we talking about white and pink noise?
The reason comes from the knowledge that white light is the composition of all the colors in the visible spectrum. By association, a noise composed by all the frequencies in the audible spectrum was defined as white as well. From there, it became easy to extend this concept to other kind of audio noises, and assign a different color to each one of them.
The reality as we know today, however, is quite different. Today we know that any audible noise is obtained by mixing together all the possible frequencies of the audible spectrum. The difference lays in the perceived intensity of the sound at each frequency or interval of them.
We know know that the white noise is characterized by having a constant amplitude at all the frequencies, which translates in saying that the power of the various frequency of the white noise is constant. Or, even better, the power spectral density of the white noise is the same at all frequencies.
Or is it?
Well, the problem of us humans is that we do not believe in something unless we can prove it to be true.
The fact is: our ear does not perceive the sound linearly. The ear perceives the sound logarithmically. In particular, our ear can perceive much better the high frequencies than the low frequencies. As a result, when we listen to the white noise, we perceive it as very rich of high frequencies, but that is just because we cannot hear well the lower frequencies of the white noise spectrum.
The proof of that? Look at the screen of a spectrum analyser for the white noise.
Look at the top crests. Those are the ones that represent the amplitude of the signal at each frequency. Do you see how it remains constant at all the frequencies?
Let’s now talk a little bit about the so called pink noise. When we listen to the pink noise we perceive it as filled of all those low frequencies that were missing from the white noise.
However, the reality is quite different. The pink noise intensity changes with the frequency. In particular, it is such that it decreases with the increase of the frequency at a rate of -3dB per octave. Incidentally, this is the same rate at which our ears work, but in the opposite direction: when the frequency increases, our ear becomes more sensitive to the intensity of the sound at a rate of about +3 dB per octave. The two rates are the exact opposite and so they cancel each other and, to our ear, the pink noise seems to contain all the frequencies of the audible spectrum and all with the same intensity. Weird, isn’t it?
Here is the proof of that.
Do you see how the top crests at the various frequencies become smaller and smaller at the increase of the frequency?
So, contrary to the white noise, the pink noise presents a reduction in the intensity of the sound that is inversely proportional to the frequency of the sound itself and, specifically, when the frequency doubles, the signal becomes 3dB smaller. in other words, the power spectral density of the pink noise decreases with the increase of the frequency with a ratio of -3dB per octave.
If you like, go watch this video on YouTube, where I describe how to build a generator of white and pink noise for the lab. You’ll be able to hear both the white and the pink noise several times throughout the video, so you can get an idea on how we perceive each one of these noises.
Let’s now talk about how these noises are actually used in lab and in the real world.
Let’s begin from the white noise. Because of its characteristic of providing a constant intensity at all the frequencies, it becomes really useful when we want to measure the frequency response of an audio amplifier, for example. We inject the white noise into the input of the amplifier and we attach to the output a spectrum analyser. The analyser will tell us the range of frequencies that the amplifier is capable of handling, but it will also tell us if the amplifier has a flat frequency response, or if it amplifies better certain frequencies rather than others. This information can then be used to tune the amplifier to make it work with a flat response at all frequencies.
Another usage is in filters measurements. Again, putting at the input of the filter the white noise and attaching the output to a spectrum analyser, we can actually visualize in a single shot if the filter works in the required range of frequencies and if it provides the right attenuation at each frequency.
And what about the pink noise? Pink noise becomes very useful when installing professional sound systems in a room. Such systems normally posses what is called a graphic equalizer, which allows to change the response of the system to various frequencies. We input a pink noise into the sound system and we let it fill the room with its sound. Then, using some microphones in the strategic places of the room, we can convert the actual sound back into electrical signals and send them to a spectrum analyser. Then we start playing with the graphic equalizer to obtain a flat response on the analyser. Because the pink noise has a distribution of power density which is a complement of the sensitivity of our ears, when we obtain a flat response we have actually adapted the sound system to the most appropriate way to generate sound pleasant to our ears. Without doing so, the sound system would amplify the sound linearly, therefore changing it from what it was originally intended during its recording. Remember, we want the electronic instruments behave like our ears, because that is how we perceive the musical instruments and the voice of people, not linearly. The pink noise allows us to tune the sound system in exactly that way.
Some basic nomenclature and information on electric circuits.
When we think of an electric circuit, the first thing that comes to mind is a bunch of electric and electronic components put together to make a device that provides a certain functionality.
This is totally right, of course, but it is not a precise definition of an electric circuit. In fact, circuits can be defined in different ways, depending on the particular aspect of them that we want to highlight.
If we want to define a circuit with respect to the wave length of the voltage and current that the circuit handles, we will distinguish between “lumped” and “distributed” circuits.
If instead we want to highlight the kind of electric or electronic components the circuit is made of, then we need to talk about linear and non-linear circuits.
And, finally, depending on the temporal stability of the components, we can talk about “time-invariant” and “time-variant” circuits.
And, of course, we can consider combinations of the properties and, therefore, combinations of different circuit types.
In this article, I will go through the above list of circuit types and provide a proper definition and description of each one of them. Combination of those types will lead to combined definitions and descriptions of the basic types. However, in this context, I will go through only the basic types of circuit, leaving to you the task to provide definitions and descriptions of the combinations.
Lumped and Distributed Circuits
Let’s go now into more details about these kind of circuits. What differentiates these circuits is the size of their components compared to the size of the wavelength of the electric current flowing through them. Hum, well, I guess we need to back up a little bit first. Let’s start with the types of current.
We have two kind of currents: the direct current, or DC, and the alternate current, or AC. DC current always flows in the same direction and never changes. AC current has usually the shape of a sine wave, or some other shape that periodically inverts the direction of the current. The number of times the current inverts its flow depends on the number of times the voltage flips its polarity. When the Voltage goes from positive to negative n number of times in a second, we say that its frequency is n and it is measured in Hertz.
Since the flow of the current in a conductor is not instantaneous, it makes sense to think that a change in the voltage at the ends of a conductor makes the current change progressively through the conductor. And if the voltage keeps changing back and forth, so does the current. At the end, both the instantaneous values of the current and the voltage across the length of the conductor follow in space the same shape of the voltage changes (in time) applied at the ends of the conductor. So, if the voltage changes in time like a sine wave at the ends of the conductor, it will follow a similar shape in space throughout the length of the conductor. The length of such a sine wave in space throughout the conductor is called wavelength of the voltage, or the current. Such length in space depends on the length in time of the corresponding voltage applied at the ends of the conductor.
We can calculate the wavelength using the following formula:
The Greek letter “lambda” represents the wavelength, the f represents the frequency of the voltage, which is how many times the voltage goes from positive to negative and back in one second. And, finally, the letter ‘c’ represents the speed of light. Yes, you got it right, it is the speed of light!
When the wavelength is much longer than the physical size of the components of the circuit, we say that it is a lumped circuit, because the components are just small lumps with respect to the wavelength itself. In such a case voltage and current are practically constant across the whole length of the component.
When the wavelength is comparable with the physical size of the components of the circuit, we say that it is a distributed circuit, because the components are so big compared with the size of the wavelength that the wave itself is distributed across them. In such a case voltage and current will be different in different sections of the component, at any instant in time.
Distributed circuits cannot be analyzed with normal algebra equations. For those, it is necessary to heavily use calculus. Example of such circuits are the microwave circuits, those used to deal with radars and satellite signals.
Linear and Non-Linear Circuits
A component is defined as linear if it can be represented in a I-V (current-voltage) diagram with a straight line.
A component is defined as not linear if its representation on a I-V diagram is not a straight line.
Simply put, a linear circuit is one made with only linear components, while a non-linear circuit is one that has at least one non-linear component.
Note the difference: for a circuit to be linear, ALL the components must be linear; for a circuit to be non-linear, it is enough that ONLY ONE component is non-linear. All the other components can be linear and still the whole circuit is non linear.
Time-Invariant and Time-Variant Circuits
Difference between time-invariant and time-variant circuits is also straightforward.
A time-invariant component is one for which the measurements that define it never change over time.
A time-variant component is one for which the measurements that define it can change over time.
As a result, a time-invariant circuit is one made only with time-invariant components. A time-variant circuit is one made with at least one time-variant component. This is a subtle definition, very similar in its form to the one for linear and non-linear circuits.
Circuits in Series and in Parallel
One last thing I would like to discuss about circuits in general is related on their topology or, in other words, on how the components in a circuit are connected to each other.
There are two main configurations of connected components:
components in series
components in parallel
Components are said to be connected in series when they are traversed by the same current.
Components are said to be connected in parallel when the voltage on each one of them is the same.
When we talk about connections in series and in parallel, of course, we refer to components directly attached to one another, at least on one terminal, or lead. Components that are far away in the circuit diagram, or that are not directly connected together cannot be defined as in series or in parallel.
So, now, can you tell me what kind of circuit is the one at the very beginning of this article? Put your answer in the comments and let’s see who gets it right.
An introduction to operational amplifiers, or op-amps in short.
Operational Amplifiers or, in short, op-amps, are encountered very often in analog circuits to make amplifiers, filters, comparators and oscillators. They are widely used for the simplicity that can be obtained in the design of circuits, but also for the advantages of improved stability, precision and linearity.
All these advantages come from the hidden complexity of their own design, that allows us to build the same complexity in our circuits while keeping them simple.
What is an Op-Amp?
An op-amp is an integrated circuit (IC) providing an amplifier with two inputs and one output. The output voltage is proportional to the difference of the voltages at the two inputs. The electrical symbol is depicted above. The two inputs are marked with a + and with a –. These are called the non-inverting input and the inverting input respectively.
These devices are usually powered with two separate voltages with respect to the ground. Powering them this way allows us to deal with analog signals without the need of using capacitors to decouple the signals from DC.
The op-amp gain, or the ratio between the output and the input voltages, is very high. Depending on the particular IC , it can easily range between values of 100,000 to several millions.
Based on that, for all practical purposes, we usually approximate our calculations by assuming that an op-amp has infinite gain.
Because of the infinite gain, and because the op-amp amplifies the difference between its two inputs, such difference has to be 0. Any difference greater than 0 would cause an infinite output voltage. Practically a saturation of the device.
Finally, both + and – inputs of the op-amp have a very high impedance, which we can again approximate with infinite. Therefore, we can safely say than when we connect a voltage source to any of the inputs there will be no current flow.
Here is a picture of the inside of a typical op-amp, in this case a LM741. You can see that it was no joke when I said that they hide a very complex circuitry on their inside.
However, to use an op-amp we do not need to know how it is made inside. We only need to know how to approach the calculations at a black box level.
The easiest way to do so is to study some of their applications, which will help us understand how to deal with these versatile components.
The Inverting Amplifier
An inverting amplifier is one that takes the input signal, it amplifies it, and it presents it to the output with an upside down shape. We say that the output is shifted 1800.
Here is a representation of the signals in such circuit:
Note the input wave in yellow and the output wave in blue. You can see that the output exactly mirrors the input, but upside down.
And here is the schematic of the inverting amplifier:
The non-inverting input is connected directly to ground. The inverting input is connected with a resistor Rf to the output, and a resistor Rin to the input voltage.
The Rf resistor provides a negative feedback to the amplifier. In fact, since the output voltage has opposite sign of the input voltage, the two signals cancel each other at the junction point between the two resistors Rf and Rin.
Let’s do some simple calculation now.
Since the two inputs need to be at the same voltage, and since the non-inverting input is connected to ground, the voltage at the inverting input must also be to a voltage equivalent to ground. We call this condition as virtual ground and we say that the inverting input is at virtual ground. Keep this in mind, because this is the main factor to determine how this circuit works.
Since the – input is at V=0, the current Iin inside resistor Rin will simply be:
and, similarly, the current If through resistor Rf will be:
Both Iin and If go toward the node at the – input. And since there is no current going out, it means that the two currents Iin and If must be equal in magnitude and opposite in sign, so
Substituting with the values of currents we calculated earlier, we obtain:
So, the amplification of this circuit is simply obtained by the ratio between those two resistors and the output voltage will have an opposite sign than the input voltage. And that’s why this circuit is called an INVERTING amplifier.
The Non-Inverting Amplifier
This amplifier works similarly to the inverting one, but the main difference is that it does not shift the signal of 1800.
Here is a sample of the input and output signals in such an amplifier:
You can see how this time the output and input are in sync, there is no phase shift. In other words, the output is not upside down.
Here is the schematic of the non-inverting amplifier:
This time, the input voltage goes directly to the non-inverting input.
The inverting input is attached to the output through a resistor R2 and it is also attached to ground through resistor R1.
R2 and R1 create the negative feedback for the op-amp.
Because there is no current flowing in or out the inverting input, we can safely say that V-, the voltage applied to the inverting input, is given by the output voltage Vout going through the voltage divider made of R2 and R1. So:
We also know that the voltage at the two inputs must be the same, so V+ must be equal to V-, and also V+ is the same as Vin.
Therefore, we can write the following:
which can be rearranged this way:
So the amplification of this circuit, besides the sign, is just one point higher than the case of the inverting amplifier, but still depending only on the two resistors R1 and R2.
The Voltage Follower
The voltage follower is one of the two easiest circuits that can be created around an op-amp. In fact, there are no components directly associated with this functionality, just the op-amp.
Here is the schematic:
The output is directly connected to the inverting input, while the non-inverting input is used as the device input. Since the feedback loop applies the whole output to the inverting input, and since the two inputs have to be at the same voltage, This device produces at its output the exact same signal present at the non-inverting input.
Now you may ask: why do we care? We already had that signal, why don’t use that directly?
Well, the answer is: impedance!
When we put a voltage follower in between two other circuits, we do have what we call an impedance adaptation. We adapt the impedance of the circuit at the left of the voltage follower to the impedance of the circuit at the right.
As an example, let’s say that we have an oscillator, and we want to use its output to drive another circuit that is going to draw from the oscillator a certain amount of current. Unfortunately, if we draw current from it, the oscillator will stop oscillating.
The solution is to put the output of the oscillator as input to the voltage follower. Given the high impedance of the op-amp input, we will not draw any current from the oscillator, so it will work flawlessly.
But now we can use the output of the op-amp, which has the same signal as the oscillator, to draw the current we need, which is possible because of the very low impedance of the output of the op-amp.
Here is a picture representing the situation in the example:
The Voltage Comparator
And here is the other simple circuit that can be created with an op-amp:
There it is. Nothing else. Not even the negative feedback connection!
Well, what is going on here? Simply put, with this circuit we want to actually exploit the extreme gain of the op-amp bringing it into saturation, that’s why there is no feedback.
We just put a reference voltage on the inverting input. Then we put a signal to the non-inverting input. What we want to achieve is to be able to say when the input signal on the non-inverting input is higher or lower than the reference voltage.
And in fact, when the input signal is greater than the reference voltage, the op-amp will saturate and will output the maximum possible voltage, which will be just a little less than the positive voltage provided by the power supply.
Vice versa, when the input signal is lower than the reference voltage, the op-amp will saturate again, but in the opposite direction: it will output the minimum possible voltage, which is very close to the negative voltage provided by the power supply.
We can consider, for example, the positive output as a logical 1 and the negative output as a logical 0. So we will have an output of 1 when the input signal exceeds the reference voltage, and we will have an output of 0 otherwise.
The Current Generator
Let’s now make an example of a current generator:
In this schematic there are only two resistors. RL is the load through which we want a constant current. R is used to complete the polarization for the negative feedback.
Let’s see how this works and how we can calculate the amount of current we need.
The voltage at the inverting input V- depends on the output voltage Vout reduced by the voltage divider made by resistors RL and R:
At the non-inverting input we have
which is a reference voltage.
The output current is given by:
since there is no current going through the wire toward the inverting input. And since V+ and V- must be identical, then we can write:
which we can adjust this way:
Now we can substitute Vout in the equation for the current, and we obtain:
So, basically, the current depends only on the values of the resistor R and the reference voltage. Even if the load RL changes, the current will not. So we have a constant current going through the load.
In addition, if we want to change the value of the current, we just need to change the reference voltage, without touching anything else, since the current is directly proportional to Vref.
The Voltage Adder
Another interesting circuit to analyze is the voltage adder. Algebraic operations are actually the reason why the op-amp has its name. It was originally designed to perform mathematical operations analogically. Of course that was before the advent of the digital circuits.
Let’s take a look at the circuit:
We have the op-amp with a negative feedback given by resistor Rf. The non-inverting input goes to ground and the inverting input is connected with a number of inputs via resistors that have all the same value, which we identify with R. At each input, we have a different voltage: Vin1, Vin2, and Vin3.
First thing to notice is that, since the non-inverting input is connected directly to ground, the inverting input itself is at the virtual ground. That said, we can calculate current If going through resistor Rf as:
Similarly, we can calculate the current across each resistor R as:
Since there is no current going toward the inverting input, it has to be:
And because of the previous equations on the current, we can now write:
which means that the output is proportional to the sum of the three voltages at the three inputs, but with a reversed polarity.
If we use a value of Rf equal to the value of the resistors R, the output voltage is exactly equal to the negative of the sum of the input voltages.
The Differential Input Amplifier
An important circuit built around the op-amp is the differential input amplifier. Here is its schematic:
First, we can see the feedback resistor R, connected between the output and the inverting input.
Then there are two input resistors and a fourth resistor between the non-inverting input and ground.
All the 4 resistors have the same value.
Once again, and this is very important for this circuit, remember that the values V+ and V– have to be the same, .
Based on that, here is the sequence of calculations that lead to the final result:
Let’s just take a look at the final result. That tells us that the output voltage is exactly equal to the difference of the voltages applied to the two inputs, with opposite sign.
Yes, exactly, this is the opposite of the previous circuit. That one was adding voltages, this one is subtracting them.
The Inverting Amplifier With Reactive Elements
So far we have seen different circuits providing different features, but all using resistors to do that.
However, where the op-amp starts to excel is when we start using reactive elements, like capacitors and inductors.
The most general form of an op-amp circuit with reactive elements is the one in this picture:
It looks like the inverting amplifier we previously saw, but this time it uses impedances instead of resistors. The amplification of this circuit can be calculated the same way as the inverting amplifier, but the formula now assume the form:
Depending on how Zf ans Zin are implemented, the behaviour of this circuit changes radically. This is the basis for building what are called active filters, which is a huge subject in the operational amplifiers theory.
Here, I will just present 3 of the most significant examples.
Example 1: The Integrator
The integrator is obtained using a capacitor as the Zf and a resistor as the Zin. Its amplification is therefore dependent on the frequency and can be expressed by the following formula:
The cut-off frequency is:
As long as the frequency of the input signal is lower than the cut-off frequency, the output signal reflects the input signal, although it will be out of phase. Once the frequency of the signal approaches the cut-off frequency and goes beyond, the amplitude of the output signal becomes smaller and smaller, and that’s because the negative feedback becomes greater and greater.
This behavior can be represented in the frequency domain by a picture like this:
A circuit that behaves like this is also called a Low Pass Filter.
Example 2: The Differentiator
The differentiator works exactly the opposite way of the integrator. Zf is replaced with a resistor and Zin is replaced by a capacitor. The cut-off frequency has exactly the same formula as the integrator, but this time the behaviour is different.
When the input signal has a frequency higher than the cut-off frequency, the capacitor has a very low reactance, which translates into an output signal similar to the one in the input.
When the frequency of the input signal goes below the cut-off frequency, the capacitor has a high reactance, which translates in a lower amplification and, therefore, the signal amplitude becomes smaller.
A diagram of the output voltage as a function of the frequency shows exactly that.
And this, of course, is the behavior of a high pass filter.
Example 3: The Band Pass Filter
If you look carefully, you will see that this circuit has both the characteristics of a low pass and a high pass filter.
R1 and C1 make the circuit behave like it was a high pass filter, but R2 and C2 make it behave like it was a low pass filter.
And in fact, if we merge the diagrams of the low pass and high pass filters we obtain something like this:
And that resembles the frequency diagram of a circuit which gives precedence to a specific frequency and attenuates everything else. This is why it is called band pass filter.
This ends the article on the operational amplifiers. Did you find it useful? Is there anything else that you would have liked to see? Was the level of the article OK with you? Please let me know in the comments.