Author Topic: How slow or fast must the risetime be on a square waveform to say it is a square  (Read 1745 times)

0 Members and 1 Guest are viewing this topic.

Offline TASTopic starter

  • Newbie
  • Posts: 1
  • Country: dk
Hi there :D

I was wondering about square/rectangular waveforms. Are there any rules to how fast or slow the rise time must be, or how much the rise time can take up of the on-time, to say it is a square waveform and not being a trapezoidal or triangle waveform?

Let say a pulse train with a square waveform with an on-time of 10µs. I would guess that if 1µs (1/10 of ton) is used for trise, that would be just fine, but what if it were 4µs or even as bad as 8-9µs? You could hardly call it a square wave if you only had 1 or 2µs before it ramps down again or could you?
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20551
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Hi there :D

I was wondering about square/rectangular waveforms. Are there any rules to how fast or slow the rise time must be, or how much the rise time can take up of the on-time, to say it is a square waveform and not being a trapezoidal or triangle waveform?

Let say a pulse train with a square waveform with an on-time of 10µs. I would guess that if 1µs (1/10 of ton) is used for trise, that would be just fine, but what if it were 4µs or even as bad as 8-9µs? You could hardly call it a square wave if you only had 1 or 2µs before it ramps down again or could you?

Yes: the transition time must be fit for purpose. In other words, the application defines how fast.

No: there are no general rules.

FFI, consider the implications demonstrated in: https://entertaininghacks.wordpress.com/2018/05/08/digital-signal-integrity-and-bandwidth-signals-risetime-is-important-period-is-irrelevant/
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7699
  • Country: au
Traditionally, though, the definition is that a 50% duty cycle waveform can be regarded as a "square wave" if it contains odd harmonics of the fundamental frequency up to & including the 7th harmonic (or sometimes quoted as the 5th harmonic). (It must not contain even harmonics)
That is a minimum number of odd harmonics to meet the definition---more is better!

Note: A "rectangular" waveform may be of any duty cycle & will hence contain other frequency components.
A square wave is thus, a special case of a rectangular waveform.
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 22382
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
There's no textbook or industry-standard definition (aside from the unambiguously "square" ideal wave, that cannot exist as a real signal), so we default to good old language and ontology.

It might be useful to think of "square" as a loose, catch-all, or general term for waves that are, in various part, made by intent (say from digital sources), functionally (clipping to "square up" a softer wave?), or descriptively (a signal with a sharply bimodal histogram, both in terms of voltage, and temporally; i.e., it spends most of its time "up", then most of its time "down", and little inbetween, and only those two states per cycle).  This includes waves that have a short risetime in relation to their period (say, <20%?), that may be "square" in terms of the literal angle between edges and flats, or "square" in terms of some specific range of duty cycle (near 50%, say), or even "square" in terms of some fixed ratio of voltage to time.

As a result, when speaking of a more specific signal, do provide specifiers, to make clear what meaning or description you're after. :-+

For example: a PWM square wave (and what phase reference if any), a sigma-delta bitstream, SPI (clock being periodic or gated), I2C (pulse widths being erratic, determined by protocol; rise and fall asymmetric), etc.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline iMo

  • Super Contributor
  • ***
  • Posts: 5133
  • Country: bt
.. when the "low" state approaches the "high" state with the speed of light (and vice versa).. :)
Readers discretion is advised..
 
The following users thanked this post: audiotubes

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1625
  • Country: ua
infinitely fast, of course. anything short of infinite is not a square (or rectangle), but only an approximation.

for practical applications the maximum allowed rise and fall times of a pulse are determined for each specific use case separately. for example, many ICs have these specified in their datasheets. if the pulse edges meet the requirements, then we can say that the waveform is "square enough".
« Last Edit: November 21, 2023, 01:10:02 pm by shapirus »
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20551
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Traditionally, though, the definition is that a 50% duty cycle waveform can be regarded as a "square wave" if it contains odd harmonics of the fundamental frequency up to & including the 7th harmonic (or sometimes quoted as the 5th harmonic). (It must not contain even harmonics)
That is a minimum number of odd harmonics to meet the definition---more is better!

Note: A "rectangular" waveform may be of any duty cycle & will hence contain other frequency components.
A square wave is thus, a special case of a rectangular waveform.

That "definition" requires context. Without that it is no more than cargo cult engineering.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1997
  • Country: is
I would tend to agree with the prior posts, "Containing at least to the 7th harmonic", of course the amplitude of the harmonics would be a factor. Also, a transition time of less than 10% of the on time or 5% of the repetition time would be good. Also, as stated a certain design may require a faster rise time. Really fast logic gates such as the 74ACT series are incredibly prone to oscillation on slow rise and fall times. If a square wave was in a high state for a year and in a low state for a year and its transition time took a full day it would still look incredibly square when plotted. When 'sampling' a square wave with a digital scope it has been said that 'good' integrity of a square wave is preserved when the sample rate is at least 10X the repetition rate of the square wave and then if the sample rate is an exact multiple of the square wave rate you may see aliasing!! I have seen lab students examine a 'mystery wave' (known by me to be exactly 1MHz from a frequency standard) and have them report to me that they have measured and believe the wave to be 10Hz, 1KHz, etc. because they used a slow sample rate and sweep speed and measured the alias. They failed to increase the sample rate to prove the waveform was not of a higher frequency.
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Offline xrunner

  • Super Contributor
  • ***
  • Posts: 7639
  • Country: us
  • hp>Agilent>Keysight>???
Hi there :D

I was wondering about square/rectangular waveforms. Are there any rules to how fast or slow the rise time must be, or how much the rise time can take up of the on-time, to say it is a square waveform and not being a trapezoidal or triangle waveform?

