I thought it would be fun to quantify just how good of a Sine Wave this circuit was; after all it was just a wave-shaped triangle wave, so I wasn't expecting too much. But if I quantify how good of a sine wave it is I can tweak the circuit to try and make if better.
Since my Sine Wave is at 1KHz I thought I'd measure its quality using an audio Total Harmonic Distortion (THD) technique.
What we need to do is design a Notch filter at 1KHz. This will remove the fundamental frequency and leave the Harmonic content. Below is an LTSPICE schematic of Sine Wave Generator and Notch Filter.
The next picture is the frequency response of the notch filter; you can see it is centered at 1KHz.
When the 1KHz signal is passed through the 1KHz centered notch filter the fundemental frequency is removed and what is left is the Harmonic content. You can see the 3rd harmonic at ~3KHz is what is left.
(The blue is the signal coming out of the Filter)
Below is the FFT of the input Sine Wave and the Output of the Notch Filter; you can see the fundamental frequency amplitude is lower with minimal effect on the harmonic content.
Now that I had a base line simulation working I grabbed my soldering iron and built up the 1KHz Notch Filter dead bug style in an Altoids box. I wish I had a Network Analyzer or at minimum a Spectrum Analyzer with a tracking output to measure my filters frequency response, but all I had was a function generator and a scope. I swept the function generator's output frequency from 10Hz to 100KHz and could see that my filter worked well at filtering out 1KHz signals.
(Channel A = Input Signal, Channel B = Output of Notch Filter)The output of the Sine Wave generator measured 2.25Vrms and the output of the Notch filter was 139mVrms. This gives me a THD of (139mV/2.25V) = 6%
I wanted a second opinion, so I grabbed a HP 331A Distortion Analyzer and set it up. I hadn't used one of these since I interned at an RF Radio Manufacturer back in 2002. I used it to measure receiver sensitivity performance.
I had to dig up a manual to remember how to setup the HP 331A. It is a bit confusing because you have to setup the meter to 100% full scale based on your input, then adjust the frequency & balance adjustments until you get the lowest % THD reading. I monitored the Output of the 331A with a scope to see that I had fully removed the 1KHz fundamental and all that was left was a dirty looking 3KHz waveform (3rd harmonic).
Below is a scope screen shot of the output of my notch filter (top) and the output of the HP 331A (bottom).
Update: Sept. 13th, 2011
I thought I would do one last test to see the performance of the Notch Filter on a much cleaner sine wave. I used a BK Precision 3011B to generate an identical (but much cleaner) 1KHz 6Vp-p Sine Wave and used the Notch Filter to measure its THD.
(Top = Input Sine Wave, Bottom = Output of Notch Filter)The THD measured was (19.5mVrms / 2.25Vrms) = 0.86%, a much cleaner Sine Wave than my home brewed one at 6%.
Here are Links to my LTSPICE files: Sine_&_Filter, Filter, and Filter_ac.
Link to HP 331A Manual.
Distortion Analyzer by Rod Elliott
HP Journal: Distortion Analyzer
Texas Instruments Notch Filter AppNote