Thursday, September 08, 2022

Clean 20 MHz Square Wave

Using the 5 times frequency rule, one can measure the wave accurately on an oscilloscope only if the scope's BW is at least 5 times the frequency of the wave. My old analog oscilloscope had a bandwidth of 20 MHz and therefore could not accurately display a square wave higher than 4 MHz in frequency. Recently I bought a new digital oscilloscope with BW Of 100 MHz, which meant it could accurately display a 20 MHz square wave. For that purpose I needed to generate a clean 20 MHz square wave to test my new 100 MHz digital oscilloscope.
I found this circuit on the right that utilized a 20 MHz crystal oscillator and a hex inverter IC. I built that circuit on a perfboard as shown below, and instead of the 40106 IC I used two other ICs that both worked fine: one was 74HC04N and the other one was 74HC14. difference between the two is that the 74HC04N inverters are also Schmitt triggers, whereas the 74HC14 they were regular inverters. Like I said both of them worked fine with no noticeable difference.
The picture above shows the front and back of the perfboard assembly. I used a 50 ohm SMA connector so that I can connect to the oscilloscope using a 50 ohm coaxial cable instead of a high impedance probe to minimize reflections.
But first I wanted to look at the square wave without using the SMA connector by probing directly on pin 3 of the IC which is the output of the circuit. The two pictures above show the probed waveform for the 74HC04N IC (on the left) and the 74HC14N (on the right). They are not bad and show a rise time of 2.8 and 3.8 ns respectively. However the square wave shows some reflections that distort its shape. I decided to go with the 74HC14N IC. I used the Math function in the scope to do FFT on the time domain signal to see its harmonic content. I also saved the time domain signal in CVS format and performed FFT on the signal myself on the computer using a Python program that I wrote which reads the Excel file and plots the FFT it performs on the data.
As expected the frequency content of the square wave consists of the fundamental at 20 MHz, and the odd harmonics. The third harmonic is supposed to be at about -9.8 dBc relative to the fundamental which is close as seen in the picture. The fifth harmonic is supposed to be at -14.5 dBc from the fundamental which is also close, but as you see the higher order harmonics are not consistent.
The calculated FFT from the CVS data file is shown to the right, and as expected it shows a fundamental at 20 MHz, third harmonc at about -9.5 dBc from the fundamental and a fifth harmonic at about -14.5 dBc from the fundamental as the oscilloscope measured. I limited the FFT components to 140 MHz in the plot but they go higher of course.
I tried to clean the waveform by filtering the signal using a 100 MHz filter (the purple curve above left) and 50 MHz filter (the purple curve above right). Of course the filter gets rid of some details but that did not fix the shape of the waveform itself, just the reflection details. So next I took the signal out of the SMA connector and into the oscilloscope using a 50 ohm coaxial cable instead of the probe.
I had to purchase a 50 ohm adapter because the oscilloscope did not have a 50 ohm input setting. You can see the adapter connected to the second BNC connector of the oscilloscope (CH 2). You can also see that now the square wave is much better and cleaner than before.
The clean square wave is shown above on the left, and the FFT content is shown above on the right. As expected the third harmonic is again is at -9.5 dBc from the fundamental and the fifth harmonic is at -14.5 dBc as before, but you can also notice the higher order harmonics keep going down as they should instead of the inconsistent behavior we saw before from the p robed waveform. So I was happy with this result and I verfied that my generated square waveform is indeed clean with a rise and fall times of 3 and 2.2 ns respectively. I also verfied the operation of my new 100 MHz digital oscilloscope which measured the 20 MHz square wave properly as it should.

No comments: