fbpx
Wikipedia

Square wave

A square wave is a non-sinusoidal periodic waveform in which the amplitude alternates at a steady frequency 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.

Square wave
Sine, square, triangle, and sawtooth waveforms
General information
General definition
Fields of applicationElectronics, synthesizers
Domain, Codomain and Image
Domain
Codomain
Basic features
ParityOdd
Period1
AntiderivativeTriangle wave
Fourier series

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 true square wave has a 50% duty cycle (equal high and low periods).

Square waves are often encountered in electronics and signal processing, particularly digital electronics and digital signal processing. Its stochastic 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. Square waves are typically generated by metal–oxide–semiconductor field-effect transistor (MOSFET) devices due to their rapid on–off electronic switching behavior, in contrast to bipolar junction transistors (BJTs) which slowly generate signals more closely resembling sine waves rather than square waves.[1]

Square waves are used as timing references or "clock signals", 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 or pulses of current that interfere with other nearby circuits, causing noise or errors. To avoid this problem in very sensitive circuits such as precision analog-to-digital converters, sine waves 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. Additionally, the distortion effect used on electric guitars clips the outermost regions of the waveform, causing it to increasingly resemble a square wave as more distortion is applied.

Simple two-level Rademacher functions 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 of a sinusoid:

 
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 u(t) or the rectangular function Π(t):

 

A square wave can also be generated using the floor function directly:

 
and indirectly:
 

Using the fourier series (below) one can show that the floor function may be written in trigonometric form [2]

 

Fourier analysis

 
The six arrows represent the first six terms of the Fourier series of a square wave. The two circles at the bottom represent the exact square wave (blue) and its Fourier-series approximation (purple).
 
(Odd) harmonics of a 1000 Hz square wave
 
Graph showing the first 3 terms of the Fourier series of a square wave

Using Fourier expansion with cycle frequency f over time t, an ideal square wave with an amplitude of 1 can be represented as an infinite sum of sinusoidal waves:

 

The ideal square wave contains only components of odd-integer harmonic frequencies (of the form 2π(2k − 1)f). Sawtooth waves and real-world signals contain all integer harmonics.

A curiosity of the convergence of the Fourier series 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.

 
Animation of the additive synthesis of a square wave with an increasing number of harmonics

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 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

References

  1. ^ "Applying MOSFETs to Today's Power-Switching Designs". Electronic Design. 23 May 2016. Retrieved 10 August 2019.
  2. ^ https://www.wolframalpha.com/input?i=%5Csum_%7Bn%3D1%7D%5E%7B%5Cinfty%7D%5Cfrac%7B%5Csin%5Cleft%28%5Cleft%282n-1%5Cright%29x%5Cright%29%7D%7B2n-1%7D. {{cite web}}: Missing or empty |title= (help)

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.
  • Flash applets Square wave.

