Vous êtes sur la page 1sur 9

Math Assignment 2

The Discrete Fourier Transform


Gerardo de La Riva
September 29, 2011
Consider a discrete waveform x R
N
with components
x
m
=
_

_
0 if m S,
1 if S m < S + R,
0 if m S + R,
(1)
where S, R > 0 and S + R < N ( S and R are integers). The signal x is
a sampled, time-domain square pulse of length RT, where T = T/N is the
sampling interval, T is the observation period, and N is the number of samples
taken. S represents the time shift of the signal.
1. Show that the DFT of the pulse in Equation (1) is given by
X
k
= e
2ikS/N
1 e
2ikR/N
1 e
2ik/N
(2)
for k > 0, while X
0
= R.
Solution. DFT is dened by:
X
k
=
N1

m=0
X
m
e
2ikm
N
0 k N 1 (3)
in our case:
X
k
=
s1

m=0
X
m
e
2ikm
N
. .
0
+
S+R1

m=S
X
m
e
2ikm
N
+
N1

m=S+R
X
m
e
2ikm
N
. .
0
X
k
=
S+R1

m=S
X
m
e
2ikm
N
(4)
Writting the sum explicitly we get:
1
X
k
= e
2ikS
N
a
+ e
2ik(S+1)
N
+ . . . + e
2ik(S+R1)
N
X
k
= e
2ikS
N
. .
a
+e
2ik(S+1)
N
+ . . . + e
2ikS
N
e
2ik(R1)
N
(5)
Now, factorizing (5) by a we obtain:
X
k
= e
2ikS
N
_
1, e
1
, . . . , e
2ik(R1)
N
_
. .
Geometric series
(6)
A geometric series is dened as:
a + ar + ar
2
+ ar
3
+ . . . + a
n1
=
n

k=0
ar
k
=
a(1 r
n+1
)
1 r
(7)
Replacing with the values from (6) we get:
X
k
= e
2ikS
N

_
1 e
2ik(R)
N
1 e
2ik
N
_
(8)
2. Compute the energy contribution from the waveform E
k
, i.e., the quantity
|X
k
|
2
/N. Show that the energy does not depend on the time shift. Is this
what you would expect? Explain.
Solution:
E
k
=
|X
k
|
2
N
=
X
k
|X
k
|
N
=
e
2ikS
N
1e
2ikR
N
1e
2ik
N
e
2ikS
N
1e
2ikR
N
1e
2ik
N
N
(9)
=
e
2ikS
N
1e
2ikR
N
1e
2ik
N
e
2ikS
N
1e
2ikR
N
1e
2ik
N
N
=
e
2ikS
N
1e
2ikR
N
1e
2ik
N
e
2ikS
N
1e
2ikR
N
1e
2ik
N
N
=
e
2ikS
N
. .
a
1e
2ikR
N
1e
2ik
N
e
2ikS
N
. .
b
1e
2ikR
N
1e
2ik
N
N
2
a b = e
(
2ikS
N
+
2ikS
N
)
= e
0
= 1 (10)
E
k
=
1e
2ikR
N
1e
2ik
N

