First of all, you need to know the potential (or voltage) that it creates. In the real world, this is the cause of the charge transfer (for example, a battery is characterized by its ability to create a voltage difference between its terminals). In our case, let’s assume the wire is alone in space and has a charge distribution such that it produces a voltage difference between the wire and infinity. In other words, we need to spend joules of energy if we were to transfer a point charge from infinity to the wire’s surface.

We now wish to find the potential created by this charged wire in an arbitrary point in space. This is given by the following known formula from electrostatics

(1)

where is the distance between the charge density and the observation point given by the following equation

(2)

The integration takes place everywhere in space where the charge density is not zero. In other words, if one wishes to find the charge distribution on the wire, equation (1) must be solved. However, this is not an easy task, since is the integrand. An alternative is to seek a numerical solution.

The wire is made out of perfectly conducting metal so it can be regarding as equipotential. Now, let’s assume that its radius is very thin and the charge is located on a line on its surface. The observation point will be the axis of the wire, where we know the potential. In addition, suppose we can write as

(3)

where are arbitrary coefficients that need to be determined and is given by the following formula

(4)

where is the length of the wire and [/math] N [/math] is the number of segments that we have partitioned the wire.

The careful reader can immediately see the meaning behind equations (3) and (4). The wire has been separated in pieces and gives the charge distribution (in Coulombs per meter) for the k-th segment.

We can align the wire to the x-axis, so equation (2) becomes

(5)

where is the radius of the wire.

After all these changes equation (1) becomes

(6)

This is a linear equation with unknowns, but for a particular observation point. We can construct an invertible matrix, if we take into account additional observation points, that need to be linearly independent, so they cannot belong to the same segment.

A MATLAB function was written to demonstrate the feasibility of this technique, also known as Method of Moments. It accepts as inputs the length of the wire, the number of segments, the voltage of the wire and its radius. The output is a plot depicting the charge density of the wire along its length.

function charge_on_wire(length, number_of_segments, voltage, wire_radius) l=length; nos=number_of_segments; v=voltage; wr=wire_radius; for m=1:1:nos for k=1:1:nos fun = @(x) 1./sqrt(((l./(2.*nos))+(l.*(m-1)./nos)-x).^2+wr.*wr); Z(k,m)=integral(fun,(k-1)/nos,k*l/nos); end end b=ones(nos,1); b=b*v*4*pi*8.854*10^-12; A=Z\b; for i=0:l/nos:l*(1-1/nos) y(int64(1+i*nos/l))=i; end plot(y,A);

The plot for a wire of unit length, unit voltage, radius of 1 millimeter and partitioned in 50 segments can be seen below. It confirms the widely known rule of thumb, that charge tends to get concentrated at the edges of a structure.

]]>Here’s the problem: A straight string of length 1 is being displaced from its middle point to an amplitude 0.5 (see picture above). If the string is to be set free, what is the amplitude of every point as a function of time?

Answer:

The string will satisfy the wave equation (for the proof see “D. J. Griffiths, Introduction to Electrodynamics, 3rd edition, Chapter 9”) or in equation form

(1)

where c is a constant that depends on the physical properties of the string. This amplitude function represents the amplitude of a point at particular time. The initial conditions are

(2)

because these are the edges of the strings, and

(3)

because there is no initial velocity.

We assume that the amplitude function is separable, namely

(4)

Then we can rewrite (1) as

(5)

Dividing both sides of (5) by (4), we get

(6)

where is a constant. The reason for that is that we have two functions in (5) which are always equal, yet they do not depend on the same variable. The only way for this to be possible is if they are both constant.

The general solution to equation

(7)

is

(8)

and the general solution to equation

(9)

is

(10)

Applying the boundary condition of equation (3) leads to the constant B of equation (8) to be zero. In addition, because of the boundary conditions of equation (2), the constant C of equation (10) must be zero and the constant must be equal to , where n is an integer. Therefore, we have the following particular solution of equation (1)

(11)

Due to the linearity of the differential operator, every equation of this form satisfies equation (1). So, we can construct a function of arbitrary form by adding enough functions of this type until they represent the one in the picture, whose equation is

(12)

(13)

hence the general solution of equation (1) is

(14)

where for it must be equal to equation (12) and (13). Equation (14) with has the form of a Fourier series with period 1. The coefficients can be found by exploiting the orthogonality of the sine functions if we multiply by and then integrate. After some calculations we get

