Sei sulla pagina 1di 55

Fourier Transform, FT

1
Adawy
Transform domain representation
of discrete time signals

2
Adawy
Representation of continuous systems
Most of continuous systems can be represented by:
Linear constant coefficients differential equation
Transfer function or system function
Impulse response
Frequency response

1- Linear constant coefficient differential equation


d N y (t ) d N 1 y (t )
cN N
 c N 1 N 1
 ...  c0 y (t )
dt dt
d M x(t ) d M 1 x(t )
 dM M
 M M 1 M 1
 ...  d 0 x(t )
dt dt
y(t) is the system output, x(t) is the system input
3
Adawy
Take Laplace transform with all initial conditions zeros, then
the last equation can be written as:
N M

 C S Y (s)   d S
i 0
i
i

i 0
i
i
X (s)
System function
N or Transfer
Y (s)
 i
c S i
function
H (s)   i 0
M
X (s)
 i
d
i 0
S i

Y(s)=H(s)X(s) If x(t)=δ(t), impulse function, X(s)=1

Y(s)=H(s), y(t)=L-1{Y(s)}=L-1{H(s)}=h(t)
Impulse response
4
Adawy
In general y(t)=L-1{H(s)X(s)}= h(t) * x(t)

Convolutio
n operation

 
y (t )   h( ) x(t   )d   x( )h(t   )d
 

A system is stable if all the poles of H(s) are in


the left hand side of the S plane

5
Adawy
Difference equations
General form of a system difference equation is:
N M

a
k 0
k y[n  k ]   br x[n  r ]
r 0

ak
N M
br
y[n]   y[n  k ]   x[n  r ]
k 1 a 0 r 0 a 0

Present output Present and


previous M inputs
Previous N
output

A sequential method can be used to get a closed form


solution for y[n]
6
Adawy
Example

y[n]=ay[n-1]+x[n], y[n]=0 for all n<0, x[n]=δ[n]

y[0]=ay[-1]+x[0]=1
y[1]=ay[0]+x[1]=a
y[2]=ay[1]+x[2]=a2
…………………
y[n]=an

The Z transform can be used to solve difference


equation
7
Adawy
?What Are Sinusoids

Sine wave Cosine wave

Low frequency Middle frequency High frequency

8
Adawy
‫‪Fourier Transform‬‬
‫لقد كان العالم فورير عمره ‪ 30‬عاما عندما كان أحد أعضاء الحملة الفرنسية على‬
‫مصر عام ‪ 1798‬وعين حاكما على مصر العليا ‪ ،‬وتقدم بعدة أبحاث علمية للمعهد‬
‫العلمى المصرى الذى أنشأه نابليون فى مصر ‪ .‬ثم عاد بعد ذلك إلى فرنسا حيث قدم‬
‫أفكاره لحل مشاكل االنتقال الحرارى للمعهد الفرنسى عام ‪ . 1807‬لقد تركزت أفكاره‬
‫على أن اإلشارة الدورية يمكن تمثيلها بمجموعة محدودة من اإلشارات الجيبية‬
‫المتوافقة ‪ .‬كما أوضح أيضا أن اإلشارة الغير دورية يمكن تمثيلها بالمجموع التكاملى‬
‫من اإلشارات الجيبية الغير متوافقة ‪ .‬هاتين الفكرتين هما األساس لما عرف فيما بعد‬
‫ويعرف اآلن بتتابع فورير ‪ Fourier series‬ومحول فورير ‪Fourier‬‬
‫‪ Transform‬اللذين كان لهما أكبر األثر على كل فروع الهندسة وبالذات هندسة‬
‫االتصاالت واإللكترونيات ومعالجة اإلشارات ‪.‬‬
‫لقد تم استخدام كل من تتابع فورير ومحول فورير لما يقرب من ‪200‬عام لتمثيل‬
‫الظواهر االنسيابية فى الزمن االنسيابى ‪ .‬مع ظهور األنظمة الرقمية وأزمنة الزمن‬
‫المقطع ظهرت الحاجة إلى محول فورير المقطع ‪Discrete Fourier‬‬
‫‪9‬‬ ‫‪. Transform, DFT‬‬
‫‪Adawy‬‬
‫ما هى الفائدة من تحويل أو وضع إشارة مركبة فى صورة مجموعة‬
‫من اإلشارات الجيبية ؟ ولماذا اإلشارة الجيبية بالذات ولم تكن المربعة‬
‫مثال ؟‬

