All Topics  
Square wave

 

   Email Print
   Bookmark   Link






 

Square wave



 
 
A square wave is a kind of non-sinusoidal waveform, most typically encountered in electronics
Electronics

Electronics refers to the flow of charge through nonmetal electrical conductor , whereas electrical refers to the flow of charge through metal electrical conductor....
 and signal processing
Signal processing

Signal processing is the analysis, interpretation, and manipulation of signal . Signals of interest include: audio signal processing, , time-varying measurement values and sensor data, for example biological data such as electrocardiograms, control system signals, telecommunication transmission signals such as radio signals, and many others....
. An ideal square wave alternates regularly and instantaneously between two levels.

Origins and uses
Square waves are universally encountered in digital
Digital

A digital system uses discrete values, usually but not always symbolized numerically to represent information for input, processing, transmission, storage, etc....
 switching circuits and are naturally generated by binary (two-level) logic devices. They are used as timing references or "clock signal
Clock signal

In electronics and especially Synchronous logic digital circuits, a clock signal is a Signalling used to coordinate the actions of two or more Electronic circuit....
s", because their fast transitions are suitable for triggering synchronous logic circuits at precisely determined intervals.






Discussion
Ask a question about 'Square wave'
Start a new discussion about 'Square wave'
Answer questions from other users
Full Discussion Forum



Recent Posts









Encyclopedia


A square wave is a kind of non-sinusoidal waveform, most typically encountered in electronics
Electronics

Electronics refers to the flow of charge through nonmetal electrical conductor , whereas electrical refers to the flow of charge through metal electrical conductor....
 and signal processing
Signal processing

Signal processing is the analysis, interpretation, and manipulation of signal . Signals of interest include: audio signal processing, , time-varying measurement values and sensor data, for example biological data such as electrocardiograms, control system signals, telecommunication transmission signals such as radio signals, and many others....
. An ideal square wave alternates regularly and instantaneously between two levels.

Origins and uses


Square waves are universally encountered in digital
Digital

A digital system uses discrete values, usually but not always symbolized numerically to represent information for input, processing, transmission, storage, etc....
 switching circuits and are naturally generated by binary (two-level) logic devices. They are used as timing references or "clock signal
Clock signal

In electronics and especially Synchronous logic digital circuits, a clock signal is a Signalling used to coordinate the actions of two or more Electronic circuit....
s", because their fast transitions are suitable for triggering synchronous logic circuits at precisely determined intervals. However, as the frequency-domain graph shows, square waves contain a wide range of harmonics; these can generate electromagnetic radiation
Electromagnetic radiation

Electromagnetic radiation takes the form of wave propagation waves in a vacuum or in matter. EM radiation has an electric field and magnetic field component which oscillate in phase perpendicular to each other and to the direction of energy Wave propagation....
 or pulses of current that interfere with other nearby circuits, causing noise
Noise

In common use, the word noise means unwanted sound or noise pollution. In electronics noise can refer to the electronic signal corresponding to acoustic noise or the electronic signal corresponding to the noise commonly seen as 'Noise ' on a degraded television or video image....
 or errors. To avoid this problem in very sensitive circuits such as precision analog-to-digital converter
Analog-to-digital converter

An analog-to-digital converter is a device which converts continuous signal to Discrete signal digital numbers. The reverse operation is performed by a digital-to-analog converter ....
s, sine wave
Sine wave

The sine wave or sinusoid is a function that occurs often in mathematics, physics, signal processing, hearing , electrical engineering, and many other fields....
s are used instead of square waves as timing references.

In musical terms, they are often described as sounding hollow, and are therefore used as the basis for wind instrument sounds created using subtractive synthesis
Subtractive synthesis

Subtractive synthesis is a method of subtracting harmonic content from a sound via sound synthesis, characterised by the application of an audio filter to an audio signal....
. Additionally, the distortion effect used on electric guitar clips the outermost regions of the waveform, causing it to increasingly resemble a square wave as more distortion is applied.

Simple two-level Rademacher
Hans Rademacher

Hans Adolph Rademacher was a Germany mathematician, known for work in mathematical analysis and number theory. He emigrated from Europe in 1934....
 functions are square waves.

Examining the square wave


In contrast to the sawtooth wave
Sawtooth wave

The sawtooth wave is a kind of non-sinusoidal waveform. It is named a sawtooth based on its resemblance to the teeth on the blade of a saw.The convention is that a sawtooth wave ramps upward and then sharply drops....
, which contains all integer harmonic
Harmonic

In acoustics and telecommunication, a harmonic of a wave is a component frequency of the Signalling that is an integer multiple of the fundamental frequency....
s, the square wave contains only odd integer harmonics.

Using Fourier series
Fourier series

In mathematics, a Fourier series decomposes a periodic function into a sum of simple oscillating functions, namely sine wave . The study of Fourier series is a branch of Fourier analysis....
 we can write an ideal square wave as an infinite series of the form

A curiosity of the convergence of the Fourier series representation of the square wave is the Gibbs phenomenon
Gibbs phenomenon

In mathematics, the Gibbs phenomenon , named after the American physicist Willard Gibbs, is the peculiar manner in which the Fourier series of a piecewise continuously differentiable periodic function f behaves at a jump discontinuity: the nth partial sum of the Fourier series has large oscillations near the jump, which might increase...
. Ringing artifacts in non-ideal square waves can be shown to be related to this phenomenon. The Gibbs phenomenon can be prevented by the use of s-approximation
Sigma approximation

