Anda di halaman 1dari 24

La Transformada Rpida de Fourier

Cuando la funcin f(t) est dada por una lista de N


valores f(t1), f(t2), ...f(tN) se dice que est
discretizada o muestreada, entonces la integral
que define la Transformada de Fourier:

F() f ( t )e jt dt

Se convierte en la sumatoria
N

F(n ) f ( t k )e

j 2Nn ( k 1)

, para 1 n N

k 1

(Donde k es la frecuencia discreta)


Llamada Transformada Discreta de Fourier

La Transformada Rpida de Fourier


La Transformada Discreta de Fourier (DFT)
requiere el clculo de N funciones
exponenciales para obtener F(n), lo cual
resulta un esfuerzo de clculo enorme para
N grande.
Se han desarrollado mtodos que permiten
ahorrar clculos y evaluar de manera rpida
la Transformada discreta, a estos mtodos
se les llama
Transformada Rpida de Fourier (FFT)

La FFT y la Serie de Fourier


Podemos hacer uso de la FFT para calcular
los coeficientes cn y c-n de la Serie compleja
de Fourier como sigue:
Ejemplo: Sea f(t) el tren de pulsos de ancho
p y periodo T.
1

f(t)

...

-T

-T/

2
-p/

0
2

p/

T/
2

T ...

La FFT y la Serie de Fourier


La versin muestreada f(k) de f(t) slo
puede tomar un nmero finito de puntos.
Tomemos por ejemplo N=32 puntos
cuidando que cubran el intervalo de 0 a T
(con p=1,
T=2): 32 muestras de f(t), de 0 a T
1.5
f(k)

0.5

La FFT y la Serie de Fourier


Para obtener estas 32 muestras usando
Matlab se puede hacer lo siguiente:
k=0:31
f=[(k<8)|(k>23)]
Plot(k,f,o)

La FFT y la Serie de Fourier


Con los 32 puntos f(k) calculamos F(n)
mediante la FFT, por ejemplo, en Matlab:
F=fft(f)/N;

Con lo que obtenemos 32 valores complejos


de F(n). Estos valores son los coeficientes
de la serie compleja ordenados como sigue:
n

F(n) c0 c1

...

16

17

18

19

...

32

c2 c3 ... c15 c-16 c-15 c-14 ... c-1

La FFT y la Serie de Fourier


Podemos graficar el espectro de amplitud
reordenando previamente F(n) como sigue
aux=F;
F(1:16)=aux(17:32);
F(17:32)=aux(1:16);

F(n) queda:
n

F(n) c-16

...

13

14

15

16

17

18

19

...

...

c-3 c-2 c-1 c0 c1

c2

c3 ... c15

Y para graficar el espectro de amplitud:


stem(abs(F))

Obtenindose:

32

La FFT y la Serie de Fourier


Espectro de Amplitud |F(n)|
Para el tren de pulsos p=1,
T=2

|F(n)

0.6

0.4

0.2

10

20

30

Si deseamos una escala horizontal en


unidades de frecuencia (rad/seg):

La FFT y la Serie de Fourier


w0=2*pi/T;
n=-16:15;
w=n*w0;
Stem(w,abs(F))
Espectro de Amplitud |F(n)|
0.6

|F(w)|

para el tren de pulsos, p=1,T=2

0.4

Obteniendo:
0.2

-50

50

La FFT y la Serie de Fourier


Tambin podemos obtener los coeficientes
de la forma trigonomtrica, recordando que:

c n 12 (a n jb n ), c n 12 (a n jb n )
Podemos obtener
a 0 c 0 , a n 2 Re( c n ), b 2 Im( c n )
Para el ejemplo se obtiene: a0=0.5, an=bn=0
(para n par), adems para n impar:
n

11

13

15

an 0.6346 -0.2060 0.1169 -0.0762 0.0513 -0.0334 0.0190 -0.0062

bn

-0.0625 0.0625

0.0625 -0.0625 0.0625 -0.0625 0.0625


0.0625

La FFT y la Serie de Fourier


Como el tren de pulsos es una funcin par,
se esperaba que bn=0; (el resultado
obtenido es errneo para bn, pero el error
disminuye1para N grande):
a0
0.5

Coeficientes bn Coeficientes an
0

-0.5

10

20

30

La FFT y la Serie de Fourier


Tarea: Usar el siguiente cdigo para generar 128
puntos de una funcin peridica con frecuencia
fundamental 0=120 (60 hertz) y dos armnicos
impares en el intervalo [0,T]:
N=128;
w0=120*pi;
T=1/60;
t=0:T/(N-1):T;
f=sin(w0*t)+0.2*sin(3*w0*t)+0.1*sin(11*w0*t);

Usando una funcin peridica diferente a la


subrayada:
a) Graficar la funcin.
b) Obtener y graficar el espectro de amplitud de la
seal usando la funcin FFT

Medidores Digitales
La FFT ha hecho posible el desarrollo de
equipo electrnico digital con la capacidad
de clculo de espectros de frecuencia para
seales del mundo real, por ejemplo:
1) Osciloscopio digital Fuke 123 ($ 18,600.00
M.N.)
2) Osc. digital Tektronix THS720P ($3,796 dls)
3) Power Platform PP-4300

Medidores Digitales
El Fluke 123 scope meter