square, wave, this, article, about, waveform, type, ocean, surface, wave, cross, this, article, needs, additional, citations, verification, please, help, improve, this, article, adding, citations, reliable, sources, unsourced, material, challenged, removed, fi. This article is about the waveform For the type of ocean surface wave see Cross sea This article needs additional citations for verification Please help improve this article by adding citations to reliable sources Unsourced material may be challenged and removed Find sources Square wave news newspapers books scholar JSTOR December 2019 Learn how and when to remove this template message A square wave is a non sinusoidal periodic waveform in which the amplitude alternates at a steady frequency 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 Square waveSine square triangle and sawtooth waveformsGeneral informationGeneral definitionx t 4 t 2 2 t 1 2 t Z displaystyle x t 4 left lfloor t right rfloor 2 left lfloor 2t right rfloor 1 2t notin mathbb Z Fields of applicationElectronics synthesizersDomain Codomain and ImageDomainR n 2 n Z displaystyle mathbb R setminus left tfrac n 2 right n in mathbb Z Codomain 1 1 displaystyle left 1 1 right Basic featuresParityOddPeriod1AntiderivativeTriangle waveFourier seriesx t 4 p k 1 1 2 k 1 sin 2 p 2 k 1 t displaystyle x t frac 4 pi sum k 1 infty frac 1 2k 1 sin left 2 pi left 2k 1 right t right Square wave sound sample source source 5 seconds of square wave at 220 Hz Problems playing this file See media help 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 true square wave has a 50 duty cycle equal high and low periods Square waves are often encountered in electronics and signal processing particularly digital electronics and digital signal processing Its stochastic counterpart is a two state trajectory Contents 1 Origin and uses 2 Definitions 3 Fourier analysis 4 Characteristics of imperfect square waves 5 See also 6 References 7 External linksOrigin and uses EditSquare waves are universally encountered in digital switching circuits and are naturally generated by binary two level logic devices Square waves are typically generated by metal oxide semiconductor field effect transistor MOSFET devices due to their rapid on off electronic switching behavior in contrast to bipolar junction transistors BJTs which slowly generate signals more closely resembling sine waves rather than square waves 1 Square waves are used as timing references or clock signals 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 or pulses of current that interfere with other nearby circuits causing noise or errors To avoid this problem in very sensitive circuits such as precision analog to digital converters sine waves 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 Additionally the distortion effect used on electric guitars clips the outermost regions of the waveform causing it to increasingly resemble a square wave as more distortion is applied Simple two level Rademacher functions are square waves Definitions EditThe square wave in mathematics has many definitions which are equivalent except at the discontinuities It can be defined as simply the sign function of a sinusoid x t sgn sin 2 p t T sgn sin 2 p f t v t sgn cos 2 p t T sgn cos 2 p f t displaystyle begin aligned x t amp operatorname sgn left sin frac 2 pi t T right operatorname sgn sin 2 pi ft v t amp operatorname sgn left cos frac 2 pi t T right operatorname sgn cos 2 pi ft end aligned 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 u t or the rectangular function P t x t 2 n P 2 t n T T 1 2 1 2 n u t T n u t T n 1 2 1 displaystyle begin aligned x t amp 2 left sum n infty infty Pi left frac 2 t nT T frac 1 2 right right 1 amp 2 sum n infty infty left u left frac t T n right u left frac t T n frac 1 2 right right 1 end aligned A square wave can also be generated using the floor function directly x t 2 2 f t 2 f t 1 displaystyle x t 2 left 2 lfloor ft rfloor lfloor 2ft rfloor right 1 and indirectly x t 1 2 f t displaystyle x t left 1 right lfloor 2ft rfloor Using the fourier series below one can show that the floor function may be written in trigonometric form 2 2 p arctan tan p f t 2 2 p arctan cot p f t 2 displaystyle frac 2 pi arctan left tan left frac pi ft 2 right right frac 2 pi arctan left cot left frac pi ft 2 right right Fourier analysis Edit The six arrows represent the first six terms of the Fourier series of a square wave The two circles at the bottom represent the exact square wave blue and its Fourier series approximation purple Odd harmonics of a 1000 Hz square wave Graph showing the first 3 terms of the Fourier series of a square wave Using Fourier expansion with cycle frequency f over time t an ideal square wave with an amplitude of 1 can be represented as an infinite sum of sinusoidal waves x t 4 p k 1 sin 2 p 2 k 1 f t 2 k 1 4 p sin w t 1 3 sin 3 w t 1 5 sin 5 w t where w 2 p f displaystyle begin aligned x t amp frac 4 pi sum k 1 infty frac sin left 2 pi 2k 1 ft right 2k 1 amp frac 4 pi left sin omega t frac 1 3 sin 3 omega t frac 1 5 sin 5 omega t ldots right amp text where omega 2 pi f end aligned Additive square demo source source source 220 Hz square wave created by harmonics added every second over sine wave Problems playing this file See media help The ideal square wave contains only components of odd integer harmonic frequencies of the form 2p 2k 1 f Sawtooth waves and real world signals contain all integer harmonics A curiosity of the convergence of the Fourier series 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 s 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 Animation of the additive synthesis of a square wave with an increasing number of harmonics 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 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 Characteristics of imperfect square waves EditAs 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 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 EditList of periodic functions Rectangular function Pulse wave Sine wave Triangle wave Sawtooth wave Waveform Sound Multivibrator Ronchi ruling a square wave stripe target used in imaging Cross sea Clarinet a musical instrument that produces odd overtones approximating a square wave References Edit Applying MOSFETs to Today s Power Switching Designs Electronic Design 23 May 2016 Retrieved 10 August 2019 https www wolframalpha com input i 5Csum 7Bn 3D1 7D 5E 7B 5Cinfty 7D 5Cfrac 7B 5Csin 5Cleft 28 5Cleft 282n 1 5Cright 29x 5Cright 29 7D 7B2n 1 7D a href Template Cite web html title Template Cite web cite web a Missing or empty title help External links EditFourier 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 Flash applets Square wave Retrieved from https en wikipedia org w index php title Square wave amp oldid 1135054254, wikipedia, wiki, book, books, library,

article

, read, download, free, free download, mp3, video, mp4, 3gp, jpg, jpeg, gif, png, picture, music, song, movie, book, game, games.