Representing a real periodic valued function with Fourier series

In summary, we are trying to show that a periodic real valued function with period L can be represented as a Fourier series with complex constants Am given by LAm = [L/2, -L/2] ∫ g(x)exp(-2πimx/L) dx. There was a typo in the original problem statement, with one of the exponents being negative instead of positive. After correcting this, we used the fact that the generic Fourier series has the form ∑∞n=-∞ An exp(-2\piinx/L) and then introduced a factor of i to get the appropriate form for the g(x) term. Further simplifications were made, and it was determined that the final answer should be
  • #1
Jdraper
51
0

Homework Statement



Hey, the question i have been given reads:

By a simple change of variables, show that if g(x) is a periodic real valued function with
period L it can be represented as

g(x)~ ∑n=-∞ An exp(-2[itex]\pi[/itex]inx/L)

where the complex constants An are given by

LAm =[L/2,-L/2] ∫ g(x)exp(-2[itex]\pi[/itex]imx/L) dx

Homework Equations



N/A


The Attempt at a Solution



I used the fact that the generic Fourier series has the form ∑n=-∞ An exp(-2[itex]\pi[/itex]inx/L) and then used the fact that L is the period to rewrite g(x) in the required form.

Then i used

Lbm=[L,-L] ∫ g(x)sin(m[itex]\pi[/itex]x/L)dx and

Lam=[L,-L] ∫ g(x)cos(m[itex]\pi[/itex]x/L)dx

I added these two to give me

L(bm+am)=[L,-L] ∫ g(x)(sin(m[itex]\pi[/itex]x/L)+cos(m[itex]\pi[/itex]x/L))dx


Then i used 0.5(am +bm)=Am to give me

2LAm=[L,-L] ∫ g(x)(sin(m[itex]\pi[/itex]x/L)+cos(m[itex]\pi[/itex]x/L))dx

Any help or indication of where I'm going wrong/ right would be a lot of help. Thanks in advance, John :). Also, if you don't understand any of my notation let me know and i'll try and explain it.
 
Physics news on Phys.org
  • #2
Jdraper said:

Homework Statement



Hey, the question i have been given reads:

By a simple change of variables, show that if g(x) is a periodic real valued function with
period L it can be represented as

g(x)~ ∑n=-∞ An exp(-2[itex]\pi[/itex]inx/L)

where the complex constants An are given by

LAm =[L/2,-L/2] ∫ g(x)exp(-2[itex]\pi[/itex]imx/L) dx
I think one of the exponentials should not have the negative sign in the argument. Is there a typo?

Lbm=[L,-L] ∫ g(x)sin(m[itex]\pi[/itex]x/L)dx and

Lam=[L,-L] ∫ g(x)cos(m[itex]\pi[/itex]x/L)dx

I added these two to give me

L(bm+am)=[L,-L] ∫ g(x)(sin(m[itex]\pi[/itex]x/L)+cos(m[itex]\pi[/itex]x/L))dx
This is true but not quite what you need. The goal is to use the fact that ##\cos(x) + i\sin(x) = e^{ix}##, so try introducing a factor of ##i## in the appropriate place before adding.
 
  • #3
Yes, it's a typo. The exponential in the g(x) term is meant to be positive. Thanks.

Ahh thanks Am = (am +ibm) not (am+bm)

So now i use the relations

Libm=[L,-L] ∫ g(x)isin(mπx/L)dx and

Lam= [L,-L] ∫g(x)cos(mπx/L)dx

To give me

L(am+ibm)=[L,-L] ∫g(x)*e^(im[itex]\pi[/itex]x/L) dx

and then as Am = (am +ibm)

this becomes

L( Am)=[L,-L] ∫g(x)*e^(im[itex]\pi[/itex]x/L) dx

My initial thoughts were initially to use symmetry to change the limits to get the missing factors but i don't think that would get me the missing -2 factor in the exponential. Any ideas?
 
  • #4
Jdraper said:
My initial thoughts were initially to use symmetry to change the limits to get the missing factors but i don't think that would get me the missing -2 factor in the exponential. Any ideas?
Hmm, shouldn't there be factors of 2 in the arguments to the cosine and sine? Like this:

Jdraper said:
Libm=[L,-L] ∫ g(x)isin(2mπx/L)dx and

Lam= [L,-L] ∫g(x)cos(2mπx/L)dx
 
  • #5
