There are all sorts of resonances around us, in the world, in our culture, and in our technology. A tidal resonance causes the 55 foot tides in the Bay of Fundy. Mechanical and acoustical resonances and their control are at the center of practically every musical instrument that ever existed. Even our voices and speech are based on controlling the resonances in our throat and mouth. Technology is also a heavy user of resonance. All clocks, radios, televisions, and gps navigating systems use electronic resonators at their very core. Doctors use magnetic resonance imaging or MRI to sense the resonances in atomic nuclei to map the insides of their patients. In spite of the great diversity of resonators, they all share many common properties. In this blog, we will delve into their various aspects. It is hoped that this will serve both the students and professionals who would like to understand more about resonators. I hope all will enjoy the animations.

For a list of all topics discussed, scroll down to the very bottom of the blog, or click here.

Origins of Newton's laws of motion

Non-mathematical introduction to relativity

Three types of waves: traveling waves, standing waves and rotating waves new

History of mechanical clocks with animations
Understanding a mechanical clock with animations
includes pendulum, balance wheel, and quartz clocks

Water waves, Fourier analysis



Monday, May 11, 2009

Symmetries in Fourier series

Many problems in physics can be made clearer by considering the symmetry involved. This is particularly true in quantum mechanics, that uses waves as an integral part of particle dynamics. In this posting we will explore how symmetries in repeating wave functions affect their Fourier series.


Contents: 
  1. Animation on symmetry
  2. Screw symmetry
  3. Functions of only even harmonics (twice repeating symmetry)
  4. Even symmetry
  5. Odd symmetry
  6. Odd/even symmetries, a question of phase
  7. Scrambled phases - the human ear
  8. Summary

Animation on symmetry

The animation below demonstrates the symmetries of repeating functions. Click on the buttons to choose the function and the symmetry to be checked for in that function. The animation also illustrates two different methods for checking the symmetries: the function as a whole and a point-by-point method. In the paragraphs following the animation, we discuss each of the symmetries in detail.  You might wish to refer back to the animation as you are reading about each type of symmetry.


This animation shows the process of checking for the various symmetries with a number of functions. To slow the animation down in the "whole" mode, repeatedly click on "step" for a step-by-step rendition.
copy interactive table fair use policy

Screw Symmetry

A function has screw symmetry if when shifted a half period and flipped vertically, it is the same as the original function.

The equation for screw symmetry is:

. (1)

Functions with a non-zero average, are flipped about their average values, shown in blue below. Technically, these functions do not meet the mathematical definition of screw symmetry just given; however, the non-zero average value only affects the a0 coefficient and can be subtracted out for the purpose of this discussion.

The table below shows four functions that have screw symmetry.

A screw symmetry is made by successively sliding a pattern to the right and flipping it each time.

A sine functionA crazy function with screw symmetry A square wave has screw symmetry around its average value (in blue). A triangle wave has screw symmetry around its average value (in blue).
f(θ) = sin θ f(θ) = A1cos(θφ1) + A3cos(φ3) + A5cos(φ5) + ... f(θ) = ½ + (2/π)sin θ  + (2/3π)sin 3θ + (2/)sin + ... f(θ) = ½ + (4/π2)cos θ  + (4/9π2)cos 3θ + (4/25π2)cos 5θ + ...
 
Math: why only odd harmonics exist for functions with screw symmetry

We start with the standard formula for the coefficients of the cosine terms:

In the second term of the third line above, we use and also we replace θ with θ+  (the function repeats itself every radians) so that f(θ π) becomes f(θ + π). The limits of integration of the second term then become θ+π = π to θ+π = 2π which is equivalent to θ=0 to θ=π.  

Examining the factor in brackets on the last line, we get:



In the first line, we use the standard relation for cos(a + b) = cos a cos b − sin a sin b. In the second line we use the fact that sin nπ = 0. Also we use the fact that cos changes from −1 to +1 and back to −1 and to +1, etc as n increases from 1, 2, 3, 4, .... . This oscillating value of cos makes the expression above zero for even n's.

We can repeat this procedure for the bn's and get very similar results. The only difference is that we need to use the relation  sin(a + b) = sin a cos b + cos a sin b. We get a similar oscillating expression that ends up making all the bn's zero for even n's, just like before.

Functions with screw symmetry only have odd harmonics

In the last row in the table above, we show the Fourier series of each function. The Fourier series of functions with screw symmetry have only odd harmonics. The table above confirms this. The mathematical explanation of why there are only odd harmonics is at the right.  The non-mathematical explanation is that sines and cosines of even harmonics (n = 2, 4, 6, 8, ...) do not have screw symmetry, while odd harmonics (n = 1, 3, 5, 7, ...) do have screw symmetry.  It only makes sense that a screw symmetric function would be decomposed into a sum of screw symmetric sinusoids, i.e. into only odd harmonic sinusoids. 

Screw symmetry is unaffected by horizontal shifting
A little playing around with these functions will also show that shifting functions with screw symmetry to the right or left does not affect their screw symmetry. That is, shifting horizontally does not affect screw symmetry.  If for all θ, then substituting θ = θ'+ε in for θ yields  f(θ' + ε) = −f(θ' + ε − π) .   After all, shifting only interchanges the sine and cosine amplitudes inside each harmonic, i.e. changes the phase of each harmonic, as discussed in an earlier posting. It does not change one harmonic into another.  That is, a function with only odd harmonics will still only contain odd harmonics after shifting it horizontally and will therefore still have screw symmetry.

   Another way to see this is to understand that checking for screw symmetry only involves a right shift and flip and has nothing to do with the x = 0 point.  Thus moving a function relative to the x = 0 point will have no effect on whether it has screw symmetry. 

Functions having only odd harmonics have screw symmetry.
The inverse of screw symmetry functions having only odd harmonics is also true:  that a function with only odd harmonics will have screw symmetry.  We can see this by noting that odd harmonics are sinusoids of the forms sinnx and cosnx where n is odd (i.e. n = 1, 3, 5, 7, ...).  We graphed the sine case where n=1 above and the n=1 sine and cosine cases are covered in the animation above (where we show that both have screw symmetry).   It is also true that sinnx and cosnx for other odd n's also have screw symmetry. (sinnx and cosnx for other even n's have twice repeating symmetry discussed next.) It is also true that sums of functions with screw symmetry have screw symmetry as shown below. Since a Fourier series having only odd harmonics will be a sum of a bunch of screw symmetric terms, it follows that the whole function will have screw symmetry.

Math showing that when we add two functions each having screw symmetry, their sum also has screw symmetry.
sum(θ) =  f(θ) + g(θ) = −f(θπ) − g(θ π)

            =  −{f(θπ) + g(θ π)} =  −sum(θπ)

This type of symmetry repeats the same pattern twice every cycle, i.e. twice every 2π radians, or once every π radians. It is similar to the screw symmetry, discussed above, but without the flipping.

Functions of only even harmonics ... twice repeating symmetry


Functions with twice repeating symmetry only contain even harmonics


You might ask whether some functions only have even harmonics.


The answer is yes, they exist and we saw one such example in the interactive table in the previous posting under the title "full wave" function (referring to the waveform of the electrical signal from a full wave rectifier). I'll refer to the symmetry displayed here as "twice repeating symmetry" and it is illustrated with the frogs at the right. This occurs if the pattern in the first half cycle is reproduced in the second half cycle, i.e. if

.     (2)

The full wave function is shown below along with its Fourier series.   Note that the Fourier series contains only even harmonics. Using almost the same steps as in the math box above but with the new relationship in it, one can show that functions with this twice repeating symmetry have only even harmonics. 

Full wave function (signal from a full wave rectifier) is an example of twice repeating symmetry.
f(θ) = 2/π − (4/3π)cos 2θ  −  (4/15π)cos 4θ −  (4/35π)cos 6θ + ...

Recasting a twice repeating function to eliminate the duality

As was pointed out in the previous posting, and as plotted at the left, the full wave function exactly repeats itself every π radians. Since all of our Fourier series equations are based on the assumption that a function repeats every 2π  radians, we need to recast this function so that it cycles every 2π radians. We show this in the table below along with the new Fourier series which now includes every possible term (as opposed to only the even terms). Generally speaking, all functions that contain only even harmonics repeat themselves every π radians and usually need to be recast so that they repeat themselves every 2π radians. This process does not seem so arbitrary when the function varies with distance and/or time.  See the table below for the recasting of functions of time. 

Original functions After recasting Explanations
Original function with a generic angle as its variable

Recasting of function with generic angle variable

We substitute θ/2 in for θ. This rescales the horizontal axis, but does not affect the vertical axis or scale. This recasting does not affect the amplitude of the harmonics, but does change the nth harmonic into the nth/2 harmonic. That is, the fourth harmonic becomes the second harmonic, etc. The solutions of the indefinite integrals are from Wolfram Mathematica but alternatively could be done using equations for the product of a sine and cosine function:  sinα cosβ=½[sin(α+β)+sin(αβ)].


Note that over the interval 0 to 2π, sin  θ/2 does not change sign, so that in the second case, the integration can be done in one chunk, over the entire interval at once. Note also that the two results have the same amplitude for each harmonic, although because the old 4th harmonic is the new second harmonic, we need to multiply the new n by 2 in the final equation to keep the amplitude the same.





           



        











Original function with time as its variable

Recasting of function with time as its variable

This is a physical waveform as a function of time. The function is y=|sinωt| where ω is the angular frequency of a physical process. Originally we designate the period T to be from t = 0 to t=2π/ω as we might for regular sinusoids. This period proves to be twice as large as it should be. That is, the function repeats itself inside this period. So we pick a new period of T=π/ω as shown on the second graph. To find the coefficients an, we integrate over the interval t=0 to t=T=π/ω.  We limit our math to showing that the calculations of the coefficients an are equivalent to the starting equations of that done above with θ as the argument (with the final substitution of  θ  in for ωt or 2ωt respectively for the two cases).











Understanding twice repeating symmetry through an inversion of the recasting process

The inverse of this recasting allows us to understand this symmetry better. If we take any repeating function that is not twice repeating and does not have screw symmetry (thus having both even and odd harmonics), and substitute 2θ in for θ, we will have the function repeating twice every 2π radians, meaning that we now have a function with twice repeating symmetry. At the same time, all the terms of the Fourier series will have their sinusoidal arguments affected in the following way:

  • cos nθ will become cos 2nθ
  • sin nθ will become sin 2nθ
  • Since 2n is always an even number, we will have only even harmonics.
  • This procedure illustrates that all twice repeating functions can be considered to be a general function with both even and odd harmonics with an incorrectly chosen period. It is also one way to understand that there will be only even harmonics. 

Breaking a function into a screw symmetric function and a twice repeating function

In the following math block we show that any arbitrary repeating function f(θ) can be split into a screw symmetric function g(θ) and a twice repeating function h(θ). 

We take the original function f(θ), split it into two half pieces, and also add and subtract a new factor ½f(θ π)

We rearrange the terms as shown and call the first block g(θ) and the second block h(θ).

In this line we show that g(θ) = −g(θ − π) showing that g(θ) has screw symmetry.  We use the fact that the functions repeat every 2π so that f(θ) = f(θ − 2π).

In this line we show that h(θ) = h(θ − π) showing that h(θ) has twice repeating symmetry.


An alternate way to view this, which makes it obvious, is that given a function represented by its Fourier series, we can clearly separate the odd harmonics from the even harmonics and end up with a sum of a screw symmetric function and a function with twice repeating symmetry:

In the line above I have used the fact that to allow me to include the constant term in the summation over even harmonics, treating the constant term as the zeroth harmonic.  This also has the added bonus of making the screw symmetric function more simply compliant with the concept of screw symmetry, without the need to flip the function about the average value.  Instead, we now flip around the x axis as specified by  . The average value is part of the twice repeating function, i.e. that having only even harmonics (which now includes the zeroth harmonic).


Even symmetry


Even symmetry means that the function on the left side of the y axis is the mirror image of the function on the right side, as is illustrated in the cheerleader cartoon to the right. The functions of the interactive table in the last posting with even symmetry are the triangle wave, the full wave, and the pulse train. These are shown below, along with their Fourier series.  You might want to play with the animation at the beginning of this posting to understand this type of symmetry from a more visual sense.

In even symmetry, the left side is a mirror image of the right side.

Triangle wave Full wave pulse train Cosine function
f(θ) = 1/2 − (4/π2) cosθ − (4/9π2) cos3θ      − (4/25π2) cos5θ − .... f(θ) = 2/π − (4/3π) cos2θ − (4/15π)      
     cos4θ − (4/35π) cos6θ − ....
f(θ) = τ/2π + (τ/π)  sinc τ/2 cosθ +    
    (τ/π) sinc2τ/2 cos2θ +
     (τ/π) sinc3τ/2 cos3θ + ....
    f(θ) = cosθ

