Talk:Square wave

message: ~What does f in
: x_{\mathrm{square}}(t) = \frac{4}{\pi} \sum_{k=1}^\infty {\sin{\left ((2k-1)2\pi ft \right )}\over(2k-1)}
stand for? It's just a typo, isn't it?
Ocolon 17:37, 21 February 2007 (UTC)
replies: text: I deleted the f after having a look at mathworld.wolfram.com —The preceding unsigned comment was added by Ocolon (talk • contribs) 08:02, 23 February 2007 (UTC)

text: Oops. f is the frequency here, isn't it? I undid my edit. Ocolon 08:05, 23 February 2007 (UTC)

text: An ideal square wave requires that the signal changes from the maximum to the minimum state instantaneously and cleanly, without any delay. Clearly, this is almost impossible to achieve. In practicle, actual square waves are only approximations, and have ringing artefacts in the transition. This is further clear from the Fourier series: note that this implies that a square wave contains infinitely many harmonic components. In practice, this cannot occur as this would require infinite energy.
Which is it? Almost impossible, or impossible?  This paragraph is confused, and a clearer treatment is needed, if we are to state that square waves are unphysical. In particular, a simple square wave does not have infinite energy: it has the same energy as a DC signal of the same amplitude. What is infeasible is the infinite bandwidth. -- The Anome 08:51, 23 Sep 2003 (UTC)
thread_title:  What does 

message: what's the use of  square wave?
:Can you be more specific? - Omegatron 15:02, July 21, 2005 (UTC)
:Hmmm, it's like asking, what is the use of green, or of freezing... A square wave is just a change of state between two levels that occurs almost instantaneously, it doesn't have a use, because it's just a description of something else. However, a square wave that occurs in a physical medium, such as a change of voltage in an electronic circuit, that has millions of uses. For example, the master oscillator inside the computer you are reading this with now generates a square wave, and that is used to clock all the circuitry in the computer in lock step, so things happen in a regular progression. Square waves are ubiquitous in all forms of electronics, but especially digital circuits, because it is like a binary stream 1,0,1,0,1,0,1,0... and that is very useful for measuring time, which turns out to be universally necessary. Graham 03:59, 22 July 2005 (UTC)
thread_title:  what's the use of a square wave? 

message: "However, circuits using sine waves tend to consume more power, so square waves are used wherever possible."
:Why? - Omegatron 20:24, July 22, 2005 (UTC)
My reasoning is that square wave clocks are generated by CMOS devices that are either fully on or fully off, so there is little power dissipation in the output transistors. Sine waves have to be generated and buffered by linear devices, which use more power. It's like the difference between Class A (linear) and Class D (PWM) audio amplifiers. I'm sure you know what I mean. However, I just looked at the specs of some square and sine wave clock oscillators, and to my surprise the sines were no more power-hungry than the squares. Perhaps my intuition was wrong. I'll have to look further into this. --Heron 21:44, 22 July 2005 (UTC)
replies: text: Ah.  Well my initial intuition was that a square wave carries more energy than a sine wave of the same amplitude.  I'm sure it's more involved than either of us are thinking at first glance.  I hear that computer clocks are at such high frequency they can't get anywhere near a square wave anyway, with all the parasitics and so on. - Omegatron 21:59, July 22, 2005 (UTC)
It looks as if there is no clear winner in the power stakes, so I removed the relevant sentence from the article. I was trying to explain why most circuits use square clocks and not sinusoidal ones, but I picked the wrong reason. The true reason is probably complexity: a square wave oscillator can be made of just a CMOS inverter and a crystal , and a clock buffer can be just a non-inverting logic gate; while sine wave clock oscillators are specialised devices, and I can't find any references to monolithic sine wave clock buffers. --Heron 12:08, 23 July 2005 (UTC)

text: Yeah, that's probably all it is.  And the sinishness just comes about because of filtering from transmission line effects or whatever. - Omegatron 13:44, July 23, 2005 (UTC)
Oh no, I didn't mean that sine wave clocks are accidental. Some devices, like the ADCs I mentioned, explicitly support differential sine wave clocks, and you can buy sine wave clock generators to drive them. They are available from all good oscillator suppliers (like this one) and come in leaded and SMT packages that look like square-wave crystal oscillators. My point is that this is all too expensive for the average digital circuit, so designers stick to square waves where possible.
I notice we have an article on clock signals, so I'll put some information there once I get it sorted out in my mind. --Heron 14:07, 23 July 2005 (UTC)
thread_title:  square vs sine 

