Square Wave (waveform)
   HOME

TheInfoList



OR:

A square wave is a non-sinusoidal periodic waveform in which the amplitude alternates at a steady
frequency Frequency is the number of occurrences of a repeating event per unit of time. Frequency is an important parameter used in science and engineering to specify the rate of oscillatory and vibratory phenomena, such as mechanical vibrations, audio ...
between fixed minimum and maximum values, with the same duration at minimum and maximum. In an ideal square wave, the transitions between minimum and maximum are instantaneous. The square wave is a special case of a pulse wave which allows arbitrary durations at minimum and maximum amplitudes. The ratio of the high period to the total period of a pulse wave is called the
duty cycle A duty cycle or power cycle is the fraction of one period in which a signal or system is active. Duty cycle is commonly expressed as a percentage or a ratio. A period is the time it takes for a signal to complete an on-and-off cycle. As a for ...
. A true square wave has a 50% duty cycle (equal high and low periods). Square waves are often encountered in
electronics Electronics is a scientific and engineering discipline that studies and applies the principles of physics to design, create, and operate devices that manipulate electrons and other Electric charge, electrically charged particles. It is a subfield ...
and
signal processing Signal processing is an electrical engineering subfield that focuses on analyzing, modifying and synthesizing ''signals'', such as audio signal processing, sound, image processing, images, Scalar potential, potential fields, Seismic tomograph ...
, particularly
digital electronics Digital electronics is a field of electronics involving the study of digital signals and the engineering of devices that use or produce them. It deals with the relationship between Binary number, binary inputs and outputs by passing electrical s ...
and
digital signal processing Digital signal processing (DSP) is the use of digital processing, such as by computers or more specialized digital signal processors, to perform a wide variety of signal processing operations. The digital signals processed in this manner are a ...
. Its
stochastic Stochastic (; ) is the property of being well-described by a random probability distribution. ''Stochasticity'' and ''randomness'' are technically distinct concepts: the former refers to a modeling approach, while the latter describes phenomena; i ...
counterpart is a two-state trajectory.


Origin and uses

Square waves are universally encountered in digital switching circuits and are naturally generated by binary (two-level) logic devices. They are used as timing references or "
clock signal In electronics and especially synchronous digital circuits, a clock signal (historically also known as ''logic beat'') is an electronic logic signal (voltage or current) which oscillates between a high and a low state at a constant frequency and ...
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 In physics, electromagnetic radiation (EMR) is a self-propagating wave of the electromagnetic field that carries momentum and radiant energy through space. It encompasses a broad spectrum, classified by frequency or its inverse, wavelength ...
or pulses of current that interfere with other nearby circuits, causing
noise Noise is sound, chiefly unwanted, unintentional, or harmful sound considered unpleasant, loud, or disruptive to mental or hearing faculties. From a physics standpoint, there is no distinction between noise and desired sound, as both are vibrat ...
or errors. To avoid this problem in very sensitive circuits such as precision
analog-to-digital converter In electronics, an analog-to-digital converter (ADC, A/D, or A-to-D) is a system that converts an analog signal, such as a sound picked up by a microphone or light entering a digital camera, into a Digital signal (signal processing), digi ...
s,
sine wave A sine wave, sinusoidal wave, or sinusoid (symbol: ∿) is a periodic function, periodic wave whose waveform (shape) is the trigonometric function, trigonometric sine, sine function. In mechanics, as a linear motion over time, this is ''simple ...
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 A wind instrument is a musical instrument that contains some type of resonator (usually a tube) in which a column of air is set into vibration by the player blowing into (or over) a mouthpiece set at or near the end of the resonator. The pitch ...
sounds created using
subtractive synthesis Subtractive synthesis is a method of sound synthesis in which Harmonic_series_(music)#Partial.2C_harmonic.2C_fundamental.2C_inharmonicity.2C_and_overtone, overtones of an audio signal are attenuated by a audio filter, filter to alter the timbre of ...
. They also make up the "beeping" alerts used in many household, commercial, and industrial contexts. Additionally, the distortion effect used on
electric guitar An electric guitar is a guitar that requires external electric Guitar amplifier, sound amplification in order to be heard at typical performance volumes, unlike a standard acoustic guitar. It uses one or more pickup (music technology), pickups ...
s clips the outermost regions of the waveform, causing it to increasingly resemble a square wave as more distortion is applied. Simple two-level
Rademacher function In mathematics, in particular in functional analysis, the Rademacher system, named after Hans Rademacher, is an incomplete orthogonal system of functions on the unit interval of the following form: : \. The Rademacher system is stochastically in ...
s are square waves.


Definitions

