Square Wave Testing of Audio Products is a video.
Squarewave testing can be used to test many things at once, but you have to know what to look for.The article explains the different types of signals you can get from an amplifier or filter.A squarewave is a signal that's symmetrical and has odd Harmonics, 1st, 3rd, 5th, etc.It isn't always possible to have a perfect square wave.The response capability of an audio amplifier isn't the only thing that can be exceeded by most common squarewave generators.
It's possible to see a wide range of potential problems, but you need to be able to determine what really is a problem and what is normal behavior.This article has a lot of diagrams.The original squarewave will not be shown in most of these.After processing through an amplifier or a filter, we can see the essential characteristics of the device under test.
If you haven't done any squarewave testing, I encourage you to hook up a few circuits so you can experiment.This is a great way to learn how a squarewave can be modified by filters and tone control circuits.
The examples are subtle.In many cases, the square wave response is much greater than shown in the diagrams.That doesn't mean a fault, it simply means that the circuit has more of what the examples show.You have to learn how to interpret the results if you want to get more treble cut or boost.
It's worth noting that a triangle wave has the same characteristics as a square wave.They have a different phase relationship from the fundamental.The appropriate sequence and phase can be used to synthesise any waveform that exists.The only difference between the two is the phase angle of the harmonics.You can see the progression using FFT, but it doesn't include phase information.
It's useful to see the squarewave before we look at the modifications.The simulation used a square wave with fast rise and fall times.You won't get real square waves from this generator.A bandwidth well in excess of 1 GHz is not desirable for amplifier testing.
There isn't much that's remarkable about a squarewave.Positive and negative half cycles are equal in duration and amplitude according to the mark-space ratio.The peak value of a squarewave is the same as the 1VRMS shown in the picture.
The spectrum shows that there is a continuous band of frequencies.I only showed harmonics up to 160kHz because there was no point in showing more.The formula can be used to calculate the A'n' of each Harmonic.
If the squarewave is 2V peak-peak, the 1st, 3rd, and 5th are all at 1.273V.It is a useful background for you to use if you ever need it.I wouldn't worry about trying to remember the formula because most of the time you'll never use this info.The spectrum will show you that the voltages are the same.It's important to understand that a 'true' square wave has no order and is perfectly symmetrical.The positive and negative portions of the squarewave are not symmetrical, if there is any evidence of even order distortion.
It is time to look at something that is very interesting.The amplitude sequence shown above is used to create Figure 1C.The waveform has a fundamental Frequency of 1kHz and a number of Frequency and Frequency Intervals.There is something very strange that you need to be aware of, even though you can see the square wave starting to take shape.It's not obvious, but the 'ripple' at the top and bottom of the signal is 14 kilohertz.There are seven peaks with seven generators, which is the same number as the number of sine wave generators.The number eight means eight peaks.
There's a mathematical formula that explains how a seemingly unrelated 'frequency' is developed in this way, but I don't intend to show it here.If you really want to know more, there's plenty of information online.The point is that it's real, and it will show up in a simulation or an oscilloscope.With traditional test gear it will be almost impossible to duplicate, but a simulator is blessed with 'ideal' sine generators, which never drift in frequency and have zero distortion.There is a CD player squarewave response that looks almost identical to the one shown in Figure 1C, but with more 'ripples'.This is due to a higher cutoff Frequency.An analogue or digital IIR will only show ringing at the leading edge, with no ringing on the trailing edge.
The effect seen is not real.Even though it can be seen in a simulation, the apparent Frequency doesn't exist.You can look it up for yourself.The ripples never go away if you combine as many oscillators as you can.You just have to accept that a 'proper' squarewave is flat-topped, and has no ripples.
The interval between peaks, dips, and zero crossings is 71.42s.The waveform starts to look like a square wave as more and more harmonics are added.You'll see a similar wave start to emerge if a true square wave is filters with a sharp low-pass filter.Don't expect to see it with a practical analogue filter, but a digitalFIR can produce something close.The ripple frequency increases to 16.19kHz if we add another generator.The 12 cycle period is divided by the number of peaks.So...
This is closer to reality than using a simulation.This Frequency is not a Harmonic, as it is even, and we used only odd Harmonics to build the Square Wave.It doesn't appear to be a Frequency in a fast Fourier transform.The wave will eventually look like a square wave with enough generators.That means you need a lot of generators.The peak at the rising and falling edges will be infinitely narrow if there is an infinite number of sine waves.The peaks and ripples that are generated by a simple analogue or digital circuit are not real.The appearance of something that doesn't exist may be confronting.
I thought the above was interesting, but it's little or no practical use.It has nothing to do with squarewave testing, but knowing that a square wave is made up from an infinite number of waves will help you understand why it is so revealing.IIR digital filters, which are the digital equivalents of analogue circuits, can't recreate the Gibb's phenomenon.I've tried increasing the slope with a 12th order filter and it doesn't help.).
The leading edge of a square wave has a high slew rate.The slew rate is 2,000V/s because the voltage changes from -1V to +V in 1ns.The most common way to specify slew rate is by volts/microsecond.The output can swing in one microsecond.The majority of audio opamps are around 8-12V/s.
As the allowable output voltage swing increases, so does the slew rate.The slew rate is determined by the following.
For an amplifier that can provide a peak output of 35V, the slew rate is 20kHz.
The leading and trailing edges will no longer be vertical if the input is significantly faster than the amplifier stage.If you're not careful, a squarewave test can end up with an entirely wrong answer.The very fast risetime of the test signal was the reason for the brouhaha.When testing any audio device, be aware of the fact that music does not have very fast risetime signals and most media do.They are not very demanding.The musical harmonics' amplitude is reduced by at least 6dB/octave from no higher than 2kHz.The actual level at 20kHz will be 20dB lower than at the midrange frequencies.
When operating just below full power with music as the input, an amplifier that can provide 35V peaks will only be required.It's very common to make sure that an amplifier can reproduce no less than 50% output voltage at 20kHz to ensure an acceptable safety margin.TIM may have been discredited, but it doesn't make sense to limit an amplifier if it's not needed.It makes sense to design an amplifier that can reproduce full power, but it will never be needed.
A band-limited squarewave can be handled by most competent amplifiers.If you want to use the squarewave, you need to pass it through a filter that rolls off the response above 20kHz.The amplifier won't be hurt by failure to use bandwidth limiting.A low-pass filter using a 1k Resistor and 10nF Capacitor gives a response that's considerably faster than the music, but doesn't stress the amplifier too much.The nominal Frequency of the filter is 15.9%.The function generator has a risetime of 12ns, which is too fast for an amplifier, so a filter is needed.
The square wave seen in Figure 1A has a 1k + 10nF Capacitor arranged as a low pass filter.Only four complete cycles are shown in the waveform.Where possible the same vertical scale will be used as well for all subsequent waveforms.The risetime is increased when you see the result of a low pass filter.The effect becomes more obvious when the input frequencies approach the filter's frequencies.We'll look at high frequency boost in the next section, but equally obvious is any circuit that applies it.
The risetime is usually between 10% and 90% of the peak-to-peak amplitude.The reason for this is simple, in that many circuits will have some small 'disturbance' as the voltage starts to change and just before it reaches the opposite peak voltage.The true risetime can be determined more accurately if the fist and last 10% are excluded.
You can determine the approximate Frequency if you know the risetime.We can use the formula [ 1 ] because the low pass filter shown above has a risetime of 22us.
If the signal is amplified through the DUT then the slew rate at the output will be much higher.If it makes you feel better, you can use a higher order filter.You might want to use a 24dB/octave filter.The slight decrease in risetime will be offset by a slight overshoot of the leading edge.
Figure 2 shows a gentle bandwidth limiting, but if there is significant high frequencies the squarewave loses most of its character.The filter uses a 100nF cap and a 1k Resistor.The squarewave is rounded off at 1.59kHz.
It is easy to see high frequencies when you look at the wave shape with a square wave input.The very rounded waveform shown is due to the fact that all the Harmonics are reduced by the filter.In the next graph, we can see if there is a high frequency boost.The leading edge of the waveform extends beyond the steady state value.Overshoot can be caused by filters with high rates of attenuation and doesn't always indicate a boost.You need to know how to interpret the results.
If you are testing tone controls, you should be able to get treble boost and cut, and the response should smoothly transition between them as the pot is rotating.You will hear the change easily if you listen to the result.
The input for this was the same as in Figure 2, with a band limiting filter of 1k and 10nF at the input.A simple opamp circuit is used to process the signal.You might expect the two to cancel out, but because the cut and boost circuits are not perfectly symmetrical we see a small amount of treble boost.There is 1.34dB of boost at 12kHz shown in the waveform.You can see if there's a boost or rolloff by looking at the squarewave response.This effect can be seen at the output of a Class-D amplifier where the impedance isn't perfect.
It's easy to miss ringing if you only do a frequency response measurement.It can be missed if you don't notice it in the response.You can instantly see things if you test with a squarewave.The band limited squarewave shown in Figure 2 will make the effects more apparent if the risetime is faster.If the circuit has its own bandwidth limitations, what you see will be a combination of everything that affects the response.
There is a circuit within the DUT.The duration of the ringing will give you an idea of how long the oscillation will last.Chebychev types which have a peak before they roll off can cause damped ringing.The natural resonance of the transformer causes valve output transformers to ring.It usually doesn't cause any problems if the ringing is above the audio band, but it should always be checked to make sure the effects are not audible.
There is something odd about ringing.When checked with a square wave, it will show that the ringing is not related to the fundamental.You can vary the input frequencies, but the ringing looks like it's dependent on the resonant frequencies.If the ringing frequency is unrelated to the input, it means that a new frequency has been created.A simple passive circuit can't create a new Frequency.
If the input squarewave is at 1kHz, the frequencies are just 2kHz apart.It is almost impossible to measure ringing at 12kHz accurately with any standard test equipment.The closest to the input signal is what causes the ringing.The ringing frequency is not fixed, but it varies slightly as the input Frequency is altered, according to a close examination with a simulation.
The time domain can't be used to make sense of this.You can see a peak or a notch around the resonance if you use a FFT.As seen in the time domain, the waveform is a kind of real, but only tells part of the story.An oscilloscope doesn't have the accuracy and resolution to see what's really happening.The ringing waveform is in a similar category to the one shown in Figure 1C when you start building a square wave.
Squarewaves show you what happens with low frequencies.The amount of slope is an indicator that bass frequencies are either boosted or cut.It's important to make sure that the slope on the positive and negative parts of the waveform are not different.This usually means that something is wrong.You are more likely to see asymmetrical waveforms with valve Amps than with transistors or opamps.
There is a phase shift if the top and bottom parts of the squarewave are tilted.All cases of reduced or boosted bass response are accompanied by phase shift, so the tilt can be seen as an indicator of bass boost or cut.It is possible to phase shift without response changes.The rising slope is always a sign that there is a bass boost.It's possible for phase shift alone to cause this, but I've never seen it in a working circuit.
In this case, the bass cut is moderate, with a -3dB Frequency.The input squarewave is the same as before.The leading edges of the waveform are sloping down.The slope is exaggerated if the bass cut is made much more severe.Figure 7 has a bass cut Frequency of 1.59kHz.The waveform is what you expect from a differentiating factor.
The flat section of the squarewave will rise if the bass is boosted.The bass is boosted so that the maximum boost is 6dB at a low Frequency.It doesn't take long for anyone with a squarewave generator, oscilloscope, and a set of bass and treble controls to see the interactions that are possible when more bass boost causes the angle of slope to increase.
In every case where the response is changed, so are the amplitudes.The relative phase that influences the shape of the waveform is what causes it to change.This is true of bass boost and cut.It's possible to change the wave shape below the fundamental frequencies, but it shouldn't be possible.
One of the benefits of squarewave tests is that you can see variations both above and below the fundamental frequencies, something that isn't possible with sine wave testing.If you want to see the effect of a 20Hz sine wave, you have to use it.The effect of boost or cut frequencies can be seen below the test frequencies.A squarewave is unique in that they are a useful test tool.
In more ways than one, this is where things get really interesting.The signal has passed through an all pass filter in the trace below.This isn't a normal filter since it's flat.90 of phase shift was provided by the filter in this case.
The shape of the wave has changed so much that it no longer looks like a square wave.The relative phase of the amplitudes has not been changed.It doesn't sound like it's different from the original squarewave.You can vary the amount of phase shift while listening, and hear no change at all, provided it's done slowly.Fast changes are mostly due to the change in the effective frequencies.I'm not going to write pages of mathematical proof because it's hard to understand based on a written explanation.It's much easier to build a circuit and listen to it.
It is easy to get seemingly impossible waveforms.The trailing edge of the squarewave is affected if the phase shift network's frequencies are increased.There will be no anomalies with anything that affects phase in a Frequency Scan.When the high and low pass outputs are summed, the modified phase response is seen clearly and instantly, which is probably one of the most extreme.
The network has a 12dB/octave Linkwitz-Riley response.The difference between the two is vanishingly small because the phase shift network introduces the same shift.The frequency response should not change because of different slopes.
If you listen carefully, you may hear a slight difference between the signal shown above and the original, but you can also try a square wave as well.The test has to be double blind.You will hear a difference if you know what you are listening to.Our hearing is not very sensitive to phase shifts within a signal if the associated time delay is below the threshold of audibility.An open mind and a blind test regime are needed for some of these tests.
Would I hear the difference if I left the room and someone changed the switch to direct?You will find that the answer is "No" if you enlisted the help of someone.
I made the drawing shown below because there are so many possibilities.A representative indication of band pass and band stop filters is included.The simulations used filters that provided 6dB boost or cut at the resonance frequencies, and the squarewave input is the same as resonance.You will see different effects when the test frequency is changed.It's impossible to show every case because of the wide range of waveforms you can see on the oscilloscope.When you start to experiment for yourself, the general trends will be obvious.The more test circuits you have, the better.
There is a lack of a suitable squarewave generator.This can be solved using a circuit like that shown below.If you supply a sine wave at the required frequencies, the CMOS IC will convert it to a square wave with very fast risetime.The 4584 has a Schmitt Trigger on all gates.When running at 15V, output rise and fall times are quoted as 40ns and 80ns.The input stage on the left will convert a sine wave into a square wave, while the right will generate a Square wave directly.The approximate frequencies are given.
The circuit will change frequencies from 114 to 1.25kHz with the values shown.You can get a wider range by changing the value of theCapacitor.The alternative input stage means that you don't have to use a oscillator.The waveform will be corrupted by supply variations created when the switch is made.The 100nF cap should be placed as close to the IC's supply pins as possible.
The maximum output current and low output impedance are provided by the remaining five inverters.The circuit can't drive a low impedance load without the level being reduced dramatically because the output current from the devices is limited.You can set the output level.The whole circuit is powered from a single 15V supply.
A 9V battery is a convenient way to power the circuit.The output level is affected by the supply voltage being reduced.Minimum low Frequency rolloff is ensured by the large value of C2.The output is feeding a high impedance.It will take over 30 seconds for the squarewave to be centred.