‫فى الكثير من األحيان يصعب التعامل مع هذه اإلشارات المركبة ‪ ،‬فال يمكن مثال‬
‫حساب استجابة (خرج) نظام لمثل هذه اإلشارات ‪ .‬عند وضع اإلشارة فى صورة‬
‫مجموعة من اإلشارات البسيطة يسهل حساب استجابة النظام لكل واحدة من هذه‬
‫اإلشارات على حده ثم تجميع هذه االستجابات فنحصل على استجابة النظام لإلشارة‬
‫المركبة ‪ .‬هذا ما يسمى بنظرية التجميع ‪. Superposition‬‬
‫أما لماذا اإلشارة الجيبية بالذات فألن اإلشارة الجيبية لها ميزة ليست موجودة فى أى‬
‫إشارة أخرى وهى أن استجابة أى نظام خطى لإلشارة الجيبية هى أشارة جيبية‬
‫أيضا تختلف فقط فى المقدار والزاوية ولها نفس التردد ‪.‬‬

‫‪10‬‬
‫‪Adawy‬‬
Getting a square wave from a series of sinusoids

This is our original One sine Two sines

Seven sines Fourteen sines


Four sines
11
Adawy
Getting a series of pulses from a series of sinusoids

F(t)=…+(2/pi*45)*cos(45*pi*t)

12
Adawy
Classification of signals

Signal

Discrete Continuous

Periodic Periodic

Aperiodic Aperiodic

13
Adawy
Fourier Transform for signals
Continuous periodic

Fourier series

Continuous aperiodic
Fourier Transform

Discrete aperiodic

Discrete Time Fourier Transform

14
Adawy
Continuous Fourier Series
Any periodic continuous function f(t), with a periodic time T,
can be represented as a sum of exponential (sinusoids)
functions of T as follows:

f (t )  F e
k  
k
jkot

For all values of t

Fk is called the series coefficients, o is the fundamental


frequency, and it is given by:

15
o  2 / T
Adawy
Fk are given by:
1 T
Fk 
T  0
f (t )e  jkot dt
These are the coefficients in the exponential form. They can
be represented in a sinusoidal form as follows:

