A square wave sounds strange because it consists of a fundamental frequency and an infinite series of odd harmonics. Unlike most naturally occurring sounds or musical tones, which consist of a fundamental frequency and a series of harmonics that decrease in intensity as they get higher, a square wave has equal amplitude for each harmonic.
The harmonics in a square wave are all integer multiples of the fundamental frequency, meaning that the second harmonic is twice the frequency, the third harmonic is three times the frequency, and so on. This creates a rich spectrum of harmonics, which can sound harsh or artificial to our ears.
The unique characteristic of the square wave is its rapid transition between two levels (high and low) with no smooth changes in between. This sudden transition causes the waveform to contain high-frequency components that are not present in other waveforms with gradual transitions. These high-frequency harmonics contribute to the sharp, buzzing, or abrasive quality of the sound.
Additionally, the equal amplitude of all harmonics in a square wave creates a unique timbre or tonal quality. Most natural sounds and musical instruments have a more complex harmonic structure, with different amplitudes for each harmonic, resulting in a more pleasing and familiar sound. The square wave's uniform amplitude distribution gives it a distinct, synthetic, and somewhat unnatural character.
Therefore, the combination of the sharp transitions and equal amplitude harmonics in a square wave contributes to its unique and often strange or synthetic sound.