# If I'm amplifying a triangle or square wave, does the GBWP of my op-amp need to be higher?

I want to amplify a 4 MHz triangle or square wave by 2 using an op-amp. Do I need an ~8 MHz op amp, or a much higher rated (and more expensive) device to handle the harmonics?

Short Answer- Yes. Minimum 3x the fundamental frequency for triangle and 5x for square wave. (9x gets you pretty good, low ripple answer for both)

Long Answer. Both of these waveforms are the sum of multiple sine waves. To get a reasonable (and your definition of this may vary) quality square wave, you need at least the first 5 or 6 harmonics (1x,3x,5x,7x,9x, and 11x multiples of the fundamental). If your opamp doesn't pass these frequencies, then you'll get distortion in the output.

The links below will show you how to build up triangle and square waves mathematically if you want to see for yourself how much fidelity you get for a given bandwidth.

References:

http://en.wikipedia.org/wiki/Triangle_wave

http://en.wikipedia.org/wiki/Square_wave

• You can try this yourself here: falstad.com/fourier – AndreKR Feb 13 '11 at 17:52
• also consider the slew rate of the op-amp as that may be the limiting factor in reproduction of square waves with a required edge rise/fall time. – Mark Feb 13 '11 at 18:51
• "Both of these waveforms are the sum of an infinite number of sine waves". You need to decide how many you need in your output. – endolith Feb 15 '11 at 15:49
• To what extent is the GBWP a result of linear or non-linear factors? To the extent that it's a result of purely-linear factors the Fourier decomposition of the input would be relevant, but if the GBWP describes a worst-case behavioral envelope of an op-amp's non-linear behaviors, the higher-frequency components may not be relevant. – supercat Oct 28 '16 at 16:04

To perfectly amplify a square wave, you'll need an op-amp with infinite bandwidth.

What is the square wave used for? You probably don't need to keep all of those harmonics.

• For a signal generator, the purer the better really. – Thomas O Feb 13 '11 at 20:51
• OK, good luck finding that infinite-bandwidth op-amp then. – markrages Feb 13 '11 at 21:35

You'll need at least 3x for a square wave.

• perhaps much more depending on the required edge rise/fall times. – Mark Feb 13 '11 at 17:29
• If you don't have at least 3x it will look like a slightly bumpy sine wave. – starblue Feb 14 '11 at 19:54