f (t )  ao   (ak Cos (kot )  bk Sin(kot )
k 1
1 T
ao   f (t )dt
T 0
2 T
ak   f (t )Cos (kot ) dt
T 0
2 T

16
bk 
T 
0
f (t ) Sin( kot ) dt
Adawy
Fourier Transform for continuous
aperiodic functions

Fourier Transform, FT

Inverse Fourier Transform,


IFT

17
Adawy
Any signal can be represented in one of these two
domains:

FT
Frequency domain Time
IFT domain

Amplitudeِ
Amplitudeِ

Time
Frequency

Spectrum analyzer
Oscilloscope
18
Adawy
The Discrete Time Fourier Transform, DTFT
It is the Fourier transform of aperiodic discrete time
sequences.

X (e jw )   x[ n
n  
]e  jwn

X (e )  X re (e )  jX im (e )
jw jw jw

j ( w )
X ( e )  X (e ) e
jw jw

Angle or phase
Magnitude

This is called frequency spectrum, amplitude spectrum, and


19
phase spectrum Adawy
We can see that:

 X(ejw) is a continuous function of w


 X(ejw) is periodic of w
e jӨ(w) =e j(Ө(w)+2pi k) =e jӨ(w)

Example X[n]=(0.5)n u[n]

 
X (e jw )   ( 0
n  
.5) n
u[ n ]e  jwn
  e
( 0
n 0
. 5) n  jwn


1
  (0.5e  jw n
)   jw
n 0 1  0.5e
20
Adawy
1
X (e ) 
jw
 jw
1  0.5e

21
The inverse Discrete Time Fourier Transform, IDTFT

1 
x[n]  
jw jwn
X (e )e dw
2 

Convergence of the DTFT



X (e jw )   x[
n  
n ]e  jwn

If the sequence x[n] is absolutely summable, then the


DTFT converges to a continuous function of w.

 x[n]  
n  
X (e jw )  

22
Adawy
DTFT properties
1- Linearity

A g[n] + B h[n] DTFT A G(e jw) + B H(ejw)

2- Time shift

g[n-n0] DTFT e -jwn0 G(ejw)


3- Frequency shifting
ejwn0 g[n-n0] DTFT G(e j(w-w0))

4- Differentiation in frequency

n g[n] DTFT jdG(e jw)/dw


23
Adawy
5- Convolution
g[n] * h[n] DTFT G(e jw) H(ejw)

The DTFT of the convolution of two sequences equal


to the product of the DTFT of both sequences. In some
applications (when it is difficult to calculate or even draw
the convolution of two sequences) its convenient to
calculate the convolution of the two sequences by
calculating the multiplication of the DTFT of the two
sequences and find the IDTFT.

6- Modulation
1 
g[n] h[n] DTFT
2 

G (e j ) H (e j ( w ) )d

24
Adawy
Discrete Fourier Transform, DFT

It is applied to the aperiodic discrete time signals with


definite lengths. The produced DFT is itself discrete.
Because it is discrete, it is the one that is used to
represent discrete signals in the frequency domain. There
are many special algorithms to speed up the calculation of
the DFT.
It can be viewed as a special case of the DTFT. For a finite
length sequence x[n], 0<=n<=N-1, it is found that N samples
of the DTFT X(ejw) are sufficient to determine x[n]. So it is
obtained by uniformly sampling X(ejw) on the w axis
between 0<=w<=2pi at wk=2pi k/N, k=0, 1, 2, …, N
N 1
X [ k ]  X (e )jw
  x[n]e  j 2kn / N
w  2k / N
25 n 0 K=0,1,…N-1
Adawy
X[k] is called the DFT, it is a finite length sequence of length N.
N 1
X [k ]   x[n]W Nkn
 j 2 / N
WN  e
n 0

Inverse DFT

N 1
1
x[ n] 
N
 X [k ]W
k 0
 kn
N n=0,1,2,…..N-1

As it will be seen computation of DFT or IDFT


requires N2 complex multiplications, and N(N-1)
complex additions. Any algorithm used to calculate
26 X[k] can be used to calculate x[n].
Adawy
The DFT can be put in a matrix form as follows:
N 1 N 1
X [k ]   x[n]e  j 2kn / N   x[n]WNkn
n 0 n 0
X = D x
X[0] 1 1 1 .... 1 x[0]
X[1] 1 W 1
N
W N2 ……… W NN 1 x[1]
. 1 W 2
N W 4
N
……… W N2 ( N 1) .
.
= .
.
.
. .
X[N-1] 1 W NN 1 W N2 ( N 1………
)
W N( N 1)( N 1) x[N-1]
The IDFT can be put in a matrix form as follows:
*
27 x=D X -1 D =(1/N)
-1 D N
Adawy
Properties of DFT
1- Because X(ejw) is periodical then X[k], and x[n] are
periodical. So, both the DFT, and IDFT are both a finite
length sequence that represent one period of a periodic
sequence.

2- The only difference between the calculation of the DFT


and the IDFT is the scaling factor, (1/N) and the sign change
in the exponent term. So, one algorithm can be modified to
calculate any of them.

3- Linearity If x1n] X1[k], and x2[n] X2[k]


Then Ax1[n]+Bx2[n] AX1[k] + BX2[k]
 j 2kno / N
4- Time shift x[n-no] X [k ]e  X [k ]W kno
N
28
Adawy
5- CircularNconvolution
1

 x1[n]x 2[m  n]