(15)

and the complete solution is

(16)

A MATLAB function was written to visually depict the motion of the string. It takes as inputs the amplitude of the string displacement, string constant, length of string (1 in our analysis) and duration of motion (in seconds). The output is a matrix with the frames of the movement. The code can be seen below.

function [A] = string_wave(amplitude, speed, length, seconds) a=amplitude; c=speed; l=length; t=seconds; lac=0.005; for t=0:0.01:t sum=zeros(1,1+l/lac); d=zeros(1,1+l/lac); for x=0:lac:l d(int64(1+x/lac))=x; for n=1:1:50 sum(int64(1+x/lac))=sum(int64(1+x/lac))+(8*a/(pi*pi*n*n))*sin(n*pi/2)*sin(n*pi*x/l)*cos(n*pi*sqrt(c)*t/l); end end plot(d,sum) axis([0 l -amplitude amplitude]) F=getframe; if t==0 A=F.cdata; else A=cat(4,A,F.cdata); end end

A video was created using this code by typing the following commands

A=string_wave(0.5,1,1,2); B=immovie(A); movie2avi(B, 'name_of_video')

and can be seen below

]]>

The most unpredictable parameter of a BJT is its current gain (*hfe*). On the other hand, the supply voltage and the resistor values are, in general, constant (of course they can deviate from the nominal values, but not as much as *hfe*). So, we want to set the value of the collector current with respect to these predetermined parameters.

Let’s say we want a collector current of 5 mA with a supply voltage (VDD) equal to 5 Volts. In addition, the larger the voltage difference between the collector and emitter the better, in order to avoid saturation. Therefore, we can pick a collector voltage of 4 Volts and an emitter voltage of 1 Volt. That means

and

assuming that the base current is much smaller than the collector current and, hence, the emitter current is approximately equal to the collector current.

We now have to determine and using the assumptions that we have made. For this amplifier, we are going to use the BF199 RF transistor. If you take a look at its datasheet, you will notice that its on base-emitter voltage is between 0.77 and 0.9 Volts. Maybe you will notice that they are not referred to these collector current and collector-emitter voltage conditions, but if it is operated in its forward-active region (and it will, since it is an amplifier), then it must lie somewhere in this interval. Let us assume a base-emitter voltage of 0.8 Volts. In that case, the voltage at its base is 1.8 Volts, because we have assumed a 1 Volt emitter voltage. However, this voltage depends on the transistor’s base current, which depends on the unpredictable parameter *hfe*, because

That means that if we want to make the base voltage independent of the base current we must make much larger than . Again, if we look at the transistors datasheet, we are guaranteed a minimum *hfe* of 40, so it would be adequate to also set to 5 mA, which means that

and also

Building the circuit on LTspice and running the simulation we get the following quite satisfactory results.

]]>Today, oscillators can been considered as a well understood electronic building block. However, there is still a debate about their fundamental properties. I read a recently published paper called “The Barkhausen Criterion (Observation ?)” written by a professor at DTU, where I am currently studying for my MSc, stating that the famous Barkhausen criterion is a necessary but not sufficient condition for oscillations to occur.

At any case, this is not a theoretical post. I am going to show you an easy way to design a 10 MHz sine wave Colpitts oscillator using only simple algebra and circuit theory.

This is a common collector Colpitts oscillator. It could be also arranged as a common base or common emitter, but I preferred this topology because it is the one used in the sa602 mixer oscillator which I was studying. Its small signal equivalent circuit is shown below.

As you can see, some omissions have taken place. The biasing resistors R1 and R2 are considered too big to be taken into account. In addition, the transistor is considered a voltage control current source (hybrid-pi model) with a relatively big input resistance, so it has not been added to the circuit. That means that the only loss present is due to R3 and it is the transistor’s job to pump energy into the system in order to keep it steady.

Let us define the voltage across the inductor L as and the voltage across the capacitor C1 (or resistor R3) as . Furthermore, Then, by applying KCL we get

where is the transconductance of the transistor. As you can observe, one solution of these two equation system is , namely nothing happens. But if for some more complicate reasons (which we will not analyze here) there is indeed a non zero solution to the above equations, then it must satisfy these equations. So, let us solve these equations and find out the conditions for a nonzero solution to exist.

Plugging the second equation to the first and removing the and variables, we eventually get the following equation