message: I heard this kind of wave was used a lot in old video game systems (Game boys).  Should this be mentioned in the article?
Also, I'm looking for a sound editor that allows for easy editing of square waves to make a melody (like was in game boy games).  Anybody know where I can find one, and should it be posted under External Links? 71.0.241.224 01:59, 15 March 2007 (UTC)
thread_title:  Video games 

message: how about the x'th root of sin(x) where x is odd?
I've fooled around with the trig functions before on my TI 84 and noticed that as x gets higher and higher, the graph looks more and more like a sine wave. VentusIgnis 20:31, 18 June 2007 (UTC)
thread_title:  alternate formula? 

message: When I listen to the two sound examples provided, I can't hear that the 3500 Hz tone has higher frequency than the 1000 Hz tone. It sounds the other way, but I know the actual frequencies are correct. Maybe this artifact is because the frequencies are rather high, and because they are compressed with ogg vorbis. (I assume it's vorbis, since the container format is ogg). Lossy compression formats are not optimized for square waves, but for speech and music. It would be better to (1) lower the frequency to, say, 440 Hz and 1320 Hz and (2) use a non-lossy format such as wav. The duration can be lowered, since 5 seconds of high amplitude square wave is quite annoying. HelgeStenstrom (talk) 15:53, 13 March 2010 (UTC)
replies: text: Without actually trying the experiment, that's quite interesting. I don't think the compression algorithm is likely to screw up to that degree. Did you try a frequency analysis of the sound? I can take a punt at a reason, but I'd rather you did some investigation yourself. Greglocock (talk) 09:53, 14 March 2010 (UTC)
replies: text: Incidentally, subjectively over my crap laptop speakers I don't agree, but I don't think humans are very good at determining the fundamental frequency of a square wave. Greglocock (talk) 09:59, 14 March 2010 (UTC)
replies: text: It would be better with sound examples where the fundamental frequency is in the musically usable region, let's say about 200 to 800 Hz. A square wave of 3.5 kHz has only three audible harmonics: 3.5, 10.5 and 17.5 KHz, since only odd harmonics are present, and we cannot hear above 20 kHz. With a fundamental frequency of 400 Hz, many more harmonics would be heard, an the sound would more closely resemble an actual square wave. --HelgeStenstrom (talk) 11:40, 26 April 2010 (UTC)
replies: text: I performed some analysis on the two tones, and as a result, I deleted the supposed 3500 Hz wave. That "higher frequency" square wave looked a lot more like a broad-spectrum crest wave, with many, many frequency spikes occurring regularly from low to high frequency. A 3500 Hz square wave would only have three primary frequency strengths: 3.5k, 10.5k, and 17.5k. This one was all over the map! The article does not need to have more than one square wave listening example, and the 1000 Hz wave sounds (and measures) good enough for me, even though it is OGG. Binksternet (talk) 15:22, 26 April 2010 (UTC)
thread_title:  Sound example sounds terrible 

message: I don't really have the ability to fix the image, but hopefully someone who does will read this post. I'm pretty sure that the amplitudes of the frequencies in the frequency spectrum are incorrect. For a square wave with amplitude of 1, The amplitude of the fundamental should be 1.273 ( 4/π to be specific)  — Preceding unsigned comment added by GuitarJoe48 (talk • contribs) 03:27, 28 January 2011 (UTC)
thread_title:  Image Incorrect 

message: You may want to mention that the Fourier series for a squarewave made with sine waves is as described (essentially 1 + 1/3 + 1/5 + 1/7 + 1/9 + 1/11...), but if the squarewave is made using cosines, the series is (essentially) 1 -1/3 + 1/5 -1/7 +1/9 -1/11..., alternating signs like this. 
71.139.165.48 (talk) 06:16, 2 December 2012 (UTC)
thread_title:  Sine vs Cosine 

message: Trying to use this page as a reference, I found the following issues :
# In the Fourier transform and in the definition based on the sgn function (which should come first by the way), the discontinuities are localized at nT, but in some other defs, they are at nT+1/2.
# In some defs, it goes from -1 to 1 and in some others it goes from 0 to 1.
# The Fourier transform animated gif is strongly misleading. It is actually a Discrete Fourier transform, while periodical functions are better described by standard Fourier series. The DFT frequency spectrum has been shifted so that the lower frequencies are the farthest from zero. It has also been renormalized so that the amplitude of the first sine wave is 1 and not 4/π.
I do not have enough time to fix this myself, so if someone reads this, please make the surgery! Mathieu Perrin (talk) 09:24, 26 September 2014 (UTC)
thread_title:  Please fix the following issues 

message: Please add spectrum of square wave in frequency domain tooAt Last ... (talk) 10:17, 24 November 2016 (UTC)
replies: text: Already there. Hyacinth (talk) 00:02, 4 May 2018 (UTC)
thread_title: Lack of spectrum