m 0
X1[k]X2[k]

6- Modulation 1 N 1

x1[n]x2[n]
N
 X 1[m] X 2[k  m]
m 0

Circular shift of a sequence


Imagine the sequence x[n] is displayed on the
circumference of a cylinder at N equally spaced points,
then the circular shift operation can be viewed as rotating
the cylinder clockwise or anticlockwise.

12 3 4 5 12 3 4 5 12 3 4 5 1 2 3 4 5
X[n]
29 X[n-1] X[n-2] X[n-3]
Adawy
Circular convolution
N 1
linear convolution
y L [n]   g[k ]h[ n  k ]
k 0
n=0,1,2,3,….N+M-1

N 1 Circular
y C [n]   g[ k ]h[n  k ] N convolution
k 0
n=0,1,2,3,….N-1

g[n]=[1 2 0 1], h[n]=[2 2 1 1]

4 1
y C [ n]   g[k ]h[n  k ] 4 n=<3<=0 g[k]=[1 2 0 1]
k 0 h[-k]=[2 1 1 2]]

30 yc[0]=g[0]h[0]+g[1]h[-1]+g[2]h[-2]+g[3]h[-3]=1x2+2x1+0x1+1x2=6
Adawy
yc[1]=g[0]h[1]+g[1]h[0]+g[2]h[-1]+g[3]h[-2]=1x2+2x2+0x1+1x1=7
g[k]=[1 2 0 1]
h[1-k]=[2 2 1 1]
yc[2]=g[0]h[2]+g[1]h[1]+g[2]h[0]+g[3]h[-1]=1x1+2x2+0x2+1x1=6

g[k]=[1 2 0 1]
h[2-k]=[1 2 2 1]

yc[2]=g[0]h[3]+g[1]h[2]+g[2]h[1]+g[3]h[0]=1x1+2x1+0x2+1x2=5
g[k]=[1 2 0 1]
h[3-k]=[1 1 2 2]

yc[n]=[6 7 6 5]

Circular convolution of two equal length sequences gives a


sequence with the same length.
31
Adawy
Calculation of the DFT
We defined the N point DFT of an N point sequence x[n]
as the N samples of the Fourier transform X(ejw) of that
sequence evaluated uniformly on the w axis at w=2πk/N,
where 0≤k≤N-1:
N 1 N 1
X [k ]  X (e jw ) | w2k / N   x[n]e  j 2kn / N   x[n]WNkn
n 0 n 0

 j 2 / N
WN  e ,K=0,1,2,…..N-1
DFT

IDFT
N 1 N 1
1 1
32
x[n] 
N
 X [k ]e
k 0
j 2kn / N

N
 X [k ]W
k 0
 kn
N
Adawy
 
N 1
X [k ]    Re( x[n])  j Im( x[n]) Re(W Nkn )  j Im(W Nkn )
n 0

 N 1 N 1
kn 
  Re( x[n]). Re(W N )   Im( x[n]). Im(W N )
kn

 n 0 n 0 

 N 1 N 1
kn 
 j  Re( x[n]). Im(WN )   Im( x[n]). Re(WN )
kn

 n 0 n 0 

33
Adawy
N real multiplications N real multiplications

 N 1 N 1
kn 
X [k ]   Re( x[ n]). Re(W N )   Im( x[n]). Im(W N )
kn

 n 0 n 0 
N real multiplications N real multiplications

 N 1 N 1
kn 
 j  Re( x[ n]). Im(WN )   Im( x[ n]). Re(WN )
kn

 n 0 n 0 
Each term of X[k] requires 4N real multiplications. As X[k]
consists of N terms (k varies from 0 to N-1), then to evaluate
X[k] for all k requires 4NXN=4N2 real multiplications.

By the same way direct evaluation of X[k] requires


NX(4N-2) real additions.

Simply, direct evaluation of X[k] requires N complex 2

34 multiplications, and N(N-1) complex additions.


Adawy
N 1
X [k ]   x[n]e  j 2kn / N

n 0

The good news is that, many of these multiplications turns