The imaginary parts must be equal and, after solving for , we get the frequency of oscillation

Equating the real parts will give us the condition for sustained oscillations, namely

This condition is based on the transistor parameters and for a modern transistor is most likely to be met without much effort.

We must now select the actual values of the components. If we set equal to and equal to , then from the oscillation frequency formula for we get . is just a biasing capacitor, so it should be large in comparison to the other elements, so we set it to .

The input resistance of the transistor is usually at the range. However, it is in parallel with a larger capacitor than . As a consequence, it makes our choice to omit it from the small signal circuit reasonable if , which is in parallel with a much smaller capacitance is similar in magnitude. Therefore, we select to be equal to .

All that’s left now is to pick some values for and . Assuming that the transistor’s DC collector current is and base-emitter voltage is then the voltage at its base is . Many electronics book suggest (as a rule of thumb) that, in this biasing topology, the current in the voltage divider must be ten times the base current. For a transistor current gain of 300 (not unusual for the 3N3904) the base current is . So, the current through is and, hence, . Before we find the value of we must decide on the value of the source voltage. A common choice for portable applications is 5 Volts. The current through must be and that makes equal to .

Now the design is complete and can be seen in the next picture.

A simulation was run on LTSpice and produced the following spectrum.

As you can see, the frequency spectrum is of high quality, with the next harmonic placed 27 dB lower than the fundamental frequency.

]]>The purpose of this line of posts is just that. To introduce and explain circuits relatively unknown to the average electronics enthusiast. Some of them will be simple (like the one that is going to be presented in this post) and some of them will be a little bit more complicated. But all of them have one common trace; when I stumbled across them for the first time, I felt like making a step towards advancing my expertise on the subject of analog electronics.

Ok, enough with the talking. Let’s find out how we can make a thermometer using off the shelf transistors.

Believe it or not, this is a thermometer. The output voltage, *V(out)*, is proportional to the temperature of the transistors (we assume that all of the transistors are close enough, so their respective temperatures do not deviate much). In general, the relationship between the difference of a BJT’s base and emitter voltage () and its collector current () is given by the following formula

(1)

where is the thermal voltage, is the collector current and is the saturation current. What’s important about is that it is a constant for each transistor and that it is directly proportional to its emitter area. The formula of the thermal voltage is

(2)

where is Boltzmann’s constant, is the charge of an electron and is the temperature in Kelvins.

From equation (1) it is apparent that if two identical transistors (same ) have the same base emitter voltage and are close enough to share the same temperature, then they must have the same collector current (). This is the case with Q4 and Q5, as well as Q3 and Q6, assuming that all PNP transistors are identical with each other and all NPN transistors are also identical with each other.

The measurement of the temperature is taking place in the Q1-Q3 transistors. Since transistors Q1 and Q2 have all three of their terminals connected, they form a PNP transistor with twice as much the , because it is proportional to its emitter area. Now, let us perform Kirchoff’s voltage law around the base emitter junctions of the compound Q12 transistor and Q3 transistor. The equation that we get is

(3)

assuming that the current is going into the emitter. Substituting equation (1) in (3), we take

(4)

which can be written as

(5)

As we mentioned earlier, the compound transistor Q12 has twice the emitter are of Q3, so

(6)

and the collector currents of Q4-Q5 are identical, which means that, if we neglect the base currents as relatively small, we get

(7)

Combining (2), (6) and (7) with (5), we derive the following formula

(8)

Now it is obvious how we get the temperature dependency. We have created a current which is directly proportional to the absolute temperature. All Q6 does is replicating this current and feeding it to resistor in order to create the output voltage which can be easily measured using a voltmeter. Therefore, the output voltage is

(9)

By properly selecting the ratio of to we can adjust the rate of change or output voltage for a particular temperature.

