• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Square Wave Testing of Audio Products (Video Tutorial)

JIW

Senior Member
Joined
Nov 11, 2019
Messages
383
Likes
558
Location
Germany
Come again? What is the shoulder of a square wave if it is not zero time? You can see the same conclusion regarding energy of square wave being infinite here:


I made an error in one of the implications in the part you quoted. Consistent with what I stated, the change of energy is the product of power and the change of time, i.e. dE = P x dt, but the incorrect implication of infinite energy requiring zero time was based on it being the ratio. Thus, for energy to be infinite, at least one of power or time has to infinite while the other has to be non-zero. If power is infinite for zero time, energy is finite as this is akin to the Dirac delta function. Thus, even at the zero crossings of the square wave, changes in energy are finite and thus the energy of a square wave is finite for any finite time.

The video is a mess. It treats the square wave as being for infinite time but also calculating the power as the limit for the period approaching infinity. The latter is utterly uncalled for and turns the square wave into a step function from -1 to +1 at time zero. Thus, energy is calculated using only one times the power of a cycle. However, the power calculation is initially set up for two cycles - one each side of zero - but then only calculates the power for the positive side as if there were no square wave at the negative side and with the zero crossing happening at half of infinity in the calculated limit. Thus, the calculation incorrectly uses two periods rather than one for the power of a single cycle. Regardless, since there is thus only one cycle, the energy is calculated using one times the power, i.e. two times that incorrectly calculated in the video, and hence finite. Still and absolutely trivially, for a finite period, for infinite time, the number of cycles is infinite and thus so is energy. None of this has anything to do with the power or energy at any one zero crossing.
 
Last edited:

kristiansen

Member
Joined
Mar 12, 2021
Messages
81
Likes
29
Location
Hillerød Danmark
What you do not take into account is that it is the amplifier's processing of this ideal signal that indirectly provides some of the audio signatures that the listener experiences.

The shape of the rolloff / flanks at the top and bottom and where they are, the resulting Q, Have you ever tried to affect the rolloff of bass and heard how much it affects the treble?.

In addition, there is impulse reproduction, tendencies to instability, the small peak, the damped swing seen on the flank, etc.
You can influence this with different realistic loads on the amplifier, etc. and deduce a lot about stability in a realistic situation.

In short, it does not seem as if you have ever tried to construct an amplifier from scratch and measured with known methods how to approach the ideal amplifier which treats all signals equally and as gently as possible. For the best possible listening result.

True, a square signal is an extreme situation that does not occur in reality, but a fault in an amplifier is not an on off function. And it's okay to reinforce the attempt to provoke mistakes.
You would not have the fierce debate about cables if you intensified the experiment with cables by changing everyone !!! Cables in a hifi system instead of typically just replacing a single one.
It is not enough to say that square just consists of a lot of sine oscillations up to infinite frequency, we know that.

The square signal tells far more than the individual sine does, in fact the individual sine say very little to nothing it is a the problems of measurement.
We have the usual song that it can man not be heard, etc. but one forgets that people may hear the consequences of the signal process
 
Last edited:
OP
amirm

amirm

Founder/Admin
Staff Member
CFO (Chief Fun Officer)
Joined
Feb 13, 2016
Messages
44,663
Likes
241,001
Location
Seattle Area
In short, it does not seem as if you have ever tried to construct an amplifier from scratch and measured with known methods how to approach the ideal amplifier which treats all signals equally and as gently as possible.
I have "constructed" many amplifiers. I have also repaired hundreds of them. That has nothing to do with figuring out the transparency of a working amplifier.

An audio amplifier is heavily band limited itself so no way it is an ideal amplifier able to deal with any and all inputs.

True, a square signal is an extreme situation that does not occur in reality, but a fault in an amplifier is not an on off function. And it's okay to reinforce the attempt to provoke mistakes.
I am not in fault finding business. I am in the business of telling people how well engineered an amplifier is in reproducing music. I run plenty of tests which stress the amplifier but am not going to resort to silly tests like square wave which was used by people who didn't have the type of instrumentation I have.

The square signal tells far more than the individual sine does, in fact the individual sine say very little to nothing it is a the problems of measurement.
My testing is NOT limited to a single sine wave. A sweep from 20 to 20 kHz has far more frequencies in it than a single square wave.
 

solderdude

Grand Contributor
Joined
Jul 21, 2018
Messages
16,052
Likes
36,427
Location
The Neitherlands
The shape of the rolloff / flanks at the top and bottom and where they are, the resulting Q, Have you ever tried to affect the rolloff of bass and heard how much it affects the treble?.[/QUOTE]

Yes, its a perception thing. Not a technical issue.

In short, it does not seem as if you have ever tried to construct an amplifier from scratch and measured with known methods how to approach the ideal amplifier which treats all signals equally and as gently as possible. For the best possible listening result.

