calculating fourier coefficients for piecewise function

225 Views Asked by At

Take the piecewise function:

F(x) = 1, x < L/2 and 2, x > L/2

Now a fourier series is defined over a full period of -L < x < L

Just using the fourier sine coefficiencts as an example, they are usually calculated as: (1/L) Int(-L,L) f(x) sin[(n pi x)/L]

But over th full period i have my function f(x) equaling two values, do i use the sum of the values?

I.e: (1/L) Int(-L,L/2) (1)sin[(n pi x)/L] +(1/L) Int(L/2, L) (2)sin[(n pi x)/L]