[Imagine you are at your university or somewhere in your town and you see some sort of damage. It is not something life threatening, so you can’t call the authorities, but it is something more or less important and you want to see it fixed. What do you do? Well, in most cases you have to go through a bureaucratic ordeal. This website comes to the rescue. You can report the damage either from your computer or from your smartphone online and the central authority can immediately be aware of what is going on. The link to the site is here. The rest of the post describes its functionality.

This is the main page (you can enlarge the picture by clicking on it). The first thing to notice is the Google Maps map. It occupies half the screen and shows, by default, the location of my university (University of Patras). Under the map you can see two forms, the Login form and the Register form. Apparently, when you visit for the first time you must create an account. Filling the “Name”, “Surname” and “Telephone” blanks is not obligatory. In addition, the site includes an RSS feature, in case someone wants to monitor the reports through his RSS aggregator. The “Show Statistics” button is using the AJAX technology to create an asynchronous connection to the server. When a visitor hits that button he receives some statistical information about the reports activity, but without the need to reload the whole page. Create an account, log in and hit the “Login” button to go to the next page.

These are your options as a user. You can file a report, change your user information or check out the status of your previous reports.

To file a report you must first click on the map above and select the location of the event that you are reporting. It is not necessary to get the right location the first time, because you can drag the marker wherever you want. Then you state the importance of the situation. You have three options, “Mild”, “Potentially Hazardous”, and “Urgent Situation”. The next requirements are not mandatory but they can be really helpful. You can upload 1-4 pictures from your phone or PC and write a few words to the administrator.

This is a picture where three instances are being displayed. The “Mild” events are depicted with a green marker, the “Potentially Hazardous” with a yellow marker and the “Urgent Situation” with a red marker. That makes it easier for the administrator to respond better to the urgent situations. If you click on a marker, its unique ID will pop up. This is not very useful for the user, but it is necessary for the administrator in order to distinguish the instances.

This is the first report we have filed as users. Some fields are blank because no admin has solved our issue yet. Any user can be promoted to administrator and any administrator can be demoted to user. Obviously, the first administrator must be created using a direct mySQL command to the database.

An administrator can file reports and check out the status of his reports, just like the user, but he has some extra privileges, as you can see in the picture above. An admin can modify, at will, the information of any user, as well as promote, demote and delete any user in the database. He can also solve open reports through the “Manage Open Reports” option and monitor either the resolved or all the reports through their respective buttons.

Last but not least, the whole website is mobile phone friendly. The code adapts with the size of the screen. As you can see in the picture, the mobile version is just as good as its PC counterpart.

The code is available at my github repository. The only file missing is the server_conn.php, because it includes the login information to the server database.

]]>A few months ago, I wrote an article about a highpass filter and how it can be used for edge detection in Image Processing applications. Today, I present you an improved method to extract the edges of an image and a technique to modify the outcome in order to become more visual appealing.

When you look at a digital image, you see many little “pieces” of light close together which we call pixels. From a computer’s point of view, a pixel is nothing but 0s and 1s. The computer sends these binary numbers to the monitor and then they are being transformed to light waves with different wave lengths. In general, each pixel is the superposition of three binary numbers and each binary number is a gray level scale of Red, Blue or Green, because we can create *almost* any color from just these three colors. A gray level scale is the amount that each color contributes to the sum. In this post we transform the image from RGB to gray, so when we talk about “gray level scale” we mean that each pixel has one binary number associated with it and the smaller this number the darker the pixel. In addition, we will use 8 bit binary numbers, which means that our image matrices will have a maximum value of 255 and a minimum of 0.

I am sure that by now you have come up with many algorithms to detect the edge of an image (I know I had). All you have to do is find the areas where the pixels tend to have very different values. This is why the highpass filter of the previous post worked. Let me remind you the basic idea.

An image in MATLAB is a two dimensional matrix with values ranging from 0 to 255. We created another two dimensional matrix and we set each element to be equal with the difference of two elements along a row. To be more precise, let’s say our original image matrix is A. The final B image matrix is B=A(i,j+1)-A(i,j). Obviously, the image matrix B has one less column than A. This a very simple method to detect the edges of an image (just eight lines of code) but it’s far from perfect. Its main disadvantage is that it takes into account only one direction. The method we are going to analyze next uses four direction vectors.

The Sobel Operator is using the eight closest pixels of a pixel and averages the direction vectors. Take a look at the image above. If **e** was the center of your coordinate system and you wanted to go from **i** to **a**, then you would have to follow a vector of magnitude and direction . For the case where your starting point is **h** and your destination **b**, you have a vector of magnitude and direction and so on. These vectors are the directional derivatives. They show us how much our function is going to change if we move along these directions. Now, if we sum these four vectors and divide them by four we have the average gradient vector G. This is the Sobel Operator. The only thing left to do right know is apply it to our image and take the norm. Our new image matrix will have two rows and two columns less. It is now apparent why this method is superior to the one we described earlier. It takes into account every change that takes place in the neighborhood of a pixel.