Reading through my course notes they are written here as they are printed. However what your suggesting does make sense, I might be using the wrong equations for this scenario but I'm unsure. I can't see your suggestions in my notes.
 
  • #6
Jdraper said:
Reading through my course notes they are written here as they are printed. However what your suggesting does make sense, I might be using the wrong equations for this scenario but I'm unsure. I can't see your suggestions in my notes.
Oh, I see: you are taking your integrals from ##-L## to ##L##, an interval of length ##2L##. So the cosine and sine will have the arguments ##(2\pi m x) / (2L)## which reduces to ##\pi m x / L##. So your formulas are correct, assuming the function has period ##2L##. But if the period is ##L## then you should only be integrating from ##-L/2## to ##L/2## (or ##0## to ##L##). In that case, the arguments will be ##2 \pi m x / L##.
 
  • Like
Likes 1 person
  • #7
The period of the function is L which means this all works out nicely. Thanks, i'll try and read the question properly next time. Much a appreciated :)
 
  • #8
Hi again, when reviewing my workings I noticed an error. The answer you helped me work out is:

L-L f(x)eim[itex]\pi*x/L[/itex]

However the answer requested in the question is:

L-L f(x)e-im[itex]\pi*x/L[/itex]

I've looked through my workings multiple times and have failed to spot my error, my only thoughts are setting m=-n or something along those lines.

Thanks again, John
 
  • #9
It depends on how you define the Fourier series. If the series has a negative exponent, then the formula for the coefficients should have a positive exponent, and vice versa.

In your original problem statement, you defined the Fourier series with a negative exponent:
$$f(x) = \sum_{n=-\infty}^{\infty}A_n \exp(-2\pi i n x / L)$$
So the coefficient formula should have a positive exponent:
$$A_n = \frac{1}{L} \int_{-L/2}^{L/2} f(x) \exp(2\pi i n x / L) dx$$
If you change the signs of both exponents, it will still be correct.
 
  • #10
Hello again, thanks for you help. I discovered the error was due to the fact that i assumed n<0 which meant Am=0.5(an+ibn) as opposed the condition where n>0 which gives Am=0.5(an-ibn).

However when working through this again i got the final answer:

2LAm=[L/2,-L/2] ∫g(x)e(-2[itex]\pi*mx/L)[/itex] dx

As opposed to

LAm=[L/2,-L/2] ∫g(x)e(-2[itex]\pi*mx/L)[/itex] dx

The factor of two was from the 2Am=0(an-ibn), when working through this previously i simply forgot the two, you can see this mistake if you look at my earlier posts.

I ran through my workings and found no way to cancel this two out, do you have any suggestions/ ideas?

This question will end eventually! Haha!
 
  • #11
Jdraper said:
Hello again, thanks for you help. I discovered the error was due to the fact that i assumed n<0 which meant Am=0.5(an+ibn) as opposed the condition where n>0 which gives Am=0.5(an-ibn).

However when working through this again i got the final answer:

2LAm=[L/2,-L/2] ∫g(x)e(-2[itex]\pi*mx/L)[/itex] dx

As opposed to

LAm=[L/2,-L/2] ∫g(x)e(-2[itex]\pi*mx/L)[/itex] dx

The factor of two was from the 2Am=0(an-ibn)
I scrolled up but I couldn't see exactly where you obtained ##2A_m = 0(a_n - i b_n)##. (Is there a typo? Doesn't this mean ##A_m = 0## for all ##m##?) Can you show how you got this equation?
 
  • Like
Likes 1 person
  • #12
Yet another typo, it should read. Am=0.5(am+ibm)

I stated it correctly, initially but then in the 8th line of my second post i write:

"and then as Am = (am +ibm)" which is incorrect according to my notes. using this however would give me the correct answer.
 
  • #13