Medidores Digitales
Tektronix THS720P (osciloscopio digital)

Medidores Digitales
Analizador de potencia PP-4300
Es un equipo especializado en monitoreo de
la calidad de la energa: permite medicin
de 4 seales simultneas (para sistemas
trifsicos)

Fast Fourier Transform (FFT), I


DFT appears to be an O(N2) process.
Danielson and Lanczos; DFT of length N can be rewritten as the sum
of two DFT of length N/2.
N 1

H k e 2ijk / N h j
j 0

N / 2 1

2i ( 2 j ) k / N

j 0

N / 2 1

e
j 0

2ijk /( N / 2 )

h2 j

N / 2 1

h2 j e

2 i ( 2 j 1) k / N

j 0

2ik / N

h2 j 1

N / 2 1

2 ijk /( N / 2 )

k 0

h2 k 1

H k0 e 2ik / N H k1 H k0 W k H k1 , (W e 2i / N )
We can do the same reduction of Hk0 to the transform of its N/4 evennumbered input data and N/4 odd-numbered data.
For N = 2R, we can continue applying the reduction until we subdivide
the data into the transforms of length 1.
For every pattern of log2N number of 0s and 1s, there is one-point
transformation that is just one of the input number hn

H k1001...001 hn

for some n

Fast Fourier Transform (FFT), II


For N=8
7

H k W jk h j h0 W k h1 W 2 k h2 W 3k h3 W 4 k h4 W 5 k h5 W 6 k h6 W 7 k h7
j 0

(h0 W 2 k h2 W 4 k h4 W 6 k h6 ) W k (h1 W 2 k h3 W 4 k h5 W 6 k h7 )
(h0 W 4 k h4 ) W 2 k (h2 W 4 k h6 ) W k [(h1 W 4 k h5 ) W 2 k (h3 W 4 k h7 )]
(h0 ) W 4 k (h4 ) W 2 k [h2 W 4 k (h6 )] W k [(h1 ) W 4 k (h5 ) W 2 k [h3 W 4 k (h7 )]]

Since WN/2 = -1, Hk0 and Hk1 have period N/2,


H k H k0 W k H k1 ,

H k N/ 2 H k0 W k H k1

for k 0,1,..., N / 2 1

Diagrammatically (butterfly),
H k0

H k0 W k H k1

H k1

H k0 W k H k1

(k 0,1,...,N / 2 1)

There are N/2 butterflies for this stage of the FFT, and each butterfly
requires one multiplication

Fast Fourier Transform (FFT), III


So far,

H 00

H 00 W 0 H 01 H 0

H10

H10 W 1 H11 H1

H 20

H 20 W 2 H 21 H 2

H 30

H 30 W 3 H 31 H 3

H 01

H 00 W 0 H k1 H 4

H11

H10 W 1 H11 H 5

H 21

H 20 W 2 H 21 H 6

H 31

H 30 W 3 H 31 H 7

The splitting of {Hk} into two half-size DFTs can be repeated on


Hk0 and Hk1 themselves,
H k0 H k00 W 2 k H k01 ,

H k0 N/ 4 H k00 W 2 k H k01

H k1 H k10 W 2 k H k11 ,

H k1 N/ 4 H k10 W 2 k H k11 for k 0,1,...,N / 4 1

Fast Fourier Transform (FFT), III


So far,

H 000

H 000 W 0 H 001 H 00

H 00 W 0 H 01 H 0

H100

H100 W 2 H101 H10

H10 W 1 H11 H1

H 001

H 000 W 0 H 001 H 20

H 20 W 2 H 21 H 2

H101

H100 W 2 H101 H 30

H 30 W 3 H 31 H 3

H 010

H 010 W 0 H 011 H 01

H 00 W 0 H 01 H 4

H110

H110 W 2 H111 H11

H10 W 1 H11 H 5

H 011

H 010 W 0 H 011 H 21

H 20 W 2 H 21 H 6

H111

H110 W 2 H111 H 31

H 30 W 3 H 31 H 7

{Hk00} is the N/4-point DFT of {h0, h4,, hN-4},


{Hk01} is the N/4-point DFT of {h2, h6,, hN-2},
{Hk10} is the N/4-point DFT of {h1, h5,, hN-3},
{Hk11} is the N/4-point DFT of {h3, h7,, hN-1},
Note that there is a reversal of the last two digits in the binary
expansions of the indices j in {hj}.

Fast Fourier Transform (FFT), IV

Fast Fourier Transform (FFT), V


If we continue with this process of halving
the order of the DFTS, then after R=log2N
stages, we reach where we are performing N
one-point DFTs.
One-point DFT of the number hj is just the
identity hj hj
Since the reversal of the order of the bits will
continue, all bits in the binary expansion of j
will be arranged in reverse order.
Therefore, to begin the FFT, one must first
rearrange {hj} so it is listed in bit reverse
order.

For each of the log2N stages, there are N/2


multiplications, hence there are (N/2)log2N
multiplications needed for FFT.
Much less time than the (N-1)2 multiplications
needed for a direct DFT calculation.
When N=1024, FFT=5120 multiplication,
DFT=1,046,529 savings by a factor of
almost 200.

Fast Fourier Transform (FFT), VI

Anda mungkin juga menyukai