The extra technique that can improve the quality of our results is called Thresholding. When we apply the Sobel Operator to the image of interest, we get an other gray scale image S. We now proceed to enhance the differences of our image in binary way. We find the element of our matrix which partitions our matrix to a certain magnitude percentage. This is our threshold value. I built a MATLAB function that does just that. It takes a matrix A and a value and outputs the element of A such that % of A’s elements are smaller than . The rest is straightforward. Every element of the S matrix, which is smaller than the threshold, is assigned the value 0. Otherwise, it becomes 255. You can see code and the new image below.

function [out] = percentage_intermedian(A,k) [x,y]=size(A); A=reshape(A,[1,x*y]); [z,w]=sort(A); out=A(w(floor(0.01*k*x*y)));

clear A=imread('superman.jpg'); B=rgb2gray(A); [x,y]=size(B); for k=2:1:x-1 for l=2:1:y-1 a=B(k-1,l-1); b=B(k-1,l); c=B(k-1,l+1); d=B(k,l-1); f=B(k,l+1); g=B(k+1,l-1); h=B(k+1,l); i=B(k+1,l+1); C(k,l)=norm([double(0.25*((c-g-a+i)/4+(f-d)/2)),double(0.25*((c-g+a-i)/4+(b-h)/2))]); end end threshold=percentage_intermedian(C,97); [x,y]=size(C); for k=1:1:x for l=1:1:y if C(k,l)>threshold C(k,l)=255; else C(k,l)=0; end end end image(C)

The old image…

… and the new one. Much better, isn’t it?

]]>

First of all, let us discuss a little bit about transistors. There are many kinds of transistors but, in general, they all fall under two main categories, Bipolar Junction Transistors (BJT) and Field Effect Transistors (FET). All transistors control one value using an other value (and by “value”, I mean current or voltage). Their main difference is how they do it. There are tons of sites, videos and books out there where you can learn about the workings of a transistor, so we will focus on the Enhancement Metal-Oxide Semiconductor FET because it is our workhorse.

In general, these devices either conduct current from source (S) to drain (D) for the p-channel transistor and from drain (D) to source (S) for the n-channel transistor or they don’t. The conduction depends on the gate (G) to source (S) voltage (VGS). The transistors are active (or ON, as we usually say) when |VGS|>|Vth|, where Vth is the threshold voltage of the transistor and we can assume it is a constant. The fourth pin is called the body (B) and is related to the body effect. It is not a concern for us and we will just connect it to the most positive (PMOS) or the most negative (NMOS) power supply.

Now that we learned a few things about transistors, let’s use them to design our first logic circuit, the NAND gate. We have designed and emulated everything through Cadence. A NAND gate implements the logic function AND followed by the logic function NOT. Perhaps, this choice comes as a surprise. Why not AND or NOT? The answer is simple. We can construct both AND and NOT using the NAND gate. Actually, we can construct *any* digital circuit having in our arsenal only NAND gates!

As you can see, it is a very simple implementation. You can see some additional parameters in the transistors. These are the width and length of the conduction channel. Bigger channel means more current can pass and we usually make PMOS transistors with bigger channels than NMOS transistors, because NMOS conducts better. If you are familiar with the basics of logic design, you know how we can build a NOT or an AND gate using what we have so far. For the rest of you, think about it for a minute before you move to the next paragraph.

Well, the NOT gate is obvious. Just short-circuit the NAND inputs. Now the AND gate is obvious, as well. Just connect NOT to the NAND output. I will not show every circuit in the main post, as I don’t want to ruin its layout. However, I will publish them under a spoiler tag.

Now that we have built every basic logic gate (NAND, NOT, NOR, 3 input NAND, AND, OR, XOR) we are going to implement some more advanced logic functions. Can you find out what the next circuit does?

I hope the top schematic didn’t give away the answer, because it is the well know symbol for the Multiplexer. The output Y is equal to I0, if S=0, and I1, if S=1. Now, if you can find what the next circuit does *without looking further*, you are really good!

Yeah! It’s a D Flip-flop! Here’s the full picture.

A Flip-flop stores one bit of information (0 or 1). The positive-edge-triggered D Flip-flop stores the logic value of its D input, when the CLK goes from 0 to 1. The Q pin is equal to its stored bit and the Q’ pin is the inverse of Q. R stands for Reset and sets the Flip-Flop to its original state.

