# RC Filters by Stephen Bucaro

An RC filter can accept input sinewave signals and block certain bands of frquencies, thus allowing to pass only desired frquencies. There are many diffent kinds of filters, active filters use semiconductor components as part of their circuitry. Some filters use an inductor. This section describes passive RC filters. A passive RC filter uses only resistors and capacitors.

Filters are also classified as first-order, second-order, and so on depending upon the number of resistor - capacitor stages used in the filter.

The frequency at which a filter reduces the amplitude of the input signal to 70.7% of the input signal amplitude is clled the cut-off frequency (ƒc).

Low Pass Filter The low pass filter allows low frequency signals, up to its cut-off frequency, to pass, while reducing the ampltude of higher frequency signals.

A low pass filter works based upon the principle that, while the value of the resistor remains constant as the frequency changes, the reactance of the capacitor decreases with frequency. The input signal (Vin) is applied across the resistor and capacitor in series, while output signal (Vout) is taken across only the capacitor.

Since the input voltage is across the capacitor and resistor, and the sine wave voltage drop across the capacitor will be lower at higher frequencies, the voltage across the resistor will be higher a higher frequencies.

You may recall that in a series resistor circuit, we use the following equation to calculate the output voltage for a single resitor when two resistors are connected in series.

${V}_{\mathrm{out}}={V}_{\mathrm{in}}\frac{{R}_{1}}{{R}_{1}+{R}_{2}}$

However, in a series RC circuit, one of the resistances is actually the reactance of the capacitor. The capacitive reactance of a capacitor can be calculated with the following equation.

${X}_{c}=\frac{1}{2\pi fC}$

Note: The unit for capacitive reactance is the same as for resistors: ohm.

To calculate the amount of voltage across the frequency sensitive Xc of the capacitor, we have to use the frequency sensitive resistance restance across the entire circuit, called the impedance, the formula for which is below.

$Z=\sqrt{{R}^{2}+{{X}_{c}}^{2}}$

Now that we know Xc (capacitive reactance) and Z (impedance), we can calculate Vout with the simple formual shown below.

${\mathrm{Vout}}_{}=\mathrm{Vin}×\frac{{X}_{c}}{Z}$

Let's try an example using a 4700 ohm resistor and a 10 pF capacitor, with an input of 10 volts at 1000 Hz. If you find it tedius to use a calculator, and you know a little javascript the tiny script shown below will calculate Vout for you.

<script>
var f = 1000;
var Vin = 10;
var R = 4700;
var C = 10 * Math.pow(10, -9);

var Xc = 1/(2 * Math.PI * f * C);
var Z = Math.sqrt(Math.pow(R, 2) + Math.pow(Xc, 2));
var Vout = Vin * Xc/Z;

</script> Plotting the low pass filters output voltage at different input frequencies creates a frequency response curve, commomly called a Bode Plot of the low pass filter circuit as shown above.

Low frequency signals applied to the filter don't have much attenuation. When the frequency of the input signal increases to a value called the cut-off frequency, the output signal is attenuated to 0.707 of the input voltage. This is also known as the -3dB point. A db (decibel) is 1/10 of a unit called a "bell". A bell is a unit used to compare a signal to another signal using the logarithmic scale.

Since the circuit contains a capacitor, the Phase Angle (θ) of the output lags the input. At the -3dB cut-off frequency, the output is -45o out of phase.

Hight Pass Filter The high pass filter reduces the ampltude of low frequency signals, while allowing high frequency signals, below its cut-off frequency, to pass.

A high pass filter works based upon the principle that, the reactance of the capacitor decreases with frequency. while the resistance of the resistor remains constant as the frequency changes, The input signal (Vin) is applied across the capacitor and resistor in series, while output signal (Vout) is taken across only the resistor.

In this circuit configuration the reactance of the capacitor is very high at low frequencies so the capacitor acts like an open circuit and blocks any input signal until the cut-off frequency point is reached. Above the cut-off frequency, the reactance of the capacitor is reduced so as to now act like a short circuit allowing almostall all of the input signal to pass directly to the output.

The circuit calculations are the same for the high pass filter as they are for the low pass filter, the difference being that the output voltage is taken across the resistor, not the capacitor.

${\mathrm{Vout}}_{}=\mathrm{Vin}×\frac{Z}{{X}_{c}}$

Let's try an example using a 1000 ohm resistor and a 220 pF capacitor, with an input of 10 volts at 1000 Hz. here is a tiny javascript that will calculate Vout for you.

<script>
var f = 1000;
var Vin = 10;
var R = 1000;
var C = 220 * Math.pow(10, -9);

var Xc = 1/(2 * Math.PI * f * C);
var Z = Math.sqrt(Math.pow(R, 2) + Math.pow(Xc, 2));
var Vout = Vin * R/Z;

</script> Plotting the high pass filters output voltage at different input frequencies creates Bode Plot as shown above. The frequency response for a igh pass filter is the opposite of a low pass filter. The signal is attenuated or at low frequencies with the output increasing at frequencies abour the cut-off point, where the output voltage amplitude is .707 of the input signal voltage, or 3dB down from the input voltage.

