Representing a real periodic valued function with Fourier series

Click For Summary
SUMMARY

The discussion centers on representing a periodic real-valued function g(x) with period L using Fourier series. The correct representation is given by g(x) = ∑∞n=-∞ An exp(-2πinx/L), where the coefficients An are calculated using the integral An = (1/L) ∫[-L/2, L/2] g(x) exp(2πinx/L) dx. Participants clarified the need for positive exponents in the coefficient formula and addressed common errors related to the period of the function and the integration limits. The final consensus emphasized the importance of using the correct definitions for the Fourier coefficients to avoid confusion.

PREREQUISITES
  • Understanding of Fourier series and periodic functions
  • Knowledge of complex exponentials and their properties
  • Familiarity with integration techniques over specified intervals
  • Ability to manipulate trigonometric identities and complex numbers
NEXT STEPS
  • Study the derivation of Fourier series coefficients for different periodic functions
  • Learn about the implications of changing the period of a function on its Fourier representation
  • Explore common pitfalls in Fourier analysis, such as sign errors and integration limits
  • Investigate the applications of Fourier series in signal processing and other fields
USEFUL FOR

Mathematicians, physicists, and engineers working with periodic functions, as well as students studying Fourier analysis and its applications in various scientific fields.

Jdraper
Messages
51
Reaction score
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\piinx/L)

where the complex constants An are given by

LAm =[L/2,-L/2] ∫ g(x)exp(-2\piimx/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\piinx/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\pix/L)dx and

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

I added these two to give me

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


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

2LAm=[L,-L] ∫ g(x)(sin(m\pix/L)+cos(m\pix/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
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\piinx/L)

where the complex constants An are given by

LAm =[L/2,-L/2] ∫ g(x)exp(-2\piimx/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\pix/L)dx and

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

I added these two to give me

L(bm+am)=[L,-L] ∫ g(x)(sin(m\pix/L)+cos(m\pix/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.
 
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\pix/L) dx

and then as Am = (am +ibm)

this becomes

L( Am)=[L,-L] ∫g(x)*e^(im\pix/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?
 
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
 
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.
 
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
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 :)
 
Hi again, when reviewing my workings I noticed an error. The answer you helped me work out is:

L-L f(x)eim\pi*x/L

However the answer requested in the question is:

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

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
 
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\pi*mx/L) dx

As opposed to

LAm=[L/2,-L/2] ∫g(x)e(-2\pi*mx/L) 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\pi*mx/L) dx

As opposed to

LAm=[L/2,-L/2] ∫g(x)e(-2\pi*mx/L) 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 = \frac{1}{L} ∫^{L}_{-L} f(x) cos(\frac{npix}{L}) dx

and

bn = \frac{1}{L} ∫^{L}_{-L} f(x) sin(\frac{npix}{L}) 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.
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
4
Views
2K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 4 ·
Replies
4
Views
5K
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K