Colton B.

asked • 01/04/22

Fourier series Piecewise

I am trying to self teach Fourier series and can't seem to figure this one out.


How do I approach solving a Fourier series piecewise function f(x) = 1 if 0 < x < pi or f(x) = 2 if pi < x < 2pi . keeping in mind this is one whole piecewise function.


Thanks in advance.

Stanton D.

I think what you are asking yourself to do is to generate a series which resembles this step function as closely as possible? You do that by multiplying the function by the prospective terms (all harmonics of 1.5 +- sin(nx) +- cos(nx)). The integrals you obtain (over 0 to 2pi) are coefficients of the terms in the series you are assembling. It does take quite a few terms to start settling down to a recognizable square wave! And you will notice that the sum "overshoots" the step, long after the middle portions look flattish. -- Cheers, --Mr. d.
Report

01/04/22

Colton B.

Hey! Like, I am familiar with solving Fourier series, but for this one here I got an a0 coefficient, an, and bn coefficient but I am just not confident with it . That is what I was asking about. I feel either an or bn should of been zero but none were for me so putting it in he full expansion a.k.a making an equation with the two sums instead of one is what is throwing me off.
Report

01/04/22

Stanton D.

So, set your coefficients into an equation, and graph (use Excel, or equivalent)? Cosine (nx) terms centered at x=pi will not satisfy the essential symmetry of the step function (which is -/+ across that point)! So, you will have only the constant (1.5) and some sort of sine(kx) terms centered at x=pi. You won't necessarily have non-zero coefficients for each value of n; there may be separate patterns for the n=odd and n=even coefficients. You can sketch the overlap with the step function to intuitively check how you "build up" the region just >pi and the region just <2pi. It looks to me as if a high-n sine will "build" step function right after x=pi, whereas a sine function with (3/2) a cycle from pi to 2pi will comparably "build" step function approaching x=2pi. So maybe you need to use (n/2) increments on your x arguments, as you build your series? Suggestion: use (x-pi) in all your calculations, not (x) (BEFORE you multiply by any n or n/2!). That way everything is re-centered as a step function around x=pi, automatically. -- Mr. d.
Report

01/05/22

1 Expert Answer

By:

Bradford T. answered • 01/11/22

Tutor
4.9 (29)

MS in Electrical Engineering with 40+ years as an Engineer

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.