Our final circuit, before we move on to the 4-bit counter, is the T Flip-flop. A positive-edge-triggered T Flip-flop stores one bit of information, just like the D Flip-Flop, but they operate differently. When the CLK goes from 0 to 1, the D Flip-Flop stores the value of tis D input. On the other hand, the T Flip-flop inverses its stored value if its T input is 1 and maintains its stored value if T=0. That may seem like a weird property for a Flip-flop but it is of high importance for our final design. We will use T Flip-flops to our final implementation and the only reason why we constructed D Flip-flops is to use them in order to make T Flip-flops.

OK, are you ready? Here it is!

Got pretty big, didn’t it? Its real world representation is even more scary because it contains 404 transistors. When I started building it, I underestimated the number of transistors I am going to need. I remind you that everything you see in this picture is made by the circuits we saw earlier in this post. And this is just a 4 bit counter. Now I realize why CPUs have billions of transistors and how important their miniaturization is.

But enough with the talk, let’s analyze. Why is this a 4-bit Up/Down Counter with Parallel Input? For the analysis, we omit the signals ENABLE, CLOCK and reset. Their function is obvious. Notice that the pin Count/Load defines our operation mode. For Count/Load=0 we have an Up/Down Counter and the circuit is getting simplified to this.

Notice that whether Up/Down is 0 or 1, the T input of the first flip flop is always 1. This is necessary because when you count the Least Significant Bit is always changing. If Up/Down=0, then the second column of AND gates is getting nullified. So, the input T of a flip flop is getting 1 only if all the previous inverse outputs are 1. For example, if A0=0 and A1=0, then A0’=1 and A1’=1. That means T2=1 and in the next clock period A2=A2′. That means Up/Down=0 starts a Down count. Of course, Up/Down=1 starts an Up count. In addition, if every flip flop is in 0 (1) state and the Up/Down pin is 0 (1), the counter resets itself to 1111 (0000).

When Count/Load=1, we get the circuit below.

I don’t think there is much to explain. A T Flip-flop connected with a XOR gate like that is a D Flip-flop. Remember that the output of a XOR gate is 0 if its inputs are equal and 1 otherwise. So, if the output of the T Flip-flop is the same with the input of the XOR gate, then the XOR gate will keep its T input low and the next clock will not change its content. But if the value stored in the T Flip-flop is different than the one we want to store in it, the XOR gate will set high the T input and the next clock will inverse its content. This is how the parallel input mechanism works.

]]>

Nowadays, an AM radio receiver is cheap, reliable and useless (let’s admit it, no one hears AM radio any more). Most of the times, it is incorporated along with an FM receiver, but that was not the case back then. Fifty years ago a radio receiver was not cheap or reliable and it was certainly not useless.

There are many ways you can receive and demodulate a radio signal. One of the earliest methods is called Tuned Radio Frequency receiver. Basically, it is an array of amplifiers that amplify the signal to a satisfiable level and then handle it to the demodulator to extract the information. Finally, the information signal is getting amplified by a low frequency (audio frequency) amplifier. There is one big advantage and many disadvantages associated with this method.

The advantage is the simplicity. All you have to do is take some amplifier blocks and connect them in series. One disadvantage is the poor selectivity, because the selectivity of the receiver depends on the Q of the tuned circuit. Another disadvantage is the number of active elements required. In addition, when you have a lot of transistors (or tubes) connected in series, noise is getting amplified and propagates through the receiver.

With the advent of semiconductor technology in the 60s, the TRF concept was revived. The number of the active elements is not an issue in integrated circuits and people want to build cheap and simple AM receivers. Companies like Ferranti introduced fully integrated TRF blocks in three-pin packages (TO-92). A good example is the TA7642.

As an amateur radio operator myself, I couldn’t resist the urge to build an AM receiver based on this little piece of technology. Looking at the datasheet I realised it wouldn’t be that hard. Most of the job is done for me and all I have to do is tune the early stage (find the correct AGC resistor) and install the audio frequency amplifier.

Finding the correct AGC resistor turned out to be tricky. Even if you use a potentiometer to find the correct resistance, most of the times that would be an absurd value with no standard resistance equivalent. In addition, the TA7642 output quality is very sensitive to the AGC resistor. The end stage is a typical AF amplifier using the LM386 power IC. You can see the final circuit below.