Can we review how you are defining ##a_n## and ##b_n##? Are these the definitions you are using:
$$a_n = \frac{1}{L}\int_{-L/2}^{L/2} g(x) \cos(2\pi n x / L) dx$$
$$b_n = \frac{1}{L}\int_{-L/2}^{L/2} g(x) \sin(2\pi n x / L) dx$$
If so, then
$$\begin{align}
a_n + i b_n &= \frac{1}{L} \int_{-L/2}^{L/2} g(x) (\cos(2\pi n x / L) + i \sin(2\pi n x / L)) dx \\
&= \frac{1}{L} \int_{-L/2}^{L/2} g(x) \exp(2\pi i n x / L) dx \\
\end{align}$$
which is indeed the Fourier coefficient ##A_n## assuming the Fourier series is defined as
$$g(x) = \sum_{n=-\infty}^{\infty} A_n \exp(-2\pi i n x / L)$$
If your definitions for ##a_n## and ##b_n## are not as above, then that will change things. Indeed, I believe the formulas for ##a_n## and ##b_n## should be multiplied by 2 if they represent the coefficients of the Fourier series when written as follows:
$$g(x) = \frac{a_0}{2} + \sum_{n=1}^{\infty} [a_n \cos(2\pi n x / L) + b_n \sin(2\pi n x / L)]$$
Can you please clarify whether that is the case?
 
  • #14
The definitions i am using for an and bn are:

an = [itex]\frac{1}{L}[/itex] ∫[itex]^{L}[/itex][itex]_{-L}[/itex] f(x) cos([itex]\frac{npix}{L}[/itex]) dx

and

bn = [itex]\frac{1}{L}[/itex] ∫[itex]^{L}[/itex][itex]_{-L}[/itex] f(x) sin([itex]\frac{npix}{L}[/itex]) dx

Since I am integrating over the period L, meaning my limits are L/2 to -L/2 rather than L to -L does this mean i get a factor of 2 which means the 2's cancel?

I am also using An=0.5(an-ibn), where An is indeed the Fourier coefficient.

John
 
  • #15
It looks like those formulas are correct if the period is ##2L##. I can rewrite them as follows to make it more obvious:
$$a_n = \frac{2}{2L} \int_{-L}^{L} f(x) \cos\left(\frac{2\pi n x}{2L}\right) dx$$
$$b_n = \frac{2}{2L} \int_{-L}^{L} f(x) \sin\left(\frac{2\pi n x}{2L}\right) dx$$

If the period of your function is ##L## then you should replace ##2L## by ##L##, and ##L## by ##L/2##, to get
$$a_n = \frac{2}{L} \int_{-L/2}^{L/2} f(x) \cos\left(\frac{2\pi n x}{L}\right) dx$$
$$b_n = \frac{2}{L} \int_{-L/2}^{L/2} f(x) \sin\left(\frac{2\pi n x}{L}\right) dx$$
Using these definitions we can see that you need to define ##A_n = (a_n + i b_n) / 2## to compensate for the ##2/L##.
 
  • Like
Likes 1 person
  • #16
Yup that works perfectly. 2's cancel because it's a period of L, not 2L those were just the definitions given to me in my notes.

Can't thank you enough for your help, cheers :)
 
  • #17
I would suggest scratching out the formulas in your notes and replacing them with the ones for period ##L##, otherwise they will probably continue to confuse you in the future. :biggrin: Glad you got it sorted out. Working with Fourier series, one constantly runs up against annoyances with sign errors, factors of ##2## or ##2\pi##, etc., because not everyone uses the same definitions. Just a fact of life.
 

FAQ: Representing a real periodic valued function with Fourier series

How does Fourier series represent a real periodic valued function?

Fourier series is a mathematical tool used to represent a periodic function as a sum of sinusoidal functions. This means that any real periodic function can be decomposed into a combination of simple sine and cosine functions.

2. What is the purpose of using Fourier series?

The purpose of using Fourier series is to simplify the representation of a complex periodic function into a series of simpler functions. This allows for easier analysis and manipulation of the function.

3. How do you determine the coefficients for a Fourier series?

The coefficients for a Fourier series can be determined by using the Fourier series formula, which involves integrating the function over one period and dividing by the period. This process is repeated for each coefficient, and the result is a series of coefficients that can be used to reconstruct the original function.

4. What is the relationship between the Fourier series and the Fourier transform?

The Fourier series is a special case of the Fourier transform, which is a mathematical tool used to decompose any function into its frequency components. The Fourier series specifically deals with periodic functions, while the Fourier transform can be applied to non-periodic functions as well.

5. Are there any limitations to representing a function with Fourier series?

One limitation of using Fourier series is that it can only be applied to functions that are periodic. Additionally, the accuracy of the representation depends on the number of terms used in the series, so using an infinite number of terms is not practical. Lastly, discontinuities or sharp changes in the function can result in a slow convergence of the Fourier series, making it less accurate.

Back
Top