The square wave in mathematics has many definitions, which are equivalent except at the discontinuities: It can be defined as simply the
sign function In mathematics, the sign function or signum function (from '' signum'', Latin for "sign") is a function that has the value , or according to whether the sign of a given real number is positive or negative, or the given number is itself zer ...
of a sinusoid: \begin x(t) &= \sgn\left(\sin \frac\right) = \sgn(\sin 2\pi ft) \\ v(t) &= \sgn\left(\cos \frac\right) = \sgn(\cos 2\pi ft), \end which will be 1 when the sinusoid is positive, −1 when the sinusoid is negative, and 0 at the discontinuities. Here, ''T'' is the period of the square wave and ''f'' is its frequency, which are related by the equation ''f'' = 1/''T''. A square wave can also be defined with respect to the
Heaviside step function The Heaviside step function, or the unit step function, usually denoted by or (but sometimes , or ), is a step function named after Oliver Heaviside, the value of which is zero for negative arguments and one for positive arguments. Differen ...
''u''(''t'') or the
rectangular function The rectangular function (also known as the rectangle function, rect function, Pi function, Heaviside Pi function, gate function, unit pulse, or the normalized boxcar function) is defined as \operatorname\left(\frac\right) = \Pi\left(\frac\ri ...
Π(''t''): \begin x(t) &= 2\left sum_^\infty \Pi\left(\frac - \frac\right)\right- 1 \\ &= 2\sum_^\infty \left \left(\frac - n\right) - u \left(\frac - n - \frac \right) \right- 1. \end A square wave can also be generated using the
floor function In mathematics, the floor function is the function that takes as input a real number , and gives as output the greatest integer less than or equal to , denoted or . Similarly, the ceiling function maps to the least integer greater than or eq ...
directly: x(t) = 2\left(2\lfloor ft\rfloor - \lfloor 2 ft\rfloor \right) + 1 and indirectly: x(t) = \left(-1\right)^. Using the fourier series (below) one can show that the floor function may be written in trigonometric form \frac\arctan\left(\tan\left(\frac\right)\right)+\frac\arctan\left(\cot\left(\frac\right)\right)


Fourier analysis

Using Fourier expansion with cycle frequency over time , an ideal square wave with an amplitude of 1 can be represented as an infinite sum of sinusoidal waves: \begin x(t) &= \frac \sum_^\infty \frac \\ &= \frac \left(\sin(\omega t) + \frac \sin(3 \omega t) + \frac \sin(5 \omega t) + \ldots\right), &\text\omega=2\pi f. \end The ideal square wave contains only components of odd-integer
harmonic In physics, acoustics, and telecommunications, a harmonic is a sinusoidal wave with a frequency that is a positive integer multiple of the ''fundamental frequency'' of a periodic signal. The fundamental frequency is also called the ''1st har ...
frequencies (of the form ). A curiosity of the convergence of the
Fourier series A Fourier series () is an Series expansion, expansion of a periodic function into a sum of trigonometric functions. The Fourier series is an example of a trigonometric series. By expressing a function as a sum of sines and cosines, many problems ...
representation of the square wave is the Gibbs phenomenon. 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 σ-approximation, which uses the Lanczos sigma factors to help the sequence converge more smoothly. An ideal mathematical square wave changes between the high and the low state instantaneously, and without under- or over-shooting. This is impossible to achieve in physical systems, as it would require infinite bandwidth. Square waves in physical systems have only finite bandwidth and often exhibit ringing effects similar to those of the Gibbs phenomenon or ripple effects similar to those of the σ-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.)


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 In electronics, when describing a voltage or current step function, rise time is the time taken by a signal to change from a specified low value to a specified high value. These values may be expressed as ratiosSee for example , and . or, equiva ...
'' and the '' fall time'' respectively. If the system is overdamped, 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%. The bandwidth of a system is related to the transition times of the waveform; there are formulas allowing one to be determined approximately from the other.


See also

* List of periodic functions *
Rectangular function The rectangular function (also known as the rectangle function, rect function, Pi function, Heaviside Pi function, gate function, unit pulse, or the normalized boxcar function) is defined as \operatorname\left(\frac\right) = \Pi\left(\frac\ri ...
* Pulse wave *
Sine wave A sine wave, sinusoidal wave, or sinusoid (symbol: ∿) is a periodic function, periodic wave whose waveform (shape) is the trigonometric function, trigonometric sine, sine function. In mechanics, as a linear motion over time, this is ''simple ...
* Triangle wave *
Sawtooth wave The sawtooth wave (or saw wave) is a kind of non-sinusoidal waveform. It is so named based on its resemblance to the teeth of a plain-toothed saw with a zero rake angle. A single sawtooth, or an intermittently triggered sawtooth, is called a ...
*
Waveform In electronics, acoustics, and related fields, the waveform of a signal is the shape of its Graph of a function, graph as a function of time, independent of its time and Magnitude (mathematics), magnitude Scale (ratio), scales and of any dis ...
*
Sound In physics, sound is a vibration that propagates as an acoustic wave through a transmission medium such as a gas, liquid or solid. In human physiology and psychology, sound is the ''reception'' of such waves and their ''perception'' by the br ...
* Multivibrator * Ronchi ruling, a square-wave stripe target used in imaging. * Cross sea *
Clarinet The clarinet is a Single-reed instrument, single-reed musical instrument in the woodwind family, with a nearly cylindrical bore (wind instruments), bore and a flared bell. Clarinets comprise a Family (musical instruments), family of instrume ...
, a musical instrument that produces odd overtones approximating a square wave.


References


External links


Fourier decomposition of a square wave
Interactive demo of square wave synthesis using sine waves, from GeoGebra site.
Square Wave Approximated by Sines
Interactive demo of square wave synthesis using sine waves.

Square wave. {{Waveforms Waveforms Fourier series