Let say a pulse train with a square waveform with an on-time of 10µs. I would guess that if 1µs (1/10 of ton) is used for trise, that would be just fine, but what if it were 4µs or even as bad as 8-9µs? You could hardly call it a square wave if you only had 1 or 2µs before it ramps down again or could you?

Well technically if it doesn't match the mathematical (perfect) description of a square wave, it isn't a square wave -

https://mathworld.wolfram.com/SquareWave.html

In other words, it's really a distorted wave that looks like a square wave if it comes from any physical electronic generator. A sine wave isn't a perfect sine wave they are all distroted waves too ... but if they are causing your circuit to function according to your design parameters (not too distorted from their perfect counterparts) they are called by their common names ... :popcorn:
« Last Edit: November 21, 2023, 02:20:28 pm by xrunner »
I told my friends I could teach them to be funny, but they all just laughed at me.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20551
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
I would tend to agree with the prior posts, "Containing at least to the 7th harmonic", of course the amplitude of the harmonics would be a factor.
...
When 'sampling' a square wave with a digital scope it has been said that 'good' integrity of a square wave is preserved when the sample rate is at least 10X the repetition rate of the square wave

Those two statements are incorrect, of course.

"Good" depends solely on the context; it is defined by the application.

If it is a digital signal, then the only relevant measure is the risetime. If you have signal integrity problems suficient to cause your circuit to fail, then they will be present whether the signal is 1MHz or 1Hz. Ditto EMI/EMC.
« Last Edit: November 21, 2023, 02:24:21 pm by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline CaptDon

  • Super Contributor
  • ***
  • Posts: 1997
  • Country: is
Hence the use of the word 'good' used loosely by technical people in labs such as "That looks pretty good" meaning "It's close enough to square for our purpose" or "That has been oversampled enough times to look like the original". Doesn't a 200MHz square wave look a bit more unlike a square wave than a 100MHz square wave when displayed at a 1GHz sample rate on a so called 500MHz bandwidth scope? Good is relative, so is square so in the lab environment we seldom use the word 'perfect', it is usually "That square wave generator makes a pretty good square wave at 500MHz but it 'sucks' at a GHz. 'Sucks' is a technical lab term that gets a lot of use also. Is there a standard lab reference for a square wave that 'sucks'?
Collector and repairer of vintage and not so vintage electronic gadgets and test equipment. What's the difference between a pizza and a musician? A pizza can feed a family of four!! Classically trained guitarist. Sound engineer.
 

Online ejeffrey

  • Super Contributor
  • ***
  • Posts: 3888
  • Country: us
I would usually call something a square wave if it has a basically flat top and bottom hold mostly independent of the rise and fall time.  Basically what you get by switching action.  But as stated, that's not any kind of normative standard, and doesn't mean it is or isn't  "square enough" for any application.  And it's not intended to be quantifiable so don't ask how flat the top and bottom need to be to counf.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20551
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Hence the use of the word 'good' used loosely by technical people in labs such as "That looks pretty good" meaning "It's close enough to square for our purpose" or "That has been oversampled enough times to look like the original". Doesn't a 200MHz square wave look a bit more unlike a square wave than a 100MHz square wave when displayed at a 1GHz sample rate on a so called 500MHz bandwidth scope? Good is relative, so is square so in the lab environment we seldom use the word 'perfect', it is usually "That square wave generator makes a pretty good square wave at 500MHz but it 'sucks' at a GHz. 'Sucks' is a technical lab term that gets a lot of use also. Is there a standard lab reference for a square wave that 'sucks'?

"Good" is relative to requirements, nothing else. If someone technical doesn't apply that when making technical statements, then they really shouldn't be doing a technical job.

Yes, I have applied that throughout my technical career - as have all the engineers around me. The most frequently question is "what do you mean by that?". The answer - or lack of an answer - is usually revealing.

Fundamentally adjectives are a pain in the backside; they should be omitted and replaced with numbers. Even the (presumably young) OP realises that, as indicated in his question!
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 7699
  • Country: au
I would tend to agree with the prior posts, "Containing at least to the 7th harmonic", of course the amplitude of the harmonics would be a factor.
...
When 'sampling' a square wave with a digital scope it has been said that 'good' integrity of a square wave is preserved when the sample rate is at least 10X the repetition rate of the square wave

Those two statements are incorrect, of course.

"Good" depends solely on the context; it is defined by the application.

If it is a digital signal, then the only relevant measure is the risetime. If you have signal integrity problems suficient to cause your circuit to fail, then they will be present whether the signal is 1MHz or 1Hz. Ditto EMI/EMC.

If you have a magnificent rise time but 39% "tilt" at the fundamental frequency, you may have problems!
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 20551
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
I would tend to agree with the prior posts, "Containing at least to the 7th harmonic", of course the amplitude of the harmonics would be a factor.
...
When 'sampling' a square wave with a digital scope it has been said that 'good' integrity of a square wave is preserved when the sample rate is at least 10X the repetition rate of the square wave

Those two statements are incorrect, of course.

"Good" depends solely on the context; it is defined by the application.

If it is a digital signal, then the only relevant measure is the risetime. If you have signal integrity problems suficient to cause your circuit to fail, then they will be present whether the signal is 1MHz or 1Hz. Ditto EMI/EMC.

If you have a magnificent rise time but 39% "tilt" at the fundamental frequency, you may have problems!

What do you mean by "39% tilt"?
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Online David Hess

  • Super Contributor
  • ***
  • Posts: 17117
  • Country: us
  • DavidH
Let say a pulse train with a square waveform with an on-time of 10µs. I would guess that if 1µs (1/10 of ton) is used for trise, that would be just fine

10% is the rule I also use, however as others pointed out, this is application dependent, and at high frequencies "square waves" may look anything but square.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf