Vous êtes sur la page 1sur 3

Building a Triangle Wave from Cosine Waves

A 1 Amplitude of the triangle wave

2 Lambda is the wavelength of the triangle wave

n 1 2 7 Set of harmonics to use

2
k n Wave numbers, one for each harmonic
n

Exact triangle wave function, for comparison:

2A
Fa( x ) x if x 0 x
2
2A
( x ) otherwise

2A ( 1 ) 1
n
"Magic" formula for the amplitudes. (This is
a
n 2 derived from Fourier analysis.) Note that only
( n ) the odd ones are non-zero.
a0 A a0 is twice the average value of the function.

Amplitudes
0.2

an
0.2

0.4

0 5 10
n
f ( n x ) a cos k x
n n The individual cosine waves

a0
F( x )
2

f (n x)

Truncated Fourier series to approximate the saw-tooth wave.
n

Some Individual Cosine Waves

0.5

f ( 1 x)

f ( 3 x)
0
f ( 5 x)

f ( 7 x)

0.5

0 0.2 0.4 0.6 0.8


x

Triangle Wave and Fourier Approximation

F ( x)
0.5
Fa( x)

0 0.2 0.4 0.6 0.8


x

Fourier Approximation

F( x) 0.5

1 0.5 0 0.5 1
x

Vous aimerez peut-être aussi