Square Waves and Sound

Thread Starter

Austin Clark

Joined Dec 28, 2011
412
Ok, as many of you know, a square wave can be thought of as a wave with the sum of an infinite series of odd-order harmonics of the fundamental. However, my question is, if you were to grab these harmonics and change their phase, what would the wave potentially look like, and would it SOUND the same? This is something I've always been pretty curious about. A mathematical and/or physiological explanation would be awesome, if possible.

Also, what are the relative amplitudes of the nth harmonics?
 
Last edited:

ramancini8

Joined Jul 18, 2012
473
Eliminate all harmonics and it sounds like a sine wave! Sound is pressure moving air, and different waveforms create different pressure waves. The process of creating the pressure waves in the speaker can act like an integrator.
 

Thread Starter

Austin Clark

Joined Dec 28, 2011
412
Eliminate all harmonics and it sounds like a sine wave! Sound is pressure moving air, and different waveforms create different pressure waves. The process of creating the pressure waves in the speaker can act like an integrator.
I was curious what would happen if the harmonics changed PHASE, not if they were eliminated. However, I really like your note about speakers acting as pressure "integrators". That is, it outputs the CHANGE in pressure, not the actual pressure, because of how the diagram is moved and how it induces current in the voice-coil. A sudden drop in pressure will jerk the diagram out, induce a spike, but once it's pulled out fully it can't move anymore and the induced voltage drops back to zero. It's an interesting insight, one in which ought to be mentioned more.
 

Ron H

Joined Apr 14, 2005
7,063
I was curious what would happen if the harmonics changed PHASE, not if they were eliminated. However, I really like your note about speakers acting as pressure "integrators". That is, it outputs the CHANGE in pressure, not the actual pressure, because of how the diagram is moved and how it induces current in the voice-coil. A sudden drop in pressure will jerk the diagram out, induce a spike, but once it's pulled out fully it can't move anymore and the induced voltage drops back to zero. It's an interesting insight, one in which ought to be mentioned more.
That sounds like a differentiator to me.:confused:

Here is what appears to be a pretty good treatise on your original topic.
 
Last edited:

vk6zgo

Joined Jul 21, 2012
677
(1)
The harmonics fall away in level,so there is not a lot to hear,anyway,after about the 5th harmonic.

(2)
Ears are not very sensitive to phase when both ears hear a mono signal,so I doubt you will hear any difference.
Possibly,if you introduce the normal signal to one ear,then the phase shifted one to the other,you may be able to hear it as "faux stereo".

(3)
Loudspeakers & headphones will have trouble with a square wave,& will introduce their own phase error.
 
Sound Waves are vibrations that travel through the air. While they travel in the electronic and digital worlds they are commonly shown on a two-dimensional graph with the y-axis defines the amplitude
(or loudness) of a signal and the x-axis defines the frequency (or pitch). The sinewave that is seen above is the most basic waveform in audio.
 

Wendy

Joined Mar 24, 2008
23,429
I've always thought a square wave sounded like bag pipes myself. I prefer sine waves or triangle waves, they are smoother.

Sorry Sparkie.
 

Audioguru

Joined Dec 20, 2007
11,248
if you introduce the normal signal to one ear,then the phase shifted one to the other,you may be able to hear it as "faux stereo".
Hee, hee.
Remember when there were home appliance stores that demo'd and sold stereos?
They ALWAYS had the speakers wired out-of-phase then they cranked up the bass to try to make up for the low frequency cancellation.

When I passed by I quickly wired one speaker in phase with the other. Then the sound was much better.
 

Thread Starter

Austin Clark

Joined Dec 28, 2011
412
Interesting responses, guys!
I have a comment to make, though.
The reason I suspected that you'd be able to notice a change in the sound is that, if the frequencies were "out of sync" then they wouldn't necessarily be creating constructive and destructive interference at the right times. As was mentioned earlier, if sound is fully out of phase, they completely cancel, which is a pretty big change.
I think I'll try and produce a sample to experiment with. If I can get it right, I'll share my findings! SCIENCE!

Oh, well, before I even finished typing this up, I read into Ron's link, and I found that my suspicions had merit. :D

I'll still try my own experiments, and I'll further explain my hypothesis at that time :)
 

Audioguru

Joined Dec 20, 2007
11,248
Due to the speed of sound, only low frequencies cancel when the speakers are out-of-phase.
Did you know that when a speaker is on a pedestal in front of you and the floor is reflective then some mid-range frequencies cancel due to the different distances (the reflection's distance is longer) affecting the phasing? Other frequencies add making a peak.
 

Audioguru

Joined Dec 20, 2007
11,248
I've always thought a square wave sounded like bag pipes myself.
That is why I hate the BUZZ of bagpipes.
My hearing is still good.

Many deaf people think bagpipes sound like the sinewave from a flute because they can't hear the buzzing harmonics.

EDIT: Like Acid Rock noise. The listeners and the "musicians" are deaf to the huge amounts of "fuzz" (distortion).
EDIT again: My favourite radio station suddenly changed from POP music to RAP crap!
Rap is not music. It is a ***** guy with a ***** accent talking while the beat goes on.
 
Last edited:

Thread Starter

Austin Clark

Joined Dec 28, 2011
412
Due to the speed of sound, only low frequencies cancel when the speakers are out-of-phase.
Did you know that when a speaker is on a pedestal in front of you and the floor is reflective then some mid-range frequencies cancel due to the different distances (the reflection's distance is longer) affecting the phasing? Other frequencies add making a peak.
I'm going to assume that only lower frequencies are canceled out because their WAVELENGTH is longer, meaning it's really the speed AND FREQUENCY of sound that gives it this property, not just the speed. Longer wavelengths have bigger areas of cancellation and areas of combination. Eventually they get so small that our ears won't notice it. Is this assumption correct, or is there some other reason?
 

Audioguru

Joined Dec 20, 2007
11,248
Low frequencies cancel when the speakers are out of phase. but your ears are never out-of-phase.

High frequencies with different path lengths cancel some frequencies but add other frequencies when they are in-phase but are separated.
Your ears do the same so it sounds normal.
 

PaulEE

Joined Dec 23, 2011
474
To the O.P (hello to everyone else as well!):

Suppose you did write out, by hand, an expression with the first five harmonics. It'd look like a rough square wave with ringing - I do believe.

Now, suppose you take each harmonic and, as you said, introduce variability in the phases. What the sum sounds like will be different and directly affected by which phases change, by how much, and in what direction.

If you tip-toe through frequency domain and time domain analysis, you can calculate exactly what the wave would look like - or, you could even use "Audacity", a free and open-source audio editing program, to generate the waves you speak of as a sum of separate tracks. Just add a brief delay before laying more waveforms out in parallel to the others and you've got your phase delay.

Do update us! :)
 

Ron H

Joined Apr 14, 2005
7,063
Here's a little simulation that allows you to play with phase shifting the harmonics, saving the waves to .WAV files, and trying to hear differences when you play them back. The left side is the reference square wave. On the right side, you can scramble the phase shift or delay of each harmonic as much as you want.
I couldn't hear any differences with the few examples that I tried, but it might become noticeable if you had music, instead of a constant frequency.

I did it monaurally, but I suppose you could record them as two channels and listen to them simultaneously with stereo headphones.
You might have to create a folder to store your WAV files.
 

Attachments

#12

Joined Nov 30, 2010
18,224
it might become noticeable if you had music, instead of a constant frequency.
True. Humans are not able to detect absolute phase. There must be a reference sound to interpret phase from. This is why it doesn't matter where a Leslie brand speaker stops. About 2 seconds after it stops, people can't tell where in the rotation it stopped. I suspect this also accounts for me failing to interpret the first sound when people speak to me in a language or a strong accent other than what I am expecting. In familiar ground, the brain supplies the first sound after interpreting the rest of the word. When I don't know the word that was spoken first, I never recover the information about the starting sound.
 

Audioguru

Joined Dec 20, 2007
11,248
I am getting used to strong British accents. When they say "wotah" then I know the word is water.

But I am not getting used to my local TV station hiding the mic of the news person in thick clothing then additionally electronically cutting away all high frequencies and most mid frequencies. But commercials have normal sounds.
 

russ_hensel

Joined Jan 11, 2009
825
Back to the original question: Human hearing is generally considered to be insensitive to phase so phase distortion is usually not audible.

aside: "absolute phase" is a term that means close to absolutely nothing, there is really no 0 point reference ( the time of the big bang? ).
 
Top