The L1 inductor and the C1 capacitor form the tuned circuit. The C1 capacitor is variable and covers the entire AM frequency band and the L1 inductor uses a ferrite core. The AGC resistor is denoted as R2. Here’s a video with my final circuit assembled on a piece of wood with nails acting as connecting points (Greek folk music!).

One last note, below is shown an example of the superior and more complicated superheterodyne receiver, just so we can appreciate a little bit of the obsolete TRF design.

]]>

My first idea was to go straight to the RF specialized books and hope that my (then) math and physics background (early undergrad computer engineering) would be sufficient. I couldn’t be wronger! From the first few pages the authors made crystal clear their demand for a comprehensive knowledge on **electrodynamics** and **analog circuit design**. In addition, after spending some time with the concept of communications, I realized that **signal processing** is just as important.

Tackling electrodynamics is easy, right? It is a 150 years old theory, you just grab one of the thousands books that have been written on this subject and start from there. And that is exactly what I did. I bought Introduction to Electrodynamics and I fell into the trap, again. Just like before, I assumed my math background was enough and the first introductory chapter about the math used for the rest of the book will do the job. That was a mistake. Vector Calculus is not a mathematical hard subject if you are familiar with the basics of Calculus, but it is intuitively challenging. You need to see many line and surface integral problems in order to master the whole concept. Calculus came to the rescue. It is a decent choice for an undergrad student who wants to make the leap from high school maths to college maths.

Signal Processing is the bridge between the real world and mathematics. There are a lot of great SP textbooks and, in my opinion, Signals and Systems is just superior. It covers every major topic of SP and it includes many exercises of all kind of levels. Even though it is an undergrad textbook, I wouldn’t be surprised if it was to be used in a postgrad program. Once again, just one textbook fails to cover the topic satisfactory. Firstly, with the advent of super small and fast microprocessors and ADCs, Digital Signal Processing is the industry’s new trend (yes, even for RF frequencies, see SDR) and, secondly, most of the signal processing applications deal with the issue of noise. That means we need probability theory. My favorite DSP textbook is Digital Signal Processing: Signals, Systems and Filters and, of course, the best book on probability theory and stochastic processes (for the last 50 years) is Probability, Random Variables and Stochastic Processes. Finally, the natural language of Signal Processing is Complex Analysis. That’s why we need a book for that, as well.

Analog circuit design is a rather difficult and specialized topic. I read Microelectronic Circuits and, even though I enjoyed it, it was not what I was looking for. This book is just an introduction to the field of analog electronics. The real deal is Analysis and Design of Analog Integrated Circuits. Guess what? That’s right! We need more textbooks in order to get deep enough. This book teaches great almost all of the techniques of analog circuit design, but it doesn’t explain well how the transistor actually works (the first chapter is devoted to that particular cause, but it is mostly copy paste of equations from the reference book). You will not really understand the physics and the mechanisms behind the operation of a transistor and, therefore, we need a textbook to fill the gap. I think Semiconductor Physics and Devices is good enough, except that what Analysis and Design of Analog Integrated Circuits is doing with the explanation of the transistor’s mechanics (copy paste of equations from other books and abrupt explanations) is what Semiconductor Physics and Devices is doing in their introductory chapter on Quantum Mechanics. That’s why I caught myself studying Introduction to Quantum Mechanics trying to understand why the “potential” function V is being treaty like it represents energy (Joules) instead of energy per charge (Joules/Coulomb) (it turns out its whole name, which is not mentioned in the textbook(!), is “potential energy function” and Griffiths is making an explicit statement about that fact). Finally, you need a book to actually get in microwave engineering (these days RF engineering implies frequencies of over 5 GHz) and this is greatly done by Microwave Engineering.

So, if someone wants to grasp RF Engineering he needs to study, at least, 10 textbooks! Even if they are to be covered in one semester, it will take years. And, of course, you are not a real RF Engineer yet, because you need real world experience with these systems and they are expensive and hard to use by an amateur. Now, compare these prerequisites with the prerequisites of a Software Engineer, for example. These people often don’t even need textbooks! But even if we must choose some, 4 textbooks are more than enough (Algorithms, Data Structures, some Programming Language and Discrete Mathematics). In addition, they don’t need any specialized equipment to check their work.

Three years after this crucial decision of mine, my journey so far can be accurately depicted by the following gif image.

]]>