Square Waves

Created on 2009-09-26 14:56:00

Square waves are useful because they can reveal many things about the frequency and phase response of a system with just visual analysis. This can be valuable when doing a quick system check, or when doing an A/B comparison while changing settings or components. The following graphs highlight just some of the things that a square wave can show:

Generation

What’s a theoretically perfect square wave made of? It contains a sine wave fundamental, and all its odd harmonics. The amplitude of each harmonic is 1/n, so the amplitude of the fifth harmonic, for example, would be 1/5 the amplitude of the fundamental. But making a perfect square wave isn’t easy.

Let’s look at a frequency domain view of a square wave produced by a high quality 15 MHz function generator. This function generator is a good choice for many applications, but not for audio, where the extremely high dynamic range (about 144 dB for 24-bit) requires the purest signal possible.

Most engineers are used to looking at square waves only in the time domain, but the frequency domain view provides additional diagnostic ability about the quality of a square wave, both before and after it has passed through a DUT (device under test).

Square wave created by a function generator, frequency domain view.

Notice how smoothly the odd harmonics diminish. That’s good. But also notice how high the even harmonics are—only about 60dB below the fundamental. A perfect square wave would have no even harmonics. At 1 MHz, the even harmonics are only about 12 dB below the desirable odd harmonics, which means that real information about the DUT may easily be obscured by distortion in the square wave test signal. Notice also that there are intermodulation products 90 dB or so below the fundamental, again potentially hiding problems in the DUT.

Here’s a square wave generated by AP’s AG52 option:

Square wave created by an APx525 analyzer with the AG52 option, frequency domain.

This is the best square wave produced by any audio analyzer in the world.

The even harmonics are now 110 dB to 120 dB below the fundamental. At 1 MHz, the even harmonics are still 50 dB below the desirable odd harmonics. Intermodulation products and noise are now down at least 130 dB below the fundamental. All of which give us much greater clarity to detect and analyze defects caused by the DUT.

Analysis

The BW52 complements the high performance of the AG52 square wave. Its 1 MHz bandwidth keeps the square wave perfectly square, so that we can be sure any defects seen are in the DUT, and aren’t artifacts of the analyzer itself. The 1 million point FFT and 24-bit A/D conversion allow extremely detailed analysis unobscured by noise.

Now, let’s use the AG52/BW52 combination to look at the time and frequency domain displays of a signal passing through a popular home theatre surround sound amplifier.

Square wave after passing through a home theatre receiver, time domain.

That is not a good looking square wave!

Square wave after passing through a home theatre receiver, frequency domain.

A view of the frequency domain graph reveals what’s going on inside the DUT—there’s a sharp cut-off in the response near the Nyquist frequency of the on-board DSP, and then a sharp rise in noise caused by the sigma-delta type converters.

Let’s look at another audio test where a high purity square wave is required for accurate results. DIM (Dynamic Intermodulation Distortion) uses a combined square wave / sine wave stimulus to reveal slew-induced distortion—distortion caused when an amplifier can not increase or decrease its output voltage fast enough to follow its input. Rarely a problem in modern op amps, DIM can still be an issue in the design of high wattage power amplifiers due to the large voltage swings they must produce.

DIM Level Sweep measurement (ratio vs. measured level).

Conclusion

Many audio analyzers generate a square wave with inadequate bandwidth and visible ringing. Coupled with an FFT analyzer limited in bandwidth and resolution, they can only perform the most rudimentary square wave analysis. In this article we’ve tried to show the powerful analysis ability made possible using a high quality square wave generator with a wide bandwidth, high resolution, and long sample length FFT.