Again, the circuit contains a capacitor so the Phase Angle (θ) of the output leads the input. At the -3dB cut-off frequency, the output is +45o out of phase.

Band Pass Filter The band pass filter blocks both low and high frequencies while allowing frequencies between those two points to pass through.

By cascading a high pass filter with a low pass Filter, we can produce a filter that passes a selected band of frequencies while attenuating all frequencies outside of this range. This type of filter is known as a Band Pass Filter. The green data points are the bode plot for a high pass RC filter. The red dots are the bode plot for a low pass RC filter. If the input signal is applied to the high pass filter and the output of the high pass filter is applied to the low pass filter, the output of the combined filters is the blue bode plot.

You can see that low frequencies are attenuated and high frequencies are attenuated, while a band of frequencies between those two is allowed to pass. Unlike a low pass filter which passes only low frequency signals, or a high pass filter which passes only signals of a high frequency range, a Band Pass Filter passes signals within a "band" or range of frequencies.

The band the frequency range that exists between two frequency cut-off points that are each 3dB below the maximum input, while attenuating frequencies outside of these two points.

The frequency response curve or Bode Plot shown above shows the characteristics of the band pass filter. The signal is attenuated at low frequencies until the frequency reaches the lower cut-off point fL. At this frequency the output voltage is 70.7% of the input voltage. The signal continues near full volume until it reaches the upper cut-off point fH. A band pass filter is called a second-order or two-pole filter because it has two reactive components within its circuit structure.

The lower and upper cut-off frequencies for a band pass filter are found using the same formula as for the low or high pass filters.

$\mathrm{Fc}=\frac{1}{2\pi RC}$ Hz

Shown below is the JavaScript code used to produce the Band Pass Filter bode plot

```<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<body>

<canvas width="700" height="500" style="border:1px solid #000000;">
</canvas>

<script>

// frequency range
var fLow = 100;
var fHigh = 8000;

var Vin = 200;

const canvas = document.querySelector("canvas");
const ctx = canvas.getContext("2d");
ctx.transform(1, 0, 0, -1, 0, canvas.height);
ctx.font = "12px verdana";

// vertical lines - frequencies
var fp_px = canvas.width / fHigh;
var xinc = fp_px * 500;
var finc = 500;
for(f = 0; f < canvas.width; f += xinc)
{
ctx.beginPath();
ctx.moveTo(f, 0);

ctx.save();
ctx.scale(1, -1);

// Text Added at the origin of the newly transformed canvas
ctx.textAlign = 'start';
ctx.strokeText(Math.round(f * 20), f, 0);

// Context restored back
ctx.restore();

ctx.lineTo(f, canvas.height);
ctx.stroke();
}

// horizontal lines - voltages
var yinc = canvas.height / 10;
for(y = yinc; y < canvas.height; y += yinc )
{
ctx.beginPath();
ctx.moveTo(0, y);

ctx.save();
ctx.transform(1, 0, 0, -1, 0, canvas.height);
ctx.strokeText(y/4, 0, canvas.height-y);
ctx.restore();

ctx.lineTo(canvas.width, y);
ctx.stroke();
}

// lowpass filter
function calcL(f)
{
// var Vin = 100;
var R = 10000;
var C = 0.01 * Math.pow(10, -6);

var w = 2 * Math.PI * f;     // This w omega
var Xc = 1/(w * C);
// Z of entire circuit
var Z = Math.sqrt(Math.pow(R, 2) + Math.pow(Xc, 2));
var AL = Xc/Z;
return(Vin * AL);
}

// highpass filter
function calcH(f)
{
// var Vin = 100;
var R = 10000;
var C = 10 * Math.pow(10, -9);

var w = 2 * Math.PI * f;
var Xc = 1/(w * C);
var Z = Math.sqrt(Math.pow(R, 2) + Math.pow(Xc, 2));
AH = R/Z;
return (Vin * AH);
}

// calcL using calcH as Vin
function calcBP(f)
{
var Vin = calcH(f);
var R = 10000;
// var C = 0.01 * Math.pow(10, -6);
var C = 10 * Math.pow(10, -9);

var w = 2 * Math.PI * f;     // This w omega
var Xc = 1/(w * C);
// Z of entire circuit
var Z = Math.sqrt(Math.pow(R, 2) + Math.pow(Xc, 2));
var ABP = Xc/Z;
return(Vin * ABP);
}

// plot dots
for(f = fLow; f < fHigh; f += 200)
{
var VoutL = calcL(f);
var VoutH = calcH(f);
var VoutBP = calcBP(f);

ctx.strokeStyle = "#FF0000";
ctx.beginPath();
ctx.arc(f/20, VoutL * 2, 4, 0, 2 * Math.PI);
ctx.stroke();

ctx.strokeStyle = "#00FF00";
ctx.beginPath();
ctx.arc(f/20, VoutH * 2, 4, 0, 2 * Math.PI);
ctx.stroke();

ctx.strokeStyle = "#0000FF";
ctx.beginPath();
ctx.arc(f/20, VoutBP * 4, 4, 0, 2 * Math.PI);
ctx.stroke();

}
</script>

</body>
</html>
``` 