What frequencies should the ideal amplifier handle (specify cut-off points) for the best possible listening result.
How can an amplifier treat signals 'as gently as possible' ?

A square wave test provides some additional information in characterizing an device's performance. It is one of many tests that are valuable.

It is not enough to say that square just consists of a lot of sine oscillations up to infinite frequency, we know that.

What else is there? Should be added that there also is a phase relation concerning the harmonics ?

The square signal tells far more than the individual sine does, in fact the individual sine say very little to nothing it is a the problems of measurement.

That's why it is one of many tests one can use to quickly show certain aspects. That's why it is used. Sines can easily be analyzed for distortion and tell a lot more about this than square waves do. There is a reason a function generator often has more than 1 type of waveform.
 

Plcamp

Addicted to Fun and Learning
Joined
Jul 6, 2020
Messages
860
Likes
1,318
Location
Ottawa
I would use square wave load switching on the outputs of power supplies I was designing to confirm that the recovery response of the feedback circuit actually had the slightly underdamped response I expected from my bode plot analysis.

That’s was a good quick confirmation that I was ready to test the full feedback response to line and load variations...which I did with...you guessed it...a sine wave sweep of injected signal into the feedback loop.

The one is a quick diagnostic, the other is a calibrated characterization...that’s the simple difference here I think.
 

Mrgoogle

Member
Joined
Jul 26, 2021
Messages
28
Likes
19
The topic of using square waves to test audio products comes up quite frequently. Turns out that it is not a very useful signal for this application due to its nature and how our audio systems work. In this video I explain and demonstrate the signal processing behind square wave and reasons they can be problematic in audio measurements.

------------
As always, questions, comments, recommendations, etc. are welcome.

Any donations are much appreciated using: https://www.audiosciencereview.com/forum/index.php?threads/how-to-support-audio-science-review.8150/
Amir some error , @4:29 that falling / raising on top and bottom of square it's because high -pass set on AC(<10Hz) on your AP555 , the ringing on the edges in other hand is from bandwidth limitation on your AP555 22.4 K ( 48 KHz SR) , your square generator is only 100 Hz.
if you make it to DC that slope on top and bottom will disappear .
 

Tom Danley

Active Member
Technical Expert
Audio Company
Joined
May 6, 2021
Messages
125
Likes
581
I have "constructed" many amplifiers. I have also repaired hundreds of them. That has nothing to do with figuring out the transparency of a working amplifier.

An audio amplifier is heavily band limited itself so no way it is an ideal amplifier able to deal with any and all inputs.


I am not in fault finding business. I am in the business of telling people how well engineered an amplifier is in reproducing music. I run plenty of tests which stress the amplifier but am not going to resort to silly tests like square wave which was used by people who didn't have the type of instrumentation I have.


My testing is NOT limited to a single sine wave. A sweep from 20 to 20 kHz has far more frequencies in it than a single square wave.
Hi Amirm
In the mid 70's I worked at a small company called Grommes Precision that made both tube PA, HiFi and some solid state PA amplifiers and mixers etc.
Back then the square wave was a visual trouble shooting tool at a time when tools were very limited, more like it could show you clues on an oscilloscope.
If the rise and fall were slanted, that was something at the high frequency end and if the "flat" portion was tilted, that was a low frequency issue. And working half days in the lab, If you loaded an amplifier stage that had no -fb with a capacitor and drove it with a square wave, you would see the effect of an R/C roll off (rounding off the transitions). I found that the same with the amplifier with -FB and load with a cap and you see some ringing.
The thumb rule (as opposed to mathematical infinity) was that to look "perfect" on an oscilloscope, the device under test needed to have flat frequency and phase from about 1/10 to 10x the square wave frequency. That is what makes it a tough signal for anything "wide band" in the day.

Companies like Quad and other Electrostatic speakers used to advertise their speaker could produce an acceptable square wave around 1KHz
Most speakers can reproduce a square wave in the middle range if you move the mic around and find the right spot, doing it over a large area in front of one over a range of frequencies is a different matter.

Best
Tom Danley
 

pma

Major Contributor
Joined
Feb 23, 2019
Messages
4,602
Likes
10,771
Location
Prague
I am not in fault finding business. I am in the business of telling people how well engineered an amplifier is in reproducing music. I run plenty of tests which stress the amplifier but am not going to resort to silly tests like square wave which was used by people who didn't have the type of instrumentation I have.


My testing is NOT limited to a single sine wave. A sweep from 20 to 20 kHz has far more frequencies in it than a single square wave.

Sounds pretty arrogant and incompetent ("silly tests like square wave"). Based on your posts, I do not think that you have ever designed any high power audio amplifier.

