Why Doesn't My Fourier Series Expansion Look Like a Square Wave?

Click For Summary

Discussion Overview

The discussion revolves around the Fourier series expansion of a square wave function, specifically addressing why the initial expansion does not resemble a square wave. Participants explore the definitions and conditions necessary for applying Fourier series, as well as the implications of using an infinite domain versus a finite one.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant presents a square wave function defined over an infinite domain and expresses confusion about the resulting Fourier series not resembling a square wave.
  • Another participant points out that the function described is actually a signum function rather than a square wave, suggesting that a Fourier series is inappropriate for non-periodic functions defined over an infinite domain.
  • This second participant recommends defining the function over a finite interval, such as [-1, 1], to properly apply the Fourier series and achieve the expected square wave result.
  • There is a discussion about potential plotting issues related to the order of operations in the expression used for the Fourier series.
  • A later reply confirms that the suggested changes resolved the initial issue, leading to a successful visualization of the square wave.
  • Participants also discuss formatting techniques for mathematical expressions in the forum.

Areas of Agreement / Disagreement

Participants generally agree on the need to define the function over a finite interval for the Fourier series to be applicable. However, there is no consensus on the initial definition of the function, as one participant argues it is a signum function while another intended it to represent a square wave.

Contextual Notes

The discussion highlights limitations related to the definition of functions over infinite domains and the appropriate use of Fourier series versus Fourier transforms. There are also unresolved aspects regarding the clarity of mathematical expressions and their plotting.

Who May Find This Useful

This discussion may be useful for individuals interested in Fourier analysis, particularly those exploring the conditions under which Fourier series can be applied to different types of functions.

back2square1
Messages
13
Reaction score
0
for a square wave function,

f(x)= { -1, -∞ ≤ x ≤ 0; +1, 0 ≤ x ≤ ∞

Expanding it in Fourier series gives a function like,

f(x) = (4/π) * Ʃn=0( (sin ((2n+1)x) / (2n+) )

Plotting a graph of the equation gives something like this, http://goo.gl/vFJhL
which obviously doesn't look like a square wave. Can anyone tell me where have I gone wrong? What am I missing?

P.S
Fourier co-efficients
an=0
a0=0
 
Physics news on Phys.org
back2square1 said:
for a square wave function,

f(x)= { -1, -∞ ≤ x ≤ 0; +1, 0 ≤ x ≤ ∞

The way you have written this, f(x) is not a square wave. It's a signum function.

A Fourier series is a series representation of a periodic function. If you take the Fourier series of a non-periodic function on a finite interval [a,b], then the Fourier series matches your function on that domain, but repeats the function shape with period b-a.

What you have written, however, has an infinite domain, so a Fourier series cannot be used - you would have to use a Fourier transform instead. However, because you mention a square wave, what you probably want to do is define your function on a finite domain, such as

$$f(x) = \left\{\begin{array}{c}{-1,~-1 \leq x < 0 \\ +1,~0 < x \leq 1}\end{array}\right.$$

Then, calculate the Fourier series for that function on the domain [-1,1]. The resulting Fourier series should be a square wave. Note also that it is odd about x = 0, so I would expect only sine terms in the series, and in fact you should get the series you quoted.

As for why your plots aren't working, it looks to me like an order of operations issue. When you write the sum you are writing terms like "4sin(5x)/5pi". The plotter is interpreting this as "(4*sin(5x)/5)*pi". Write it like "4sin(5x)/5/pi" or "4sin(5x)/(5pi)" and you will get the result you want.
 
Last edited:
Thank you very much, Mute. It worked really nice. You're a wonderful guy. As you said, I added some extra parenthesis to my function and I can see a nice square wave, like this: http://goo.gl/9nu8V
Thank you once again. And yeah, I meant to write it like this,
f(x)= { -1, -π ≤ x ≤ 0; +1, 0 ≤ x ≤ π
I wrongly clicked on ∞ instead of π on the side bar.
And hey, please tell me how did you write that function in such a nice layout?
 
back2square1 said:
Thank you very much, Mute. It worked really nice. You're a wonderful guy. As you said, I added some extra parenthesis to my function and I can see a nice square wave, like this: http://goo.gl/9nu8V
Thank you once again. And yeah, I meant to write it like this,
f(x)= { -1, -π ≤ x ≤ 0; +1, 0 ≤ x ≤ π
I wrongly clicked on ∞ instead of π on the side bar.
And hey, please tell me how did you write that function in such a nice layout?


Use the 'Quote' button on Mute's post, and it will show you the formatting used.
 

Similar threads

  • · Replies 139 ·
5
Replies
139
Views
11K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 23 ·
Replies
23
Views
6K
  • · Replies 1 ·
Replies
1
Views
2K
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 4 ·
Replies
4
Views
1K