0

Forgive me for questionining the fundamentals and this question therefore being not very smart, but I am currently beating my head against the concept of sound generation itself.

I understand so far that every sound is generated as a wave and therefore it can only be done by sinus waves and not just passing single constant values to the soundcard. Instead you have to generate the wave at your samplerate and bitrate with frequency and amplitude and then pass that collection to your card to actually get that sound.

So then, why does the square wave make a sound? It's not a wave, it is exactly that which you should not do, namely just alternating fixed values at different frequencies to get different sounds. That's not a wave at all. Is it because square waves are just a mathematical construct and are not possible in nature, so you just get the sharpest waves possible with your hardware?

2
  • 2
    Speaker goes forwards, speaker goes backwards; air is moved; sound is generated.
    – Tetsujin
    May 7 at 18:27
  • Just an additional observation with this - it's not actually the 'plateau's in the square wave that make the sound, it's the transitions between the plateaus. Evidently, the answer that outlines fourier theory is correct, but it is worth remembering that it is the "Change" in pressure that we experience as sound, not an absolute pressure value. Therefore our ears are actually interpreting the changes in pressure (at the plateau transitions) as the sound that we actually hear.
    – Mark
    Jun 17 at 3:51
2

Every wave is a superposition of multiple sine waves – this is essentially what Fourier theorem says.

This article demonstrates how by summing a sine wave with its odd harmonics (thus wave with frequency f with waves with frequencies 3f, 5f, 7f and so on) with appropriate amplitudes results in formation of a square wave.

https://www.allaboutcircuits.com/textbook/alternating-current/chpt-7/square-wave-signals/

It's worth to note, that as square wave is a sum of infinite number of sine waves with frequencies increasing to infinity, reproducing it would require a system with infinite bandwidth. Any real instrument or speaker may only produce some approximation of a square wave, however the difference will be inaudible.

7
  • Thanks for your answer, then why are square waves used at all? They seem generally worse in their audio qualities, yet old systems like the NES or Commodore lacked sine waves and instead used square pulse waves, triangle waves and sawtooth waves extensively. Why was this used when you had to stack mutliple sine waves when they had issues back then generating just one?
    – uncanny
    May 8 at 7:50
  • Creating a square wave is very easy in electronics. There is no need to "stack any waves", the circuits needed are very simple, much simpler then creating a sine wave. By then filtering the wave, removing higher frequencys, you can then create different timbres. Creating triangle, sawtooth and pulsed waves are easy as well, and they create good raw material for different timbres in a synth.
    – ghellquist
    May 8 at 8:08
  • @uncanny As ghellquist said, you don't need to stack sine waves in order to produce a square wave, but by producing a square wave you in fact produce a sound with very rich odd harmonics content. Now, whether you like the sound or not, that's subjective. When you have many harmonics, you can easily filter out some of them, that's a powerful method of producing various sounds. May 8 at 16:56
  • One of the distortion pedals I made back in the '80's pretty much produced a square wave output - the Op Amp in it was slammed to top and bottom rails on any input signal. It sounded ... okay ...
    – Rory Alsop
    May 8 at 17:26
  • 1
    @uncanny I'm not sure what is unclear to you. This binary shape made of on/off segments is a superposition of multiple (for a true square wave, infinite number) of sine waves. Moreover, any real (thus bandwidth limited) system won't jump between the two states instantaneously; the speaker (or the voltage in the circuit) will be changing smoothly between the two positions, or values, quickly, but with a finite speed. Other artifacts like overshoots will likely occur as well (see en.wikipedia.org/wiki/Gibbs_phenomenon). May 8 at 21:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.