Rediscovering the RC filter

12 diciembre 2012

In this experiment, we are using openDAQ to test the simplest first order low-pass filter: a RC network filter.

Passive filters are made up of passive components such as resistors, capacitors and inductors and have no amplifying elements (transistors, op-amps, etc). They have no signal gain, so therefore their output level is always less than the input.

In low frequency applications (up to 100kHz), passive filters are generally constructed using simple RC (Resistor-Capacitor) networks, while higher frequency filters (above 100kHz) are usually made from RLC (Resistor-Inductor-Capacitor) components.  Band-pass filters and band-stop filters usually require RLC filters, although very simple ones can be made with RC filters.

To build a first order passive RC filter we just have to put a capacitor and a resistor in series. The capacitor will charge and discharge its stored energy through the resistor. Depending on which way around we connect the resistor and the capacitor with regards to the output signal determines the type of filter construction resulting in either a Low Pass Filter or a High Pass Filter. For this experiment we have made a low-pass filter, the schematic can be seen in this figure: 

The voltage across the capacitor, which is time dependent, can be found by using Kirchhoff's current law, where the current through the capacitor must equal the current through the resistor. This results in the linear differential equation:


where V0 is the capacitor voltage at time t = 0.  We can calculate the cut-off frequency of a RC filter, ƒc, as:

Thus, altering any one of the values of the two components alters this cut-off frequency point by either increasing it or decreasing it.

The Low Pass Filter has an almost constant output response from D.C. (0Hz), up to the cut-off frequency point. The nominal cut-off frequency of a filter is the point where Vout=0.707*Vin, or in other words, the filter has an attenuation of -3dB (dB = -20log Vout/Vin ).

The phase shift of a circuit lags behind that of the input signal due to the time required to charge and then discharge the capacitor as the sine wave changes. The phase shift of a first order filter is 45º at the cut-off frequency.

With a sinusoidal input signal that changes smoothly over time, the low-pass filters behave in a way that almost no change between input and output signals until almost reaching the cut-off frequency. Around that frequency, and after it, the output signal shows an increasing degree of attenuation and phase shift from the input signal.

But, what if we want to change the input signal to that of a "square wave" shaped ON/OFF type signal that has an almost vertical step input, what would happen to our filter circuit now?

With a square wave input, the output response of the circuit will change dramatically, due to the high frequency components of that type of signals. This will produce another type of circuit known commonly as an Integrator.

A RC Integrator is basically a low pass filter circuit operating in the time domain that converts a square wave "step" response input signal into a triangular shaped waveform output as the capacitor charges and discharges. A Triangular waveform consists of alternate positive and negative ramps. If the RC time constant is long compared to the time period of the input waveform the resultant output waveform will be triangular in shape and the higher the input frequency the lower will be the output amplitude compared to that of the input.

For this example we have used a 10KΩ potentiometer along with an electrolytic capacitor of 33µF. We have connected the output of the DAC of openDAQ to the potentiometer, and used the Stream-out utility to generate a square wave signal, with 800ms of period and 200mV of amplitude. We have selected that period in order to get enough resolution with openDAQ to see more clearly the signals in the circuit.

We have used two analog inputs to read both input and output signals in the filter. In the figure below, input square signal is sampled and painted in red, while output filtered signal has green color.

Modifying the value of the potentiometer with the help of a screwdriver, it is easy to see how the frequency response of the filter modifies the output signal. In a short range of R values, you will see how the output signal changes from just following the input square wave to be converted into a triangular wave with the same frequency of the square wave but attenuated. In the figure below you can see a R value in the middle of the process, where the output is being attenuated but has not been converted yet into a triangular shape.