Function generator to test filter capacitors

I'd like to be able to see the effect that a filtering capacitor has on a voltage source with waves at different frequencies, for learning purposes. I'd like to try to calculate the correct capacitor for a specific wave / frequency, and be able to test it was well.

I was wondering if a function generator connected to a circuit with the capacitor would work for this purpose. I already have an oscilloscope for visualizing the voltage graph.

Also, is there anything I should take into consideration when picking a function generator to buy?

• Function generators often provide 50 ohm, ttl, and cmos outputs. Broadly speaking, those aren't designed to drive high-capacitance filter capacitors. You may need small test circuits you design from time to time for various purposes. – jonk Aug 17 '16 at 19:15

It really depends on the value that your trying to measure and to what accuracy you are trying to measure it. Realize that you are going to have noise in your system and probably the biggest limiting factor will be the resolution of your scope. Buy the function generator with a range based on the desired frequency below.

Here is a great article on how to measure capacitance or inductance. In short you are measuring the reluctance of the circuit.

If you know some algebra and want to use this method for capacitors instead of indicators it works well. You pick a point say 1/2 of your input voltage and then solve the equations for that. I usually do a sweep and then fit the entire equation to a curve so I have multiple points that average but only one point should suffice. $$\left|\frac{Vscope}{Vgen} \right|= \left|\frac{\frac{j\omega}{C}}{R+\frac{j\omega}{C}} \right| = \left|\frac{\omega^2}{(RC)^2+\omega^2} +j\frac{RC\omega}{(RC)^2+\omega^2} \right| = ...= \frac{\omega }{\sqrt{(CR)^2+\omega^2}}$$

And then solving for $\omega$ which is $2\pi f$ with R = 50

$$\frac{1}{2}=\frac{\omega }{\sqrt{(CR)^2+\omega^2}} \Rightarrow C=\frac{\omega\sqrt{3} }{R}$$

Here is the circuit for reference

simulate this circuit – Schematic created using CircuitLab

• Note that if the test protocol can accept a 1K$\Omega$ resistor, than you're off by 5% and ignore the 50$\Omega$. 0.5% if you can do 10K – Scott Seidman Aug 17 '16 at 20:42
• Yeah, I've never tried it with 50Ohms or capacitors, just large inductors but more resistance will be better – Voltage Spike Aug 17 '16 at 20:56
• My point is that the 50 ohms keeps appearing because that's OFTEN, but not ALWAYS, on the output of a function generator, and you can design a test circuit such that it doesn't care whether its there or not. – Scott Seidman Aug 17 '16 at 21:04

If your budget can handle around \$300, I can personally vouch for the Digilent Analog Discovery 2. In my opinion, it is a must have for any electronics enthusiast. Its combination of voltage source/function generator/oscilloscope and well designed/documented software allow it to do exactly what you described. It sounds like "the effect that a filtering capacitor has on a voltage source with waves at different frequencies" is describing the Digilent Analog Discovery 2's network analyzer function. It also has a bunch of other functions like impedance analyzer, FFT, spectrum analyzer, digital pattern generator/analyzer, and much more. Their website/software instructs you how to set up each function in a pretty straight forward and easy manner.

I would use something like Baudline. It has a signal generator, and can do a cross FFT. It only runs under Linux, though.

You need 2 cables with 1/8 inch headphone plugs. One of the cables goes to the line out on your PC, the other goes to line in.

Like this:

simulate this circuit – Schematic created using CircuitLab

This sets things up so you can do a spectrum analysis of the output of the filter (junction R1 and C1.)

You use the cross FFT, and set Line In Left to be the reference.

The cross FFT then calculates the difference between the spectrums on Line In Left and Line In Right.

Use the noise generator, and averaging to get a smooth plot. Don't use chirp. I don't think it is synchronized with the sampling, which will cause problems with the windowing.

It will generate a magnitude plot much like the magnitude plote of the Bode diagram on this filter calculator. The difference being that it uses your real filter instead of a simulated one.

You can then change values for R1 and C1 for different low pass filters, or swap R1 and C1 positions to play with high pass filters.

You can do the same with active filters, but then you may need to use a voltage divider to bring the output signal down to something that the PC sound card can use.

You use the cross FFT and two inputs to automaticall account for the frequency response of the soundcard outputs and inputs. Different loading of the output can cause the frequency response to change or to be distorted. The two connection method I've outlined accounts for that automatically.

The one catch to this method is that you may have to swap left and right. They aren't always the way you expect them to be. If you hook it all up, and the response is upside down, then swap the input channels. You can do it in the software or by changing the physical channels.

If you need detailed instructions, let me know and I'll write them up. I don't have Baudline at hand right now.

Baudline also includes a function generator, so you could send various types of signals at differing frequencies through your filter and observe the effects on your oscilloscope.

I'm sure there are Windows programs that can do the same. I use Linux, though, and Baudline is an old friend.

If you go looking for a comparable Windows program, look for one that includes a signal generator and that can do cross FFTs.