1e
2ikR
N
1e
2ik
N
N
(11)
Conclusion: In equation (10), the term S went to limbo, and since the
value of S determines the phase of the pulse described by X
m
, then we
can conclude that the energy contribution |X
k
|
2
/N does not depend on
the time shift. And I would have expected that on the basis that the en-
ergy contribution of the signal is independant of when the pulse described
occurs.
3. Plot the two-sided power spectrum |X
k
|
2
/N as a function of k, centered
around k = 0, for N = 1024 and R = 1, 2, 100, and200. Describe how
the graphs change as R increases. Draw the conclusion about the relation
between x and its DFT. What is the magnitude of each DFT coecient
in the special case R = 1?
Solution:
Here is the code used to produce the plots. Notice that S = 0, since we saw
in excercise 2. that the time shift is irrelevant to the power contribution.
1 from pyl ab import f f t , zer os , pl ot , s ave f i g , c l f , f f t s h i f t
2
3 x = z e r os ( 1024)
4 for R in [ 1 , 2 , 100 , 2 0 0 ] :
5 S = 0 #The f f t i s i ndependant of S, so we make i t 0
6 x [ S : R] = 1
7 f f t X = f f t ( x)
8 #range i s form 512, 512 , s i nce N=1024
9 pl ot ( range ( 512, 512) , abs ( f f t s h i f t ( f f t X ) ) 2/1024)
10 s a ve f i g ( f f t o f + s t r (R) + . png )
11 c l f ( )
As R increases, we can appreciate that we get a higher peak. For R = 1,
the power spectrum looks totally at. This is because the pulse described
by the signal is very narrow. As R increases, the pulse widens and hence
the power increases.
3
(a) R = 1
(b) R = 2
Figure 1: Plot of the two-sided power spectrum |X
k
|
2
/N as a function of k,
centered around k = 0, for N = 1024 and R = 1and2.
1
(a) R = 100
(b) R = 200
Figure 2: Plot of the two-sided power spectrum |X
k
|
2
/N as a function of k,
centered around k = 0, for N = 1024 and R = 100, and 200.
2
4. An important characteristic of a pulse is its spectral bandwidth, . It
can be estimated as the half-width of the energy spectrum of the signal.
(Half-width is the dierence between the two values of for which the
energy has one-half of its maximum value. Remember that the frequency
is related to the index k as =
k
T
, and thus =
k
T
, where k
is the half-width index.) Use the Equation (2) to show that the spectral
bandwidth of the square pulse (1), dened as the half-width of its energy
spectrum, satises the inequality
k
N
R
(12)
i.e. prove that:
E
k

R
2
N
(13)
Solution:
From excercise 2, we derived the energy contribution of X
m
- E
k
- as:
E
k
=
1e
2ikR
N
1e
2ik
N

1e
2ikR
N
1e
2ik
N
N
(14)
Replacing in equation (13), we obtain:
1e
2ikR
N
1e
2ik
N

1e
2ikR
N
1e
2ik
N
N
. .
A

R
2
N
which is what we need to prove.
Solving A:
E
k
=
1
N

_
1 e
2ikR/N
e
2ikR/N
+ e
0
1 e
2ik/N
e
2ik/N
+ e
0
_
Adding and reagruping this we get:
E
k
=
1
N

_
2 (e
2ikR/N
+ e
2ikR/N
)
2 (e
2ik/N
+ e
2ik/N
)
_
(15)
From the identity
cos(t) =
e
it
+ e
it
2
(16)
6
we obtain that equation 15 can be re-written as:
E
k
=
1
N

_
2 2cos(2kR/N)
2 2cos(2k/N)
_
(17)
E
k
=
1
N

2
2
_
1 cos2(kR/N)
1 cos2(k/N)
_
(18)
From the trigonomotric identity:
sin
2
=
1 cos2
2
(19)
We replace in 18 to obtain:
E
k
=
1
N

sin
2
kR/N
sin
2
k/N
(20)
Considering that
k =
N
2R
(21)
replacing k in 20 we obtain what we need to prove, which is that:
1
N

sin
2
_

N
2R

R
N
_
sin
2
_

N
2R

1
N
_
R
2
2N
(22)
Solving 22, we obtain:
sin
2
_

2
_
sin
2
_

2R
_
R
2
2
(23)
and
1
sin
2
_

2R
_
R
2
2
(24)
hence
k
N
R
(25)
7
5. Use (12) to derive the socalled uncertainty principle:
t 1, (26)
where t = RT is the time duration of the pulse.
Solution:
t = RT (27)
is the time duration of the pulse, and
k
N
R
(28)
the inequality from excercise 4.
from (27)
T =
tN
R
(29)
and, from denition
=
k
T
=
k
T
k = T (30)
replacing k in the inequation (25) we obtain that
T
N
R
(31)
and then replacing T by means of (29) we can continue like this:

tN
R

N
R
(32)

tN
R

N
R
0
factorizing for
N
R
N
R
(t 1) 0 (33)
since
N
R
is a positive number,
t 1 0 t 1 (34)
8
THE END
9

Vous aimerez peut-être aussi