Functions of even symmetry only contain cosine terms

We have also included a cosine function for comparison. Note that the Fourier series of each of these even symmetry functions only contains cosine terms.  Note that all the above functions can be flipped around the y axis without change. Mathematically we can specify this symmetry as

.   (3)

The mathematical explanation of why this is true is shown in the box at the right. A simple explanation is that an even symmetry function is naturally decomposed into even symmetry sinusoids, i.e. into cosine functions.

Math showing that all bn's (sine coefficients) are zero for functions of even symmetry

Because the both f(θ) and sin repeat every 2π radians, we can replace the integral from π to 2π with the integral at a range 2π radians less, i.e. from −π to 0:

Because the function is the same on either side of θ=0, but the sine function is inverted, we can set the second integral equal to the integral from 0 to π as long as we add the minus sign to the sine function:




Odd symmetry

In odd symmetry, the left side is a mirrored and flipped image of the right side.

Odd symmetry means that the function on the left side of the y axis is negative the mirror image of the function on the right side. That is, it is a flipped mirror image, as is illustrated by the cartoon at the right. The functions of the interactive table in the last posting with odd symmetry are the square wave, the sine wave, the sawtooth, and the half circle function. Three of these are shown below with their Fourier series.

Square wave Sawtooth Sine wave
f(θ) = 1/2 + (2/π) sinθ + (2/3π) sin3θ + (2/5π) sin5θ + .... f(θ) = 1/2 − (1/π) sinθ − (1/2π) sin2θ − (1/3π) sin3θ − .... f(θ) = sinθ

Math showing that all an's (cosine coefficients) are zero for functions of odd symmetry

Because the both f(θ) and sin repeat every 2π radians, we can replace the integral from π to 2π with the integral at a range 2π radians less, i.e. from −π to 0:



Because f(θ)  is inverted on either side of θ=0, but the cosine function stays the same, we can set the second integral equal to the integral from 0 to π as long as we add the minus sign on f(θ):



Math showing that any function can be broken into a function with even symmetry plus a function having odd symmetry

We start with breaking the function into two equal pieces, then adding and subtracting equal amounts of the function at −θ:

The first term in the last expression above we define as f1(θ) and the second term as f2(θ), i.e.


Now we show the f1(θ) has odd symmetry by substituting −θ  in for θ  to show that the whole function is inverted:

We also want to show the f2(θ) has even symmetry by substituting −θ  in for θ and showing that the whole function is unchanged:

Mathematically we can specify odd symmetry as:

    .        (4)

Functions with a non-zero average, are flipped about their average value, shown in blue above. Technically, these do not meet the mathematical definition of odd symmetry just given; however, the non-zero average value only affects the a0 coefficient and can be subtracted out for the purpose of this discussion. 

Functions of odd symmetry only have sine terms


Note that with the caveat of flipping about the average value, all the functions above have odd symmetry and also have only sine terms in their Fourier expansion.  Observe the animation at the beginning of this posting to understand odd symmetry visually.

The mathematical explanation of why odd symmetric functions have zero cosine terms  is shown in the box at the right. A simple non-mathematical explanation is that an odd symmetry function is naturally decomposed into odd symmetry sinusoids, i.e. into sine functions.



Even/odd symmetries, a question of phase


The mix of sine and cosine terms is affected by horizontal shifting of a function

In the last posting, we discussed the issue of phase and the interrelationship of sine and cosine terms. Each harmonic can be expressed as an amplitude and phase, OR as a sine term plus a cosine term. Each amplitude can be split between a sine term and a cosine term. If we shift the function in the horizontal direction, then the amplitude, An, of each harmonic stays the same, but the phase, φn, of each changes. When viewed as sine and cosine terms, shifting horizontally changes the sine-to-cosine mix.  The above discussion supports this. We see that the square wave above, as pictured there, has odd symmetry and because of this, it only has sine terms. If we were to shift it by π/2  to the left it would be symmetrically placed around the x axis and would have even symmetry and therefore only have cosine terms.  So shifting changes the mix of sine and cosine terms as discussed in the last posting.



Phases of functions of even symmetry and functions of odd symmetry

