Sei sulla pagina 1di 4

Representing a Straight line signal as a series of sines and

cosines for better signal analysis in communication


Engineering.

I will compute the Fourier series of F(x)=x over the Interval [ -pi, pi]. I will first do the calculations then
show that these sums in fact give us the line y=x over the interval [-pi, pi]

The general form of a Fourier series is given by the Equation below


a
F(x) = 2
+ ∑∞
n=1 [An Cos(nx)+BnSin(nx)]

And we evaluate the Coefficients using the Equations Below

1 π
Ao = π ∫-π
F(x) dx

1 π
An = π ∫-π F(x) cos(nx) dx

1 π
Bn = π ∫-π F(x) sin(nx) dx

Finding the Fourier Coefficients


π
Ao = 1/π ∫-π xdx

Using Mathematica to solve the problem

In[11]:= Integrate[x, {x, - pi, pi}]


Out[11]= 0

Finding the value of An


1 π
An = π ∫-π xcos(nx) dx
2

In[14]:= Integrate[x Cos[n x], {x, - π, π}, Assumptions → Element[n, Integers]]


Out[14]= 0

Finding the value of Bn 1 π


= π ∫-π xsin(nx)dx

In[19]:= Integrate[x Sin[n x], {x, - π, π}, Assumptions → Element [n, Integers]]

Out[19]= 2 (Sin[Pi n] - Pi n Cos[Pi n])


------------------------------
-----------------------------
2
n

The first 3 terms of my fourier series is F(x)=x are

B1Sinx + B2Sin2x + B3Sin3x + ............

Sin2x Sin3x
=2[Sinx - 2
+ 3
+..................]

I will plot these first 3 terms to see if l can recognize the straight line...

In[21]:= Plot2 Sin[x] - Sin[2 x]  2 + Sin[3 x]  3 , {x, - π, π}


3

Out[21]=
-3 -2 -1 1 2 3

-1

-2

-3

From the diagram above the straight line is not very clear so l will add a few more terms to see if l can
get a better output..
3

In[24]:= Plot
2 Sin[x] - Sin[2 x]  2 + Sin[3 x]  3 - Sin[4 x]  4 + Sin[5 x]  5 - Sin[6 x]  6 - Sin[7 x]  7,
{x, - π, π}

Out[24]=
-3 -2 -1 1 2 3

-1

-2

-3

This is a better representation of the line. But l will add more terms in my final representation of the line

In[25]:= PlotSum- 2 - 1 ^ n Sin[n x]  n, {n, 1, 80}, {x, - π, π}, Epilog → Point[{2, 2}]
4

Out[25]=
-3 -2 -1 1 2 3

-2

-4

This is a better representation of the Straight line by adding more terms in my Sequence.This type of
analysis is widely used in Systems Engineering when we do analysis of signals which can be triangular,
square form or even a straight line as shown from my example.The various waveforms can then be
converted into a series of sines and cosines which are better for analysis
4

Integrate: Invalid integration variable or limit(s) in {Assumptions x, -Assumptions pi, Assumptions pi} → n ∈ Integers.

Potrebbero piacerti anche