out to be redundant, because the exponential term is
periodic and will give no more than N distinct values. So, the
same products are calculated many times as k and n varies
.from 0 to N-1
.Efficient FFT algorithms try to reduce these redundancy

Another problem with direct implementation of the DFT is


the calculation of the exponential term itself directly ( or as
sine and cosine terms). This is a very time consuming
problem and an efficient FFT algorithm must reduce the use
of such functions.
35
Adawy
N 1 N 1
X [k ]   x[n]e  j 2kn / N
  x[n]W kn
N
n 0 n 0
For k varies from 0 to 7, and n varies from 0 to 7 we demonstrate the
redundancy of the exponential term exp(-j2πkn/N)

7 6 5 4 3 2 1 0 n
k
1 1 1 1 1 1 1 1 0
(1+j)/ √2 J -(1-j)/√2 -1 -(1+j)/ √2 -j (1-j)/√2 1 1

j -1 -j 1 j -1 -j 1 2
-(1-j)/√2 -j (1+j)/ √2 -1 (1-j)/√2 J -(1+j)/ √2 1 3
-1 1 -1 1 -1 1 -1 1 4
-(1+j)/ √2 J (1-j)/√2 -1 (1+j)/ √2 -j -(1-j)/√2 1 5
-j -1 j 1 -j -1 j 1 6
36 (1-j)/√2 -j -(1+j)/√2 -1 -(1-j)/√2 j (1+j)/ √2 1 7
Adawy
Fast Fourier Transform, FFT

Many methods for reducing the number of multiplications


have been investigated since 50 years ago.
Multiplication is more critical than addition because it
.consumes more time

The most widely used methods of FFT are based on


decomposing or breaking the transform into smaller
transforms, and combining them to give the total transform.
There are two methods to do this decomposition or
decimation:

Decimation In Frequency Decimation In Time


FFT FFT
37
Adawy
Decimation In Time FFT
The number of points in the input sequence are
assumed to be power of 2; N=2s.

In this approach we break the N, x[n] points into two


groups, each of them is N/2 points. The first group is the
even indexed points x[0], x[2], x[4] , … x[N-2]. The
second group is the odd indexed points x[1], x[3], …, x[N-
1]. Find the DFT of each group.

Each one of the previous groups is further decimated


into two N/4 points by the same way and find the DFT of
each decimated group

This process continues until you end up with 2 points in


each group and find the DFT for those two points
38
Adawy
N 1
X [k ]   x[n]W kn
N
n 0
Break the sequence x[n] into even and odd indexed points
N 1 N 1
X [k ]   x[n]W
n  0 ,even
kn
N   x[n]W
n 1,odd
kn
N

Put n=2r in the first sum, n=2r+1 in the second sum, to get
even and odd indexed points
N / 2 1 N / 2 1
X [k ]   x[
r 0
2 r ]W 2 rk
N   x[
r 0
2 r  1]W ( 2 r 1) k
N

2

W
39
2 rk
N  
W 2 rk
N e  j ( 2 / N ) 2 rk
e
j
N /2
rk
W rk
N /2
Adawy
N / 2 1 N / 2 1
X [k ]   x[2r ]W
r 0
rk
N /2 W k
N  x[2r  1]W
r 0
rk
N /2

N/2 point DFT N/2 point DFT


of the even of the odd
indexed pints. indexed pints.

X [k ]  G[k ]  W H [k ] k
N
k=0, 1, 2, .., N-1

This represents the first step in this algorithm. Breaking


the sequence into two N/2 sequences and find the DFT
of each of them. The total number of complex
multiplication P=(N/2)2+(N/2)2+N=N2/2 +N

In the last equation for k=N/2 to N, both G[k], and H[k] are
periodic. So, G[N/2]=G[0], G[N/2+1]=G[1], and so on.
40
Adawy
X [k ]  G[k ]  W H [k ] k
N
k=0, 1, 2, .., N-1

x[0] G[0]
0 X[0]
x[2] G[1]
W N
1 X[1]
x[4]
N/2 W N
G[2] X[2]
point W 2
N
DFT
x[N-2] G[N/2-1] X[N/2-1]
N / 2 1
W N
x[1] H[0] X[N/2]
N /2
x[3] H[1] WN X[N/2+1]
N / 2 1
x[5]
N/2
H[2]
W
N
point N / 2 2 X[N/2+2]
DFT
W
N
x[N-1] H[N/2-1] X[N-1]
N 1
W N

N point combining
41 algebra
Adawy
Each one of the N/2 point sequences can be decimated
further into two sequences of lengths N/4
x[0] N/2 point combine
N/4 X[0]
x[4] point
algebra W N0
W N1 X[1]
DFT
x[N-4] X[2]
W N2
x[2] N/4
x[6] point
x[N-3] DFT X[N/2-1]
N / 2 1
W N
x[1] X[N/2]
N /2
x[5]
N/4
point
W N X[N/2+1]
N / 2 1
x[N-2] DFT W N
N / 2 2 X[N/2+2]
x[3]
W N
N/4
x[7] point
x[N-1] DFT X[N-1]
N 1
W N
X [k ]  Ge[k ]  WNk / 2 Go[k ]  He[k ]  WNk / 2 Ho[k ]
42 P=4(N/4)2+2(N/2)+N=N2/4+2N Adawy
Final concept for decomposition in the decimation in
time FFT
2 point N/4 point X[0]
combining
DFT algebra X[1]
N/2 point
combining X[2]
2 point algebra
N/4 point
DFT combining
algebra X[N/2-1]
N point
2 point combining
algebra X[N/2]
DFT N/4 point
combining
X[N/2+1]
algebra
N/2 point
combining
algebra
N/4 point
2 point combining X[N-1]
algebra
DFT
Stage 1 Stage log2(N)=v, N=2v
The combining algebra at each stage takes N complex multiplication, so total
43
multiplications P= N.log2(N). Adawy
We reduced the number of complex multiplication
from N2 to N.log2(N) which is a great time saving.
Example Flow graph for an 8 point FFT

x[0] 0 0 0
X[0]
W 2 W 4
W 8
x[4] X[1]
W21 W 1
W 1
4 8
x[2] X[2]
W 0 W42 W 2
2 8

x[6] X[3]
W21 W43 W 3
8
x[1] X[4]
0 0 4
W 2 W 4 W
8
x[5] X[5]
W21 W 1
W 5
4 8

x[3] X[6]
W 0 W42 W 6
2 8

x[7] X[7]
44
W21 W 3
W 7
4 8
Adawy
An interesting feature in all previous butterflies

The horizontal scale factor can be rewritten as


the negative of the diagonal scale factor

W 0 W83
2

W21
W 0
1 W83  W841  W84 .W81  1.W81  W81
2
 j 2 1 / 2  j
W e
2
1
e  1 W87  W881  W88 .W81  1.W81  W81

0 W87
W 2 -1

Redraw
previous
figure
45 W83 -1 Adawy
This gives a further reduction in the number of
complex multiplication to (N/2).log2(N)

x[0] X[0]

x[4] X[1]
W20 -1
x[2] X[2]
W40 -1

x[6] X[3]
W20 -1 W41 -1
x[1] X[4]
W80 -1
x[5] X[5]
W20 -1 W81 -1

x[3] X[6]
W40 -1 W82 -1

x[7] X[7]
46
W20 -1 W41 -1 W83 -1
Adawy
Comparison for number of complex multiplications
obtained by direct method and FFT method

Ratio of N2 to (N/2)log2(N) N2 Number Number


(N/2)log2(N) of points of stages
N v
4 4 16 4 2
5.333 12 64 8 3
8 32 256 16 4
12.8 80 1024 32 5
21.33 192 4096 64 6
36.57 448 16384 128 7
64 1024 65536 256 8
113.77 2304 262144 512 9
204.8 5120 1048576 1024 10
47
Adawy
Shuffling the input data

Shuffled Bit 3 bit code Natural