"A sweep from 20 to 20 kHz has far more frequencies in it than a single square wave" - this is an interesting statement of yours. How many frequencies are there in the 10 Hz square wave even if we accept the top limit of 20kHz? Less than in the frequency sweep that you are using in your tests? And "how many frequencies" are there in a single unit step? Is not it infinity, actually?

The reason why we use square waves or step response is that they are not limited at 20kHz, but for example a step response with 100ns rise time would correspond to -3dB low pass corner at 3.5 MHz. We need this fast signals to verify amplifier stability not only during the design stage, but also when someone comes with a trouble and we need to find it. You are very proud of your AP, that is fine, however you do not seem to be neither a circuit designer in power amplifiers, nor to understand them well, so please leave your comments to the topics that you really understand. You are only discrediting yourself this way.
 

PeteL

Major Contributor
Joined
Jun 1, 2020
Messages
3,303
Likes
3,846
Sounds pretty arrogant and incompetent ("silly tests like square wave"). Based on your posts, I do not think that you have ever designed any high power audio amplifier.

"A sweep from 20 to 20 kHz has far more frequencies in it than a single square wave" - this is an interesting statement of yours. How many frequencies are there in the 10 Hz square wave even if we accept the top limit of 20kHz? Less than in the frequency sweep that you are using in your tests? And "how many frequencies" are there in a single unit step? Is not it infinity, actually?

The reason why we use square waves or step response is that they are not limited at 20kHz, but for example a step response with 100ns rise time would correspond to -3dB low pass corner at 3.5 MHz. We need this fast signals to verify amplifier stability not only during the design stage, but also when someone comes with a trouble and we need to find it. You are very proud of your AP, that is fine, however you do not seem to be neither a circuit designer in power amplifiers, nor to understand them well, so please leave your comments to the topics that you really understand. You are only discrediting yourself this way.
If I may, I feel it's ok to argue, dispute, debate in a science based forum about findings or statements that we find unrigorous, misleading, or wrong. Now I also believe it can be done without insults or name calling (arrogant, incompetent), it's more fun to be part of a discussion group that don't have that. I agree that the term "silly" was not only unasked for, also wrong in some ways. Now. I don't think Amir ever pretended to be an amp designer, and well, by definition a "sweep" contain also an infinity of values, a square wave which have been band limited, well a fixed set of harmonics. But in the end it's just semantics and disagreements are fine and constructive, I think we should keep it that way and not escalate into fights.
 

ta240

Major Contributor
Joined
Nov 7, 2019
Messages
1,427
Likes
2,864
[rant]I think the mass production of videos here is getting out of hand. I don't ever watch technical videos, nor does anybody I know. It just doesn't work. Writing good articles is much better for understanding, both for understanding basics as well as details, for a lot of well-known reasons.[/rant]
I'm also not into technical videos; I want to read the information and glance back at charts. It is also a lot easier to cross reference and search out portions of the claims.

I was really hoping to find a well written article on why square waves weren't useful but haven't yet. Something like an apposing view to: https://sound-au.com/articles/squarewave.htm

Otherwise I can't shake the feeling that they are being ignored because they show how amplifiers can sound different...
 

Axo1989

Major Contributor
Joined
Jan 9, 2022
Messages
2,902
Likes
2,954
Location
Sydney
I'm also not into technical videos; I want to read the information and glance back at charts. It is also a lot easier to cross reference and search out portions of the claims.

I was really hoping to find a well written article on why square waves weren't useful but haven't yet. Something like an apposing view to: https://sound-au.com/articles/squarewave.htm

Otherwise I can't shake the feeling that they are being ignored because they show how amplifiers can sound different...

That was a good read, thank you. And yes, it would be interesting to see an equivalent counterpoint.
 

pma

Major Contributor
Joined
Feb 23, 2019
Messages
4,602
Likes
10,771
Location
Prague
I was really hoping to find a well written article on why square waves weren't useful but haven't yet. Something like an apposing view to: https://sound-au.com/articles/squarewave.htm

That's a good article that summarizes basics of square wave testing in time domain and is written without biased view. Time domain testing is as important as testing in frequency domain, especially in the design stage. Both approaches have pros and cons and point at different issues and circuit behaviour. It is not wise to emphasize only one method and to deny importance of the other one.
 

pma

Major Contributor
Joined
Feb 23, 2019
Messages
4,602
Likes
10,771
Location
Prague
I was notified about a new post in this thread, however it seems it has disappeared?
 

Plcamp

Addicted to Fun and Learning
Joined
Jul 6, 2020
Messages
860
Likes
1,318
Location
Ottawa
I'm also not into technical videos; I want to read the information and glance back at charts. It is also a lot easier to cross reference and search out portions of the claims.