Using  φn = arctan2(y, x) = arctan2(−bn, an)  from the posting on "sines, cosines, and phases",  Equation 12b, we see that even symmetric functions which have no sine terms (the bn's = 0) have a phase given by φn = arctan2(0, an) = 0 or π radians, depending on whether an is positive or negative. Similarly, odd symmetric functions, which have no cosine terms (the an's = 0) have a phase given by φn = arctan2(−bn,0) = −π/2 or π/2  radians depending on whether bn is positive or negative.



A general function can be broken into an even symmetry function plus and odd symmetry function

Any function can be written as a sum of an even symmetry function plus an odd symmetry function. This is mathematically demonstrated in the box at the right. This is an application of the idea from the posting on "sines, cosines, and phases" that any sinusoidal function can be broken into a sine plus a cosine of the same argument.  In this case, we would break up the Fourier series of our general function into pure sine terms and pure cosine terms, separating these into two Fourier series.  The first would have odd symmetry while the second would have even symmetry.



Scrambled phases - the human ear

The human ear is very sensitive to the harmonic content of sounds.  This allows us to distinguish a concert A played by a violin from the same note played by a flute.  At the same time, the ear is not sensitive to the phases of the harmonics.  That is to say, if we change the relative phase, i.e. the timing,  of the second harmonic relative to the fundamental, the human ear will not notice any change. This is not to say that we are totally insensitive to all aspects of phase.  Indeed, the relative timing of sound reaching the left ear relative to that reaching the right ear is one factor involved in our perception of the directionality of sound. The following box demonstrates the insensitivity to the harmonic phases of sound by allowing a viewer to listen to two sounds, both with the same harmonic content, but with differing phases of the harmonics.  Because of this difference, the graphs of the sound functions versus time look distinctly different, but the sounds  in the two audio clips will sound identical.  

 I might also point out that, while the human ear is insensitive to harmonic phase, digital electronics such as computers are very sensitive to harmonic phases.  This is  because digital systems generally operate on pulses, i.e. the spikes in waveforms, and harmonic phases greatly affect these spikes.   As you can see in the example below, the spikes in the two waveforms below are very different.   


  

  
The two waveforms above show the acoustical pressure versus time for two different sounds that happen to have the same amplitudes of their fundamental and harmonics, but with different phases. The graphs show two cycles of each waveform that repeat many, many times. The equations for each graph are shown below the graphs where ω=2πf=2π2kHz. Note the minus signs of the harmonic terms in the equation on the right.  These minus signs represent 180 degree phase differences between the fundamental and the higher harmonics.

Click on the two icons below to hear the two sounds for yourself. You will be surprised how similar they sound.

Summary

  • We discussed four types of symmetry of functions that repeat every 2π radians. 
  • These symmetries are: screw, twice repeating, even, and odd.
  • Screw symmetry functions:
    • Are unchanged by a shift of π radians and a vertical flip around the function's average value.
    • Have only odd harmonics. (The opposite is also true: all functions with only odd harmonics have screw symmetry.)
    • These functions have screw symmetry even if shifted horizontally.
  • Twice repeating functions
    • Repeat themselves every π radians,
    • Have only even harmonics. (The opposite is also true: all functions with only even harmonics have twice repeating symmetry.)
    • These functions have twice repeating symmetry even if shifted horizontally.
    • For the purpose of Fourier series, the period of these functions usually should be readjusted so that the function repeats every 2π radians, doing away with this symmetry.
  • Even symmetry functions:
    • Are unchanged by a horizontal flip around the y-axis.
    • Have only cosine terms in their Fourier series. (The opposite is also true that all functions with only cosine terms will have even symmetry).
    • This symmetry will be lost if a function is shifted in the x-direction.
    • The phase of the fundamental and all harmonics is 0 or π radians.
  • Odd symmetry functions:
    • Are unchanged by a horizontal flip around the y-axis if we also flip the function around its average value.
    • Have only sine terms in their Fourier series. (The opposite is also true that all functions with only sine terms will have odd symmetry).
    • This symmetry will be lost if a function is shifted in the x-direction.
    • The phase of the fundamental and all harmonics is −π/2 or π/2 radians
  • The human ear is not sensitive even and odd symmetry or to the phase of the harmonics.  It is sensitive to screw and twice repeating symmetry because these are indicative of the harmonic content of the function.



Copyright P. Ceperley 2009

LAST POSTING: How good is a Fourier series of a function at reproducing the original function