data reversal order of
code input data
X[0] 000 000 x[0]
X[4] 100 001 x[1]
X[2] 010 010 x[2]
X[6] 110 011 x[3]
X[1] 001 100 x[4]
X[5] 101 101 x[5]
X[3] 011 110 x[6]
X[7] 111 111 x[7]
48
Adawy
FFT using MATLAB
fft(x) fft(x,N)
ifft(x) ifft(x,N)

The function fft(x) computes the DFT of a vector x with the


same length as x. The function fft(x,N) computes an N points
DFT of the vector x. If N>x then x is padded with zeros, if N<x
then x is truncated to the first N points. The functions ifft()
.works the same way
MATLAB uses the decimation in time radix 2 algorithm in
calculating the DFT if the input sequence is a power of 2. If x
is not power of 2, it uses mixed algorithms with the radix 2
.algorithm, but it takes more time in this case

49
Adawy
Example
Calculation of the DFT of a sinusoidal sequence with
certain frequency.
Sampling frequency
% calculation of the fft much larger than 20Hz
freq=10; % frequency of the input sinusoid the Nyquest rate for the
fs=64; %sampling frequency 10Hz freq. There will be
N=32; %length of the DFT no aliasing
k=0:N-1;
f=sin(2*pi*freq*k/64);
subplot(2,1,1);
stem(k,f);grid;
ylabel('X[n]');
F=fft(f);
subplot(2,1,2);
stem(k,abs(F));
grid;
xlabel('frequency index k');
ylabel('|x[k]|');
50
Adawy
Input freq. F=10 Hz

Input Ω=2pi10 rad/sec,


Analog frequency

Digital frequency
w=ΩTs=2pi10/64=2pik/32

From which k=5

So, the impulse at f=10Hz in the analog frequency will


appear at k=5 in the digital freq. domain

51
Adawy
As the input sequence x[n] is pure sinusoid, its Fourier
transform should be two impulses at +10Hz, and -10Hz,
and zero elsewhere. As we saw in the last figure the 10Hz
appears as X[5] in the DFT frequency domain at location
k=5. The impulse at -10Hz appears at X[27] at location 32-
.5=27. So, the DFT is correctly calculated
Remember that the digital spectrum is a repeated versions
of the analog spectrum around half the sampling frequency
fs. So the first half of the DFT samples for k=0 to k=N/2-1
corresponds to the positive analog frequency axis f=0 to
f=fs/2. While the second half for k= N/2 to k=N-1
.corresponds to f=-fs/2 t0 f=0

f fs/2 fs/2 N-1 k


10- 10 0
52
Analog spectrum
Adawy
Previous example with N=64
Input freq. F=10 Hz

Input Ω=2pi10 rad/sec,


Analog frequency

Digital frequency
w=ΩTs=2pi10/64=2pik/64

From which k=10

So, the impulse at f=10Hz in the analog frequency will


appear at k=10 in the digital freq. domain
53
Adawy
Same previous
example with
f=11Hz, N=30,
fs=64Hz

Input freq. F=11 Hz

Input Ω=2pi11 rad/sec,


Analog frequency

Digital frequency w=ΩTs=2pi11/64=2pik/32

From which k=11/2

So,
54
the impulse at f=11Hz in the analog frequency will appear
at k=5 and 6 in the digital freq. domain Adawy
Using fft to calculate convolution of two sequences
%demonistration of the IFFT
g=[1 2 0 1];
ga=[g zeros(1,length(h)-1)]
subplot(3,1,1);
stem(ga);
ylabel('First sequence');
h=[2 2 1 1];
ha=[h zeros(1,length(g)-1)]
subplot(3,1,2);
stem(ha);
ylabel('Second sequence');
G=fft(ga);
H=fft(ha);
Y=G.*H;
y=ifft(Y);
subplot(3,1,3);
stem(real(y));
ylabel('Result sequence');
disp('New sequence'); New sequence
disp(real(y)); 2.0000 6.0000 5.0000 5.0000
55 4.0000 1.0000 1.0000
Adawy

Potrebbero piacerti anche