I was really hoping to find a well written article on why square waves weren't useful but haven't yet. Something like an apposing view to: https://sound-au.com/articles/squarewave.htm

Otherwise I can't shake the feeling that they are being ignored because they show how amplifiers can sound different...
Looking at the conclusions section again after reading the article yesterday actually does not tell me that there is anything gained by adding square wave testing to the regimen already conducted by Amir in his characterization tests. In fact, it reinforces that the sine wave test are indeed representative and more revealing.

There has never (to my knowledge) been any debate that square wave observations by designers experimenting with prototypes are a useful thing to do from time to time (I could tell instantly whether or not my SMPS feedback loop was as-expected stable with one look at minimum load and maximum line in voltage)…so yes it is a useful test at some stages of any design process.

But I don’t see anything in that article that suggests square wave testing is a must do to enable valid comparisons of performance, given the tests already performed?

I don’t get what the objection is?
 

fpitas

Master Contributor
Forum Donor
Joined
Jul 7, 2022
Messages
9,885
Likes
14,212
Location
Northern Virginia, USA
I guess squarewave testing might show slew-rate limiting, or overload recovery of an amp? It's true that if you don't filter the amp input appropriately, you can get some odd effects. Otherwise it just reflects the frequency response.

Rod's article mainly stressed that it's a quick evaluation.
 
Last edited:

Lambda

Major Contributor
Joined
Mar 22, 2020
Messages
1,792
Likes
1,530
, given the tests already performed?
The tests already performed don't show any Phases responses information.
In theory thy would and can if the FFT/laplace transformation output would be a Complex number.

But how it is. lots of information is missing.
What we have is in no way everything tarts needed to precisely "model" the amplifiers response.

A impulses response or step response or square wave reveals a lot at once. but is hard to interpret.

If the amplifier gets into slew-rate limiting how is this effecting low frequency performance and how long?
how could you tell fro a sine sweep test?

Why not more reviling tests:
 

pma

Major Contributor
Joined
Feb 23, 2019
Messages
4,602
Likes
10,771
Location
Prague
Sorry guys, IMO many of you do not know what you speak about and I wonder why amateurs have a need of talking about all technical issues they do not understand. How would you find instability like this just only on audio range frequency response???

amp_oscillations.jpg
 

Plcamp

Addicted to Fun and Learning
Joined
Jul 6, 2020
Messages
860
Likes
1,318
Location
Ottawa
I guess squarewave testing might show slew-rate limiting, or overload recovery of an amp? Otherwise it just reflects the frequency response.
It’s a bit more than that. I designed switching power supplies with feedback control loops.

What I cared about was stability under high gain (high input voltage, being 120 V +15% so that open loop gain was maximum and low load) transient conditions, without compromising transient recovery time under low gain high load conditions. The stability margin, measured in db at 0 degrees phase angle or phase angle at 0 db gain (the gain and phase margins) of the control (feedback) loop.

So the waveshape of the control loop’s response to a load transient would (when subjecting the load to square wave current changes) show instantly whether or not that loop was under damped, over damped or critically damped. I would first predict what should happen, and then observe reality.

That is an example of useful deployment of squarewave testing. I could conclude the same things about my design if saw sine wave load testing like Amir does with stimulus…and that would tell me much much more.
 

fpitas

Master Contributor
Forum Donor
Joined
Jul 7, 2022
Messages
9,885
Likes
14,212
Location
Northern Virginia, USA
I certainly agree that multi-tone testing is valuable, and
It’s a bit more than that. I designed switching power supplies with feedback control loops.

What I cared about was stability under high gain (high input voltage, being 120 V +15% so that open loop gain was maximum and low load) transient conditions, without compromising transient recovery time under low gain high load conditions. The stability margin, measured in db at 0 degrees phase angle or phase angle at 0 db gain (the gain and phase margins) of the control (feedback) loop.

So the waveshape of the control loop’s response to a load transient would (when subjecting the load to square wave current changes) show instantly whether or not that loop was under damped, over damped or critically damped. I would first predict what should happen, and then observe reality.

That is an example of useful deployment of squarewave testing. I could conclude the same things about my design if saw sine wave load testing like Amir does with stimulus…and that would tell me much much more.
Well, yes, I design feedback systems too at times. But your explanation will help people understand the concepts. In the case of a finished amplifier like Amir tests here, I bet the input is filtered so those sharp edges don't reach the amp. But, maybe not.
 

fpitas

Master Contributor
Forum Donor
Joined
Jul 7, 2022
Messages
9,885
Likes
14,212
Location
Northern Virginia, USA
Oddly enough, if the subject is studying amplifier stability, we might be better off using square wave load profiles. One could even use different types and lengths of cables (!) and demonstrate that cable RF termination is a real good idea.

 
Top Bottom