In mathematics, s-approximation adjusts a Fourier series to eliminate the Gibbs phenomenon which would otherwise occur at discontinuities.A s-approximated summation for a series of period T can be written as follows:...
, which uses the Lanczos sigma factors to help the sequence converge more smoothly.

An ideal square wave requires that the signal changes from the high to the low state cleanly and instantaneously. This is impossible to achieve in real-world systems, as it would require infinite bandwidth.

Synthesis Square
Real-world square-waves have only finite bandwidth, and often exhibit ringing
Ringing

ElectricityIn electricity circuits, ringing is an unwanted oscillation of a voltage or Current . It happens when an electrical pulse causes the parasitic capacitor and inductor in the circuit to resonance at their characteristic frequency....
 effects similar to those of the Gibbs phenomenon, or ripple effects similar to those of the s-approximation.

For a reasonable approximation to the square-wave shape, at least the fundamental and third harmonic need to be present, with the fifth harmonic being desirable. These bandwidth requirements are important in digital electronics, where finite-bandwidth analog approximations to square-wave-like waveforms are used. (The ringing transients are an important electronic consideration here, as they may go beyond the electrical rating limits of a circuit or cause a badly positioned threshold to be crossed multiple times.)

The ratio of the high period to the total period of a square wave is called the duty cycle
Duty cycle

In telecommunications and electronics, the duty cycle is the fraction of time that a system is in an "active" state. In particular, it is used in the following contexts:...
. A true square wave has a 50% duty cycle - equal high and low periods. The average level of a square wave is also given by the duty cycle, so by varying the on and off periods and then averaging, it is possible to represent any value between the two limiting levels. This is the basis of pulse width modulation.

Characteristics of imperfect square waves


As already mentioned, an ideal square wave has instantaneous transitions between the high and low levels. In practice, this is never achieved because of physical limitations of the system that generates the waveform. The times taken for the signal to rise from the low level to the high level and back again are called the rise time
Rise time

In electronics, when describing a voltage or current step function, rise time refers to the time required for a signal to change from a specified low value to a specified high value....
 and the fall time
Fall time

In electronics, fall time is the time required for the amplitude of a pulse to decrease from a specified value to another specified value . Limits on undershoot and oscillation may need to be specified when specifying fall time limits....
 respectively.

If the system is overdamped
Damping

Damping is any effect, either deliberately engendered or inherent to a system, that tends to reduce the amplitude of oscillations of an oscillatory system....
, then the waveform may never actually reach the theoretical high and low levels, and if the system is underdamped, it will oscillate about the high and low levels before settling down. In these cases, the rise and fall times are measured between specified intermediate levels, such as 5% and 95%, or 10% and 90%. Formulas exist that can determine the approximate bandwidth of a system given the rise and fall times of the waveform.

Other definitions


The square wave has many definitions, which are equivalent except at the discontinuities:

It can be defined as simply the sign function
Sign function

In mathematics, the sign function is an Even and odd functions function that extracts the negative and non-negative numbers of a real number....
 of a sinusoid:

which will be 1 when the sinusoid is positive, −1 when the sinusoid is negative, and 0 at the discontinuities. It can also be defined with respect to the Heaviside step function
Heaviside step function

The Heaviside step function, H, also called the unit step function, is a continuous function Function whose value is 0 for negative argument and 1 for positive argument....
 u(t) or the rectangular function
Rectangular function

The rectangular function is defined as:'Alternate definitions of the function define to be 0, 1, or undefined. We can also express the rectangular function in terms of the Heaviside step function, :'...
 ?(t):

T is 2 for a 50% duty cycle
Duty cycle

In telecommunications and electronics, the duty cycle is the fraction of time that a system is in an "active" state. In particular, it is used in the following contexts:...
. It can also be defined in a piecewise way:

when

See also

  • Rectangular function
    Rectangular function

    The rectangular function is defined as:'Alternate definitions of the function define to be 0, 1, or undefined. We can also express the rectangular function in terms of the Heaviside step function, :'...
  • Pulse wave
    Pulse wave

    A pulse wave or pulse train is a kind of non-sinusoidal waveform that is similar to a square wave, but does not have the symmetrical shape associated with a perfect square wave....
  • Sine wave
    Sine wave

    The sine wave or sinusoid is a function that occurs often in mathematics, physics, signal processing, hearing , electrical engineering, and many other fields....
  • Triangle wave
    Triangle wave

    A triangle wave is a non-sinusoidal waveform named for its triangular shape.Like a square wave, the triangle wave contains only odd harmonics....
  • Sawtooth wave
    Sawtooth wave

    The sawtooth wave is a kind of non-sinusoidal waveform. It is named a sawtooth based on its resemblance to the teeth on the blade of a saw.The convention is that a sawtooth wave ramps upward and then sharply drops....
  • Waveform
    Waveform

    Waveform means the shape and form of a signal such as a wave moving in a solid, liquid or gaseous medium.In many cases the medium in which the wave is being propagated does not permit a direct visual image of the form....
  • Sound
    Sound

    Sound is vibration transmitted through a solid, liquid, or gas, composed of frequencies within the range of hearing and of a threshold of hearing to be heard, or the sensation stimulated in organs of hearing by such vibrations....
  • Multivibrator
    Multivibrator

    A multivibrator is an electronic circuit used to implement a variety of simple two-state systems such as oscillators, timers and flip-flop s. It is characterized by two amplifying devices cross-coupled by resistors and capacitors....