Square Waves and Sound

Audioguru

Joined Dec 20, 2007
11,248
I watch Formula One car races on TV. All the announcers are British with very strong accents. I can hardly understand what they talk about (usually they talk only about the British drivers).
 

Veracohr

Joined Jan 3, 2011
783
The topic seems to have strayed, but I'm going to go back to the OP.

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?

Here's the square wave series:





If you have a graphing calculator, program, or even a spreadsheet, you can graph it and add in phase changes to the harmonic of your choice to see the difference. The mathematical explanation is that the perfect square wave can be described as a sum of individual sine waves of particular amplitudes; therefore, if one of those sine waves is shifted in phase, the amplitude of it will be altered relative to the other harmonics, which changes the shape of the summed output. Which harmonic is shifted, and by how much, determines the extent of the distortion. In the attached pic I've graphed the first 11 harmonics; the top graph is normal, the bottom has the third harmonic shifted by 30% of the period. You can see the differences; these differences change as the phase shift changes, but if you shift a higher harmonic by the same amount, the distortion is less because it has a lower relative amplitude in the sum.
 

Attachments

Ron H

Joined Apr 14, 2005
7,063
The topic seems to have strayed, but I'm going to go back to the OP.




Here's the square wave series:





If you have a graphing calculator, program, or even a spreadsheet, you can graph it and add in phase changes to the harmonic of your choice to see the difference. The mathematical explanation is that the perfect square wave can be described as a sum of individual sine waves of particular amplitudes; therefore, if one of those sine waves is shifted in phase, the amplitude of it will be altered relative to the other harmonics, which changes the shape of the summed output. Which harmonic is shifted, and by how much, determines the extent of the distortion. In the attached pic I've graphed the first 11 harmonics; the top graph is normal, the bottom has the third harmonic shifted by 30% of the period. You can see the differences; these differences change as the phase shift changes, but if you shift a higher harmonic by the same amount, the distortion is less because it has a lower relative amplitude in the sum.
I posted a similar simulation, with the added bonus of creating .wav files that you can actually listen to.
I played around a little with it. All combinations of phase shift sounded the same to mme.
 

Thread Starter

Austin Clark

Joined Dec 28, 2011
412
Hey, guys, I found the perfect simulator, actually!

You can change the phases and amplitudes or different frequencies, and hear and see the result real-time. Just go to Mag/Phase view, and make sure "sound" is ticked.

http://www.falstad.com/fourier/


EDIT: I've played with it for only a bit, but I couldn't get a super-huge difference in actual sound. I did notice it, though.
 

Audioguru

Joined Dec 20, 2007
11,248
I heard a huge difference between sine, sawtooth and square waves.
My stereo computer speakers caused harmonic cancellation due to different path lengths to my ears so I had to unplug one speaker.
 

Thread Starter

Austin Clark

Joined Dec 28, 2011
412
I heard a huge difference between sine, sawtooth and square waves.
My stereo computer speakers caused harmonic cancellation due to different path lengths to my ears so I had to unplug one speaker.
Well, yeah, you'll hear differences between those, because those have entirely different components. You can see that, when you choose the different waveforms, the sliders underneath will adjust themselves, so you can see what frequencies and at what amplitude made up that particular composite waveform. It's really nifty. I like how you can still tell what the fundamental frequency is, with the different waveforms.
 

THE_RB

Joined Feb 11, 2008
5,438
I heard a huge difference between sine, sawtooth and square waves.
My stereo computer speakers caused harmonic cancellation due to different path lengths to my ears so I had to unplug one speaker.
And quite possibly with cheap PC speakers one might have been wired out of phase. Your sound card driver might have an option to reverse the phase of one side?
 

Audioguru

Joined Dec 20, 2007
11,248
The phase of midrange and high frequency sounds are reversed when the path length from a speaker to your ear changes only a few inches. So the phase reverses when one speaker is 3.0' but the other speaker distance is 3'-3".
When the phase reverses then the sound at that frequency is cancelled.

My pc speakers sound pretty good with stereo music. They are in phase and produce sounds down to about 70Hz.
 

THE_RB

Joined Feb 11, 2008
5,438
I have my speakers right next to the video monitor, both at equal distance to my ears.

It seems silly to have the speakers badly placed as generally they are small and there is room to put them in the right place.

What annoys me is that most sound card drivers don't have a good multiband EQ that you can adjust, so you have to live with the very un-flat freq response of PC speakers.
Fortunately Winamp has a decent EQ for playing music, but all the rest of the speaker use like software and games is without the benefits of EQ. :(
 
Top