Author Topic: Function generator square wave rise time  (Read 3952 times)

0 Members and 1 Guest are viewing this topic.

Offline edpalmer42

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: ca
Re: Function generator square wave rise time
« Reply #25 on: March 16, 2025, 02:26:00 am »
Some generators put the DDS output through a low pass filter to produce a sine wave, then square that up with a comparator. The net result is that the square wave edges are not constrained by the DDS clock edges, and consequently do not have the jitter you mention.

See, for example, the application section of in https://www.analog.com/media/en/technical-documentation/data-sheets/AD9851.pdf Such applications are cheaply available on fleabay.

The Stanford Research DS345 does something very similar.  They create a synthesized sine wave with sub-Hz resolution which is great.  But then they use a comparator to square it up which adds a different source of jitter.  Noise on the sine wave - there's always noise everywhere - causes jitter in the transition points.  This jitter negates the value of the sub-Hz resolution.  I was sort of able to access the high precision signal by using the sync output and the arb waveform capability, but even that had issues.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 22155
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Function generator square wave rise time
« Reply #26 on: March 16, 2025, 02:46:02 am »
Some generators put the DDS output through a low pass filter to produce a sine wave, then square that up with a comparator. The net result is that the square wave edges are not constrained by the DDS clock edges, and consequently do not have the jitter you mention.

See, for example, the application section of in https://www.analog.com/media/en/technical-documentation/data-sheets/AD9851.pdf Such applications are cheaply available on fleabay.

The Stanford Research DS345 does something very similar.  They create a synthesized sine wave with sub-Hz resolution which is great.  But then they use a comparator to square it up which adds a different source of jitter.  Noise on the sine wave - there's always noise everywhere - causes jitter in the transition points.  This jitter negates the value of the sub-Hz resolution.  I was sort of able to access the high precision signal by using the sync output and the arb waveform capability, but even that had issues.

Too true; TANSTAAFL :(

I saw an inverse variant of that with the AD9851 evaluation board from fleabay. I could see a small glitch on the sinewave output, which was caused by the comparator switching. Solution: disconnect the comparator input driven by the sinewave output.
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 edpalmer42

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: ca
Re: Function generator square wave rise time
« Reply #27 on: March 16, 2025, 03:09:55 am »
So, to get a good 10 MHz square wave, you might need harmonics up to 100 MHz.

False.

The period/frequency is irrelevant; the risetime is the only important parameter. Even a 1Hz 74LS TTL signal "needs" 100MHz bandwidth, and a 74LVC1G signal "needs" GHz.

For a little theory and a practical demonstration, see https://entertaininghacks.wordpress.com/2018/05/08/digital-signal-integrity-and-bandwidth-signals-risetime-is-important-period-is-irrelevant/

I agree that the period of the original signal is irrelevant.  I never stated otherwise.  However, risetime and bandwidth are two sides of the same coin.  To have a fast risetime, you need wide bandwidth.  The wide bandwidth will allow the signal's harmonics to pass which will add up to create a fast risetime.  Odd harmonics are necessary to create a square wave.  So, for my example of a 10 MHz fundamental, 30, 50, 70, 90, etc. MHz harmonics must pass through the system.  Depending on how fast a risetime you want, that might not be enough.  Theoretically, you need an infinite number of harmonics.  This is standard FFT math.  It can be easily demonstrated by looking at a square wave with a spectrum analyzer.

Your post mentioned only "square wave" and "frequency" (i.e. period). It did not mention the key parameter: risetime.

It is standard Fourier Transform theory, but too many people don't realise that because they only consider the special case of square waves with a 50% duty cycle.

Risetime is not a key parameter.  Risetime is determined by the bandwidth of the system.  If you take one of Leo Bodnar's fast pulse generators (10 MHz, 30 ps risetime, 50% duty cycle) and feed it through a 100 MHz low pass filter you won't have a 30 ps risetime any more because the system doesn't have the bandwidth to support those harmonics.  A similar result will occur if you send the pulse through a buffer that only has a 100 MHz bandwidth.  So whether you're talking about signal generation or measurement, you need a frankly ridiculous amount of bandwidth just to see a good square wave.  Your application will determine how good your square wave needs to be.

Quote
Quote
But this discussion is only vaguely connected to the original question i.e. performance of a square wave generator.  To generate a good square wave, the generator's output stage must have a bandwidth that's many times greater than the fundamental frequency.  Logic ICs like the 74LS and 74LVC1G that you mentioned have appropriate output stages.  Function generators typically don't.
We don't know how the OP will use their function generator. If it is to drive modern logic (i.e. mid 80s onwards) the risetime limitations may be a problem for them.

At this point, the OP is trying to understand how the specs relate to what he's seeing on the scope.  Typically, the answer is easier to understand if it's given in the frequency domain rather than the time domain.  Application issues are TBD.

I looked around to see if I could find an online live demo of how risetime and bandwidth interact but I didn't find anything I liked.  Does anyone know of something good?

Found one!  https://controlsystemsacademy.com/0018/0018.html  You can zoom in on the time domain plot, run the Fourier Coefficients (aka Harmonics) back and forth and then grab a coefficient and drag it up and down.  Watch what happens to the risetime as you add or remove harmonics.  Tggzzz, I realize that this isn't new to you - it's for the younger people.
« Last Edit: March 16, 2025, 03:36:26 am by edpalmer42 »
 
The following users thanked this post: hp3310a

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 22155
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Function generator square wave rise time
« Reply #28 on: March 16, 2025, 09:08:33 am »
So, to get a good 10 MHz square wave, you might need harmonics up to 100 MHz.

False.

The period/frequency is irrelevant; the risetime is the only important parameter. Even a 1Hz 74LS TTL signal "needs" 100MHz bandwidth, and a 74LVC1G signal "needs" GHz.

For a little theory and a practical demonstration, see https://entertaininghacks.wordpress.com/2018/05/08/digital-signal-integrity-and-bandwidth-signals-risetime-is-important-period-is-irrelevant/

I agree that the period of the original signal is irrelevant.  I never stated otherwise.  However, risetime and bandwidth are two sides of the same coin.  To have a fast risetime, you need wide bandwidth.  The wide bandwidth will allow the signal's harmonics to pass which will add up to create a fast risetime.  Odd harmonics are necessary to create a square wave.  So, for my example of a 10 MHz fundamental, 30, 50, 70, 90, etc. MHz harmonics must pass through the system.  Depending on how fast a risetime you want, that might not be enough.  Theoretically, you need an infinite number of harmonics.  This is standard FFT math.  It can be easily demonstrated by looking at a square wave with a spectrum analyzer.

Your post mentioned only "square wave" and "frequency" (i.e. period). It did not mention the key parameter: risetime.

It is standard Fourier Transform theory, but too many people don't realise that because they only consider the special case of square waves with a 50% duty cycle.

Risetime is not a key parameter.  Risetime is determined by the bandwidth of the system.  If you take one of Leo Bodnar's fast pulse generators (10 MHz, 30 ps risetime, 50% duty cycle) and feed it through a 100 MHz low pass filter you won't have a 30 ps risetime any more because the system doesn't have the bandwidth to support those harmonics.  A similar result will occur if you send the pulse through a buffer that only has a 100 MHz bandwidth.  So whether you're talking about signal generation or measurement, you need a frankly ridiculous amount of bandwidth just to see a good square wave.  Your application will determine how good your square wave needs to be.

Risetime and bandwidth are indeed interchangeable. That's precisely why it is misleading to start from a square/rectangular wave's period or fundamental frequency.

What bandwidth is needed for a "good" 1kHz square/rectangular waveform? Numbers, not adjectives, please. Is it any different for a 1µHz waveform?


Quote
Quote
Quote
But this discussion is only vaguely connected to the original question i.e. performance of a square wave generator.  To generate a good square wave, the generator's output stage must have a bandwidth that's many times greater than the fundamental frequency.  Logic ICs like the 74LS and 74LVC1G that you mentioned have appropriate output stages.  Function generators typically don't.
We don't know how the OP will use their function generator. If it is to drive modern logic (i.e. mid 80s onwards) the risetime limitations may be a problem for them.

At this point, the OP is trying to understand how the specs relate to what he's seeing on the scope.  Typically, the answer is easier to understand if it's given in the frequency domain rather than the time domain.

Not if you are using a time domain instrument such as an oscilloscope.
« Last Edit: March 16, 2025, 09:21:03 am 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
 

Online Aldo22

  • Super Contributor
  • ***
  • Posts: 1506
  • Country: ch
Re: Function generator square wave rise time
« Reply #29 on: March 16, 2025, 10:12:27 am »
@hp3310a: If you simply want to see higher frequency square waves, you can use an Si5351.
You can't set the amplitude, offset or duty cycle directly, but it might be enough for simple tests.
https://learn.adafruit.com/adafruit-si5351-clock-generator-breakout

It just depends on what you need.
In the screenshot you see approx. 40MHz. That's where I reach the limitations of my cheap scope.
 

Online gf

  • Super Contributor
  • ***
  • Posts: 1473
  • Country: de
Re: Function generator square wave rise time
« Reply #30 on: March 16, 2025, 12:17:00 pm »
Square waves are tough for a function generator to produce because the output passes through a linear amplifier which has gain-bandwidth and slew rate limitations. 

True, but for a DDS-type AWG with fixed clock, there's another limiting factor that you can see in my post above.  For square waves or pulses of arbitrary period and frequency, the desired transition from low to high or vice versa will not typically occur right at the same time as a sample.  If you just use an abrupt transition from a high sample before to a low sample after, then the high/low transitions will have a lot of jitter, up to one full sample clock period. The fix is to always shape the transition using the three nearest sample points and the only way to acheive a uniform result is to shape it to a much slower rise time than you might otherwise get.

Exactly.

Since AWGs rely on Shannon-Nyquist reconstruction of a continuous-time signal from discrete-time samples, they can only generate bandwidth-limited signals.

The Shannon-Nyquist sampling theorem does, of course, also apply when the DDS resamples the prototype waveform stored in its wavetable. If the prototype waveform isn't properly bandwidth-limited for the DDS resampling, it will suffer from aliasing, resulting in these edge jitter artifacts. Low-jitter reproduction at higher frequencies is only possible if the wavetable contains a properly bandwidth-limited square wave, which implies that it cannot have sharp edges.

Quote
The fix is to always shape the transition using the three nearest sample points and the only way to acheive a uniform result is to shape it to a much slower rise time than you might otherwise get. In my example, the output amplifier could achieve a 3ns rise time, a bit faster than the scope itself.  But the algorithm deliberately yields a much slower 8.4ns edge using a 300MHz sample clock plus a 4X oversampling 120MHz low-pass output filter.

At 300MSa/s, Nyquist is at 150MHz. If you pass an ideal step through a (non-ideal, realizable) brickwall filter with a (say) 120...150MHz transition band to get a properly bandwidth-limited step, you can indeed obtain an edge with about 3.4ns rise time, but there will be significant overshoot/ringing. If you want to have less overshoot and still not exceed the bandwidth, you will deliberately have to make the edges softer.
« Last Edit: March 16, 2025, 06:23:19 pm by gf »
 
The following users thanked this post: bdunham7

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 8858
  • Country: us
Re: Function generator square wave rise time
« Reply #31 on: March 16, 2025, 02:28:19 pm »
Risetime and bandwidth are indeed interchangeable. That's precisely why it is misleading to start from a square/rectangular wave's period or fundamental frequency.

What bandwidth is needed for a "good" 1kHz square/rectangular waveform? Numbers, not adjectives, please. Is it any different for a 1µHz waveform?

They're only interchangeable in a first-order approximation sort of way and that approximation is dependent on the characteristics of the system.  The 0.35 factor just happens to work reasonably well for a fair number of simple front-ends on common oscilloscopes from DC to a few hundred MHz.  I don't think it is misleading at all to use BW expressed in multiples of the fundamental because this both explains the Fourier representation of the square wave and comes up with a  reasonable answer that is easy to understand.

You need 10kHz BW to show a reasonably but not perfectly square 1kHz wave.  100kHz will make a nice clean, sharp picture.  It's a lot different for 1µHz.  Here is a nice clean, sharp, very square 500µHz wave with a rise time of 10 seconds.  1µHz would still look nice and square with a rise time of several minutes.

A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 
The following users thanked this post: hp3310a

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 8858
  • Country: us
Re: Function generator square wave rise time
« Reply #32 on: March 16, 2025, 02:40:12 pm »
The Stanford Research DS345 does something very similar.  They create a synthesized sine wave with sub-Hz resolution which is great.  But then they use a comparator to square it up which adds a different source of jitter.  Noise on the sine wave - there's always noise everywhere - causes jitter in the transition points.  This jitter negates the value of the sub-Hz resolution.  I was sort of able to access the high precision signal by using the sync output and the arb waveform capability, but even that had issues.

That seems like an amateur mistake to make by Stanford Research.  I'd think the obvious way to make precision sub-Hz square waves would be to synthesize a sine wave at a high multiple of the desired frequency and then divide down the comparator output in logic. 

However, the real challenge of building in a sharp square wave into an AWG is the nature of the AWG and how it is used.  Users expect to be able to set at least frequency, amplitude, offset and duty cycle and then perhaps rise time and fall time separately.  This is all handled by the DAC in normal operation, but if you use a comparator IDK how you regain all that.  Generating fast pulses and sharp-edged square waves is probably best left to separate specialized equipment.
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 
The following users thanked this post: Aldo22

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 22155
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Function generator square wave rise time
« Reply #33 on: March 16, 2025, 03:37:52 pm »
Risetime and bandwidth are indeed interchangeable. That's precisely why it is misleading to start from a square/rectangular wave's period or fundamental frequency.

What bandwidth is needed for a "good" 1kHz square/rectangular waveform? Numbers, not adjectives, please. Is it any different for a 1µHz waveform?

They're only interchangeable in a first-order approximation sort of way and that approximation is dependent on the characteristics of the system.  The 0.35 factor just happens to work reasonably well for a fair number of simple front-ends on common oscilloscopes from DC to a few hundred MHz.  I don't think it is misleading at all to use BW expressed in multiples of the fundamental because this both explains the Fourier representation of the square wave and comes up with a  reasonable answer that is easy to understand.

The 0.35 rule of thumb is based on how some scopes' front ends interact with signals; that's all.

The problem with the simplistic rules of thumb based on period are that, while strictly true, they actively and repeatedly mislead beginners with respect to important practical signals found in many systems.

Quote
You need 10kHz BW to show a reasonably but not perfectly square 1kHz wave.  100kHz will make a nice clean, sharp picture.  It's a lot different for 1µHz.  Here is a nice clean, sharp, very square 500µHz wave with a rise time of 10 seconds.  1µHz would still look nice and square with a rise time of several minutes.

I'm perfectly aware of what things look like in a picture - and don't care very much.

I care much more about how signals behave in systems.

If you are principally interested in audio signals, then square waves may be of some use. But in digital systems, square waves are merely an unrepresentative special case: most signals are rectangular with very widely varying duty cycles.
« Last Edit: March 16, 2025, 03:40:36 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
 
The following users thanked this post: egonotto

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 8858
  • Country: us
Re: Function generator square wave rise time
« Reply #34 on: March 16, 2025, 04:46:45 pm »
I'm perfectly aware of what things look like in a picture - and don't care very much.

Then why hijack the thread when the OP was specifically asking about the lack of "squareness" in his 20MHz example?

Quote
I care much more about how signals behave in systems.

Other than a sig-gen and scope, the OP hasn't specified a system so how could we know what is or isn't important?  But, since he at least has a scope, think about why scope calibrator outputs are square waves.  If I were using a typical 100MHz scope with a typical calibrator output with a 5µs rise time and sharpened that up to 50ns, would it matter?
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17793
  • Country: us
  • DavidH
Re: Function generator square wave rise time
« Reply #35 on: March 16, 2025, 05:04:06 pm »
The 0.35 rule of thumb is based on how some scopes' front ends interact with signals; that's all.

The 0.35 rule of thumb is calculated from the bandwidth of a single-pole or cascaded single-pole response, which is not really Gaussian but close enough, resulting in a 10% to 90% transition time.  It is not only based on the front end of some oscilloscopes.

Quote
The problem with the simplistic rules of thumb based on period are that, while strictly true, they actively and repeatedly mislead beginners with respect to important practical signals found in many systems.

The math is not misleading, but manufacturers are.  If you are not marketing or sales, then you are overhead.

The 0.35 rule is still useful to estimate bandwidth from transition time for typical linear systems.  It does not apply to non-linear systems, like when slew rate limits are reached in a Rigol DS1000Z series oscilloscopes, or any sampling oscilloscope.  This distinction could be important here but we can test it.  Does the transition time of the square waves change with amplitude?  If so, then the 0.35 rule is not going to apply, and bandwidth measurements are going to change with amplitude.

Other than a sig-gen and scope, the OP hasn't specified a system so how could we know what is or isn't important?  But, since he at least has a scope, think about why scope calibrator outputs are square waves.  If I were using a typical 100MHz scope with a typical calibrator output with a 5µs rise time and sharpened that up to 50ns, would it matter?

It should not; the calibrator output is intended for low frequency compensating attenuating probes, and whether the transition time is 5 microseconds or 50 nanoseconds will not matter.  Some calibrators produce fast edges and some produce slow edges, but in both cases they have low aberrations.  Calibrating the high frequency response requires a test signal which is considerably faster.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 22155
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Function generator square wave rise time
« Reply #36 on: March 16, 2025, 05:56:11 pm »
..., think about why scope calibrator outputs are square waves.  If I were using a typical 100MHz scope with a typical calibrator output with a 5µs rise time and sharpened that up to 50ns, would it matter?

The scope cal out signal is for adjusting the low frequency response of bog-standard "high impedance" *10 probes. "Low" means time constants of ms not ns. The principal parameter is thus absence of overshoot and (time-domain) flatness of the peaks and troughs.

Many decent standard *10 probes have several internal tweakable resistors and capacitors for tuning the high frequency performance. The cal out signal is far too "leisurely" to be of use for those purposes.
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 Conrad Hoffman

  • Super Contributor
  • ***
  • Posts: 2126
  • Country: us
    • The Messy Basement
Re: Function generator square wave rise time
« Reply #37 on: March 16, 2025, 06:16:49 pm »
I pondered this square wave limitation for a while before buying my Siglent arb gen. It seemed like a real step down from my boat anchor generators. Then I thought about my applications, mostly audio. I just don't need crazy fast rise and fall; in fact, too fast can actually be a problem because you're essentially inputting an RF signal that can cause many amps and circuits to misbehave, where they never would do so in real life. OTOH, if you were trying to do a poor man's TDR test, you might need better. Fortunately, fast square wave and pulse circuits are pretty easy to build.
 

Offline edpalmer42

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: ca
Re: Function generator square wave rise time
« Reply #38 on: March 16, 2025, 07:05:20 pm »
The Stanford Research DS345 does something very similar.  They create a synthesized sine wave with sub-Hz resolution which is great.  But then they use a comparator to square it up which adds a different source of jitter.  Noise on the sine wave - there's always noise everywhere - causes jitter in the transition points.  This jitter negates the value of the sub-Hz resolution.  I was sort of able to access the high precision signal by using the sync output and the arb waveform capability, but even that had issues.

That seems like an amateur mistake to make by Stanford Research.  I'd think the obvious way to make precision sub-Hz square waves would be to synthesize a sine wave at a high multiple of the desired frequency and then divide down the comparator output in logic.

I was surprised and annoyed when I realized what they were doing.  The DS345 isn't a cheap instrument - current price starts at US$2600.  It would have been easy and cheap to add a 'high quality' square wave output with CMOS levels that bypassed all the sine wave and comparator nonsense.  The existing 'function generator' capabilities would be unaffected.

Oh, well.  It is what it is.   :-//
 

Offline edpalmer42

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: ca
Re: Function generator square wave rise time
« Reply #39 on: March 16, 2025, 07:07:26 pm »
Risetime is not a key parameter.  Risetime is determined by the bandwidth of the system.  If you take one of Leo Bodnar's fast pulse generators (10 MHz, 30 ps risetime, 50% duty cycle) and feed it through a 100 MHz low pass filter you won't have a 30 ps risetime any more because the system doesn't have the bandwidth to support those harmonics.  A similar result will occur if you send the pulse through a buffer that only has a 100 MHz bandwidth.  So whether you're talking about signal generation or measurement, you need a frankly ridiculous amount of bandwidth just to see a good square wave.  Your application will determine how good your square wave needs to be.

Risetime and bandwidth are indeed interchangeable. That's precisely why it is misleading to start from a square/rectangular wave's period or fundamental frequency.

What bandwidth is needed for a "good" 1kHz square/rectangular waveform? Numbers, not adjectives, please. Is it any different for a 1µHz waveform?

What?  :o  You used an adjective, to describe a waveform and then said that I couldn't use an adjective to answer the question??  No!  To reproduce a "good" square/rectangular waveform, you need "enough" bandwidth.  The definitions of "good" and "enough" are application dependent.  I'm an amateur time-nut so my definitions will be substantially different from someone working with a 555 oscillator.

If you use the Fourier Series Demo that I previously linked to, my earlier example of a 10 MHz square wave with harmonics up to 100 MHz looks a bit sad.  It might be adequate for some applications and totally inadequate for others.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 22155
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Function generator square wave rise time
« Reply #40 on: March 16, 2025, 07:40:15 pm »
I pondered this square wave limitation for a while before buying my Siglent arb gen. It seemed like a real step down from my boat anchor generators. Then I thought about my applications, mostly audio. I just don't need crazy fast rise and fall; in fact, too fast can actually be a problem because you're essentially inputting an RF signal that can cause many amps and circuits to misbehave, where they never would do so in real life. OTOH, if you were trying to do a poor man's TDR test, you might need better. Fortunately, fast square wave and pulse circuits are pretty easy to build.

The only audio amp I've tested was a Quad 405 current dumping amp. It delivered full power at 20kHz into a 7ohm resistor. The output risetime was 10us, IIRC, a nice linear slope. I would have used a 4MHz sig gen's square wave, which was more than  fast enough for that job.
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 tggzzz

  • Super Contributor
  • ***
  • Posts: 22155
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Function generator square wave rise time
« Reply #41 on: March 16, 2025, 07:45:40 pm »
Risetime is not a key parameter.  Risetime is determined by the bandwidth of the system.  If you take one of Leo Bodnar's fast pulse generators (10 MHz, 30 ps risetime, 50% duty cycle) and feed it through a 100 MHz low pass filter you won't have a 30 ps risetime any more because the system doesn't have the bandwidth to support those harmonics.  A similar result will occur if you send the pulse through a buffer that only has a 100 MHz bandwidth.  So whether you're talking about signal generation or measurement, you need a frankly ridiculous amount of bandwidth just to see a good square wave.  Your application will determine how good your square wave needs to be.

Risetime and bandwidth are indeed interchangeable. That's precisely why it is misleading to start from a square/rectangular wave's period or fundamental frequency.

What bandwidth is needed for a "good" 1kHz square/rectangular waveform? Numbers, not adjectives, please. Is it any different for a 1µHz waveform?

What?  :o  You used an adjective, to describe a waveform and then said that I couldn't use an adjective to answer the question??  No!  To reproduce a "good" square/rectangular waveform, you need "enough" bandwidth.  The definitions of "good" and "enough" are application dependent.  I'm an amateur time-nut so my definitions will be substantially different from someone working with a 555 oscillator.

If you use the Fourier Series Demo that I previously linked to, my earlier example of a 10 MHz square wave with harmonics up to 100 MHz looks a bit sad.  It might be adequate for some applications and totally inadequate for others.

Precisely!

Now, since you are a timenut, what bandwidth is good enough for the 1pps/1Hz output from a GPSDO?

5Hz? 10Hz? 100Hz? Surely the 99th harmonic will look good enough. Won't it?
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
 
The following users thanked this post: egonotto

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17793
  • Country: us
  • DavidH
Re: Function generator square wave rise time
« Reply #42 on: March 16, 2025, 07:54:40 pm »
The Stanford Research DS345 does something very similar.  They create a synthesized sine wave with sub-Hz resolution which is great.  But then they use a comparator to square it up which adds a different source of jitter.  Noise on the sine wave - there's always noise everywhere - causes jitter in the transition points.  This jitter negates the value of the sub-Hz resolution.  I was sort of able to access the high precision signal by using the sync output and the arb waveform capability, but even that had issues.

That seems like an amateur mistake to make by Stanford Research.  I'd think the obvious way to make precision sub-Hz square waves would be to synthesize a sine wave at a high multiple of the desired frequency and then divide down the comparator output in logic.

I was surprised and annoyed when I realized what they were doing.  The DS345 isn't a cheap instrument - current price starts at US$2600.  It would have been easy and cheap to add a 'high quality' square wave output with CMOS levels that bypassed all the sine wave and comparator nonsense.  The existing 'function generator' capabilities would be unaffected.

I do not understand the problem.  Transition midpoint timing converters make high resolution time measurements using the same hardware in reverse, so 10 picosecond or better timing resolution should be easy with typical AWG sample rates and resolutions.  A 100 MHz ADC has 10 nanosecond timing resolution, but when used to synthesize a bandwidth limited edge, the timing resolution is increased by the available amplitude resolution and is much better than 10 nanoseconds.

The alternative of including a synthesized square wave generator is unlikely to achieve that kind of timing resolution.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 17793
  • Country: us
  • DavidH
Re: Function generator square wave rise time
« Reply #43 on: March 16, 2025, 08:16:54 pm »
The only audio amp I've tested was a Quad 405 current dumping amp. It delivered full power at 20kHz into a 7ohm resistor. The output risetime was 10us, IIRC, a nice linear slope. I would have used a 4MHz sig gen's square wave, which was more than  fast enough for that job.

When I did my own audio power amplifier design, my fastest function generators were only 2 MHz, but that was plenty fast.  The trick I had to learn was that unless the design makes the mistake of limiting bandwidth with feedback, which causes all kinds of other problems, the raw bandwidth will be much higher than 20 kHz.  My designs using 2 MHz common emitter output transistors had a raw bandwidth of about 600 kHz, which was still within range of my 2 MHz function generators.

Today my fastest function generator is 11 MHz, with 16 nanosecond rise and 20 nanosecond fall times on its square wave and pulse outputs.
 

Offline bdunham7

  • Super Contributor
  • ***
  • Posts: 8858
  • Country: us
Re: Function generator square wave rise time
« Reply #44 on: March 16, 2025, 10:26:47 pm »
Now, since you are a timenut, what bandwidth is good enough for the 1pps/1Hz output from a GPSDO?

As edpalmer42 has said:

Quote
It might be adequate for some applications and totally inadequate for others.

So, good enough for what purpose? 

Here's an example of a 50ms 1PPS pulse run through a 4kHz filter and then displayed directly (a nice, clean and sharp looking picture) and then zoomed in on my scope to demonstrate that the jitter and error between the 1PPS and the scope clock+trigger is under 200ns.
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Offline edpalmer42

  • Super Contributor
  • ***
  • Posts: 2399
  • Country: ca
Re: Function generator square wave rise time
« Reply #45 on: March 16, 2025, 10:59:49 pm »
The Stanford Research DS345 does something very similar.  They create a synthesized sine wave with sub-Hz resolution which is great.  But then they use a comparator to square it up which adds a different source of jitter.  Noise on the sine wave - there's always noise everywhere - causes jitter in the transition points.  This jitter negates the value of the sub-Hz resolution.  I was sort of able to access the high precision signal by using the sync output and the arb waveform capability, but even that had issues.

That seems like an amateur mistake to make by Stanford Research.  I'd think the obvious way to make precision sub-Hz square waves would be to synthesize a sine wave at a high multiple of the desired frequency and then divide down the comparator output in logic.

I was surprised and annoyed when I realized what they were doing.  The DS345 isn't a cheap instrument - current price starts at US$2600.  It would have been easy and cheap to add a 'high quality' square wave output with CMOS levels that bypassed all the sine wave and comparator nonsense.  The existing 'function generator' capabilities would be unaffected.

I do not understand the problem.  Transition midpoint timing converters make high resolution time measurements using the same hardware in reverse, so 10 picosecond or better timing resolution should be easy with typical AWG sample rates and resolutions.  A 100 MHz ADC has 10 nanosecond timing resolution, but when used to synthesize a bandwidth limited edge, the timing resolution is increased by the available amplitude resolution and is much better than 10 nanoseconds.

The alternative of including a synthesized square wave generator is unlikely to achieve that kind of timing resolution.

The problem is that they created this really precise DDS sine wave in the digital domain and then moved it to the analog domain and used a high-speed comparator to convert it to a square wave.  By doing that they made it vulnerable to any noise that happened to be on the sine wave.  This noise converts to timing jitter in the resulting square wave.

Don't get me wrong - it works fine.  But I was hoping to get a DDS-derived square wave and I got an analog-derived square wave.  The difference is huge.  In normal operating mode, the sync output is derived from the 'analog' square wave.  I measured the Std. Dev. of the period of a 1 Hz square wave as ~100us.  In Arb mode, the sync output is derived from the DDS circuitry.  The Std. Dev. of a 1 Hz Arb-generated square wave was ~37 ps.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 22155
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Function generator square wave rise time
« Reply #46 on: March 16, 2025, 11:02:43 pm »
Now, since you are a timenut, what bandwidth is good enough for the 1pps/1Hz output from a GPSDO?

As edpalmer42 has said:

Quote
It might be adequate for some applications and totally inadequate for others.

So, good enough for what purpose? 

Here's an example of a 50ms 1PPS pulse run through a 4kHz filter and then displayed directly (a nice, clean and sharp looking picture) and then zoomed in on my scope to demonstrate that the jitter and error between the 1PPS and the scope clock+trigger is under 200ns.

That's a weird reordering of the previous conversation, presumably to (try to) make your point.

I'd prefer a timenut to comment, but that brigade seems to start at 10-12, and my relatively crude Agilent 53310a MDA/TIA had displays with 14 decimal digits. Bloody difficult to read, since they don't have thousands separators.

Hence it looks like your concept falls short by many orders of magnitude.
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 bdunham7

  • Super Contributor
  • ***
  • Posts: 8858
  • Country: us
Re: Function generator square wave rise time
« Reply #47 on: March 16, 2025, 11:07:58 pm »
Hence it looks like your concept falls short by many orders of magnitude.

You think that GPSDO individual 1PPS pulses rising edges are accurate to one part in 1012
A 3.5 digit 4.5 digit 5 digit 5.5 digit 6.5 digit 7.5 digit DMM is good enough for most people.
 

Online tggzzz

  • Super Contributor
  • ***
  • Posts: 22155
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Function generator square wave rise time
« Reply #48 on: March 16, 2025, 11:29:15 pm »
Hence it looks like your concept falls short by many orders of magnitude.

You think that GPSDO individual 1PPS pulses rising edges are accurate to one part in 1012 ?

Depends on the oscillator (not GPS receiver). Have a look at some Allen Deviation charts.
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 David Hess

  • Super Contributor
  • ***
  • Posts: 17793
  • Country: us
  • DavidH
Re: Function generator square wave rise time
« Reply #49 on: March 17, 2025, 01:12:13 am »
I do not understand the problem.  Transition midpoint timing converters make high resolution time measurements using the same hardware in reverse, so 10 picosecond or better timing resolution should be easy with typical AWG sample rates and resolutions.  A 100 MHz ADC has 10 nanosecond timing resolution, but when used to synthesize a bandwidth limited edge, the timing resolution is increased by the available amplitude resolution and is much better than 10 nanoseconds.

The alternative of including a synthesized square wave generator is unlikely to achieve that kind of timing resolution.

The problem is that they created this really precise DDS sine wave in the digital domain and then moved it to the analog domain and used a high-speed comparator to convert it to a square wave.  By doing that they made it vulnerable to any noise that happened to be on the sine wave.  This noise converts to timing jitter in the resulting square wave.

Don't get me wrong - it works fine.  But I was hoping to get a DDS-derived square wave and I got an analog-derived square wave.  The difference is huge.  In normal operating mode, the sync output is derived from the 'analog' square wave.  I measured the Std. Dev. of the period of a 1 Hz square wave as ~100us.  In Arb mode, the sync output is derived from the DDS circuitry.  The Std. Dev. of a 1 Hz Arb-generated square wave was ~37 ps.

Ah, I see the difference then.  They needed to create a bandwidth limited edge with multiple points rather than the slow edge of a sine wave.  I wonder why they did not.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf