Anda di halaman 1dari 30

Lecture 7: The Discrete Fourier Transform

Prof. Dr. Salina A.


Samad
Mr. Iskandar Yahya
Introduction
Discrete-time Fourier Transform
 provides the frequency-domain (w) representation for
absolutely summable sequences
 Hence, useful signals in practice for which the discrete-time
Fourier transform does not exist [ex) u(n), nu(n)]
 The transient response of a system due to initial conditions or
due to changing inputs cannot be computed using the
discrete-time Fourier transform approach

z-Transform
 provides a generalized frequency-domain (z)
representation for arbitrary sequences
 Extension of the discrete-time Fourier transform
Introduction
Two features of these transforms
 The transforms are defined for infinite-length sequences
 They are functions of continuous variables (w or z)

-> From the numerical computation viewpoint (or from


MATLAB’s viewpoint), these two features are troublesome
because one has to evaluate infinite sums at uncountably
infinite frequencies
-> To use MATLAB, we have to truncate sequences and
then evaluate the expressions at finitely many points
-> The evaluations were obviously approximations to the
exact calculations
-> In other words, the discrete-time Fourier transform and
the z-transform are not numerically computable
transforms
Introduction
Numerical computable transform
 DFS (Discrete Fourier Series)
 DFT (Discrete Fourier Transform)
 FFT (Fast discrete Fourier Transform)
 Because the numerical computation of the DFT for long
sequences is prohibitively time consuming, several
algorithms have been developed to efficiently compute
the DFT
Discrete Fourier Series
Periodic sequence
~x (n) = ~x (n + kN ), ∀ n, k
N : fundamental period of the sequence
 Discrete Fourier series representation of periodic

~ 1 ~ j kn
x ( n ) ≅ sequence
IDFS [ X ( k )] = ∑ k = 0 X ( k )e N , n = 0 , ± 1,...
~ N − 1

N
1 N −1 ~ synthesis
= ∑ k = 0 X ( k )WN , n = 0, ± 1,...
− nk
or N
an inverse
DFS equation 2π
~ − j nk
x ( n )] = ∑n =0 ~
N −1
X ( k ) ≅ DFS [ ~ x ( n )e N , k = 0, ± 1,...

= ∑n =Fourier
N −1~ nk
 The discrete x ( n )W N series
, k = 0 , ± 1coefficients
,...
0

−j
2π analysis
or where W = e N

an DFS
Discrete Fourier Series
Example 1: Find DFS representation of the priodic
sequence given below:
~
x ( n ) = {...,0,1,2,3,0,1,2 ,3,0 ,1,2,3,...}

~
X ( k ) = ∑n =0 ~
N −1
x ( n )W N nk , k = 0, ± 1,...
Solution:
fundanmental period of the above sequence is N = 4

−j π π
W4 = e 4 = cos − j sin = − j
2 2
~
X ( 0 ) = ∑n = 0 ~
x ( n )W 0 n = ~
x( 0 ) + ~
x(1) + ~
x( 2 ) + ~
3
4 x( 3 ) = 6
~
X ( 1 ) = ∑n =0 ~
x ( n )W41n = ∑n =0 ~
x ( n )( − j )n =~
x ( 0 ) − j~
x(1) − ~
x ( 2 ) + j~
3 3
x ( 3 ) = −2 + 2 j
~
X ( 2 ) = ∑n =0 ~
x ( n )W4 2 n = ∑n =0 ~
3 3
x ( n )( − j )2 n = − 2
~
X ( 3 ) = ∑n =0 ~
x ( n )W4 3n = ∑n =0 ~
3 3
x ( n )( − j )3n = − 2 − 2 j
~
X ( 4 ) = ∑n =0 ~
x ( n )W4 4 n = ∑n =0 ~
x ( n )( − j )4 n =~
x( 0 ) + ~
x (1 ) + ~
x( 2 ) + ~
3 3
x ( 3 ) = 6,...
Discrete Fourier Series
 Solution in MATLAB:
 We can use for…end loop to implement X(k) summation and
compute all DFS coefficients. But this nested two for…end
loop is inefficient in MATLAB.
 An efficient way is to use a matrix-vector multiplication for each
of the relations in the manual solution:

~ 1 ~
X = WN ~
x ~
x = WN * X
N
WN = { WN kn 0≤ k ,n ≤ N −1 }

1 1  1 
1 WN 1⋅1 WN 1⋅( N −1 )  k

= 
  ↓
1 WN ( N −1 )⋅1 WN ( N −1 )⋅( N −1 ) 
n→
Discrete Fourier Series
 Matlab implementation:

 Create a function called dfs:

function [Xk] = dfs(xn,N)


% Computes Discrete Fourier Series Coefficients
% ----------------------------------------
% [Xk] = dfs(xn,N)
% Xk = DFS coeff. array over 0 <= k <= N-1
% xn = One period of periodic signal over 0 <= n <= N-1
% N = Fundamental period of xn
%
n = [0:1:N-1]; % row vector for n
k = [0:1:N-1]; % row vector for k
WN = exp(-j*2*pi/N); % Wn factor
nk = n'*k; % creates a N by N matrix of nk values
WNnk = WN .^ nk; % DFS matrix
Xk = xn * WNnk; % row vector for DFS codfficients
Discrete Fourier Series
 Implementation for example 1 in the main window:

xn = [0,1,2,3]; N = 4;
Xk = dfs(xn,N)
Xk =
6.0000 -2.0000 + 2.0000i -2.0000 -
0.0000i -2.0000 - 2.0000i

 Check with the manual approach done earlier, should be the


same.
Discrete Fourier Series
 To implement the synthesis equation, we can write a
function called “idfs”:
function [xn] = idfs(Xk,N)
% Computes Inverse Discrete Fourier Series
% ------------------------------------
% [xn] = idfs(Xk,N)
% xn = One period of periodic signal over 0 <= n <= N-1
% Xk = DFS coeff. array over 0 <= k <= N-1
% N = Fundamental period of Xk
%
n = [0:1:N-1]; % row vector for n
k = [0:1:N-1]; % row vector for k
WN = exp(-j*2*pi/N); % Wn factor
nk = n'*k; % creates a N by N matrix of nk
values
WNnk = WN .^ (-nk); % IDFS matrix
xn = (Xk * WNnk)/N; % row vector for IDFS values
Discrete Fourier Series
 Example 2: A periodic “square wave” sequence is given by:
~ 1 mN < n < mN + L − 1
x( n ) =  ; m = 0,±1,...
0 mN + L < n < ( m + 1 ) N − 1
 N : fundamental period, L/N : duty cycle
 A) determine the expression for magnitude:
2π 2π 2π
~ − j nk L −1 − j nk −j k
X ( n ) = ∑n =0 ~
x ( n )e N = ∑n =0 e N = ∑n =0 ( e N )n
N −1 L −1

 L
 2π
− j Lk k = 0 ,± N ,...
= 1 − e N
 2π otherwise
−j k
 1 − e N
−j

Lk −j
π
Lk j
π
Lk −j
π
Lk π
π sin( Lk )
1− e N e N e N −e N − j ( L −1 )k
N
= = e N
−j

k −j
π
k j
π
k −j
π
k π
1− e N e N e N −e N sin( k )
N
 L
~  sin( πkL / N ) k = 0,± N ,...
X( n ) = 
 sin( πk / N ) otherwise
Discrete Fourier Series
 B) Plot magnitude:
% Part (b)1 % Part (b)3
L = 5; N = 20; L = 5; N = 60;
xn = [ones(1,L), zeros(1,N-L)]; xn = [ones(1,L), zeros(1,N-L)];
Xk = dfs(xn,N); Xk = dfs(xn,N);
magXk = abs([Xk(N/2+1:N) Xk(1:N/2+1)]); magXk = abs([Xk(N/2+1:N) Xk(1:N/2+1)]);
k = [-N/2:N/2]; k = [-N/2:N/2];
subplot(2,2,1); stem(k,magXk); axis([- subplot(2,2,3); stem(k,magXk); axis([-
N/2,N/2,-0.5,5.5]) N/2,N/2,-0.5,5.5])
xlabel('k'); ylabel('Xtilde(k)') xlabel('k'); ylabel('Xtilde(k)')
title('DFS of SQ. wave: L=5, N=20') title('DFS of SQ. wave: L=5, N=60')
% Part (b)2 % Part (b)4
L = 5; N = 40; L = 7; N = 60;
xn = [ones(1,L), zeros(1,N-L)]; xn = [ones(1,L), zeros(1,N-L)];
Xk = dfs(xn,N); Xk = dfs(xn,N);
magXk = abs([Xk(N/2+1:N) Xk(1:N/2+1)]); magXk = abs([Xk(N/2+1:N) Xk(1:N/2+1)]);
k = [-N/2:N/2]; k = [-N/2:N/2];
subplot(2,2,2); stem(k,magXk); axis([- subplot(2,2,4); stem(k,magXk); axis([-
N/2,N/2,-0.5,5.5]) N/2,N/2,-0.5,7.5])
xlabel('k'); ylabel('Xtilde(k)') xlabel('k'); ylabel('Xtilde(k)')
title('DFS of SQ. wave: L=5, N=40') title('DFS of SQ. wave: L=7, N=60')
Discrete Fourier Series
 B) Plot magnitude:
DFS of SQ. wave: L=5, N=20 DFS of SQ. wave: L=5, N=40

5 5
4 4
3 3

Xtilde(k)
Xtilde(k)

2 2
1 1
0 0
­10 ­5 0 5 10 ­20 ­10 0 10 20
k k
DFS of SQ. wave: L=5, N=60 DFS of SQ. wave: L=7, N=60

5
6
4
3
Xtilde(k)
Xtilde(k)

4
2
2
1
0 0
­20 0 20 ­20 0 20
k k
Discrete Fourier Series
 Relations to the z-transform
 x(n) is a finite-duration sequence of duration N

nonzero 0 ≤ n ≤ N − 1
x( n ) = 
 0 elsewhere

X ( z ) = ∑n =0 x( n )z − n
N −1

x( n ) ~
 We construct a periodic sequence by periodically
repeating x(n) with period N
~x( n ) 0 ≤ n ≤ N −1
x( n ) = 
 0 elsewhere
DFS of ~ x( n )
2π 2π −n
−j nk j k
X ( z ) = ∑ n =0 x ( n )e = ∑ n = 0 x( n )[ e
N −1~ N N −1 N ]

~ 2π
∴ X ( k ) = X ( z ) z =e j N k
Discrete Fourier Series
 Relations to the DTFT
~
X ( k ) = X ( e jw ) 2π
w= k
N
 DFS is obtained by evenly sampling the DTFT at w1=2π/N
intervals

 Example 3:
 Let: X(n) = {0,1,2,3}

∑−∞
 A) Compute ∞
X ( e jw ) =DTFT:
x( n )e − jwn = e − jw + 2e − j 2 w + 3e − j 3w

 B) Sampling at kw1=2π/4 k, k=0,1,2,3


X ( e j 0 ) = e − j 0 + 2e − j 2⋅0 + 3e − j 3⋅0 = 1 + 2 + 3 = 6
~
X ( e j 2 π / 4 ) = e − j 2 π / 4 + 2e − j 2⋅2 π / 4 + 3e − j 3⋅2 π / 4 = −2 + 2 j = X ( 1 )
~
X ( e j 4 π / 4 ) = e − j 4 π / 4 + 2e − j 2⋅4 π / 4 + 3e − j 3⋅4 π / 4 = 2 = X ( 2 )
~
X ( e j 6 π / 4 ) = e − j 6 π / 4 + 2e − j 2⋅6 π / 4 + 3e − j 3⋅6 π / 4 = −2 − 2 j = X ( 3 )
Discrete Fourier Series
 DFT
 The sampling of the DTFT result in a periodic sequence
 But most of all signals in practice are not periodic
 They are likely to be of finite duration
 How can we develop a numerically computable Fourier
representation for such signals?
 Theoretically, we can take care of this problem by
 defining a periodic signal whose primary shape is that of the
finite-duration signal,
 and then using the DFS on this periodic signal

 x(n) : finite-duration sequence that has N samples over


0<=n<=N-1 as an N-point sequence
~
x ( n ) : periodic signal of period N, created using the N-point
sequence x(n)

~ ∞
x ( n ) = r = −∞ x( n − rN )
~
x ( n ) = x( n mod N )
Discrete Fourier Series
 We use the following convenient notation to denote the
modulo-N operation:

x(( n ))N = x( n mod N )


~
x ( n ) = x(( n ))N periodic extention
x( n ) = ~x ( n )R ( n ) Window operation
N

~ ~x( n ) 0 ≤ n ≤ N −1
where x( n ) = x ( n )R N ( n ) = 
 0 else
R N ( n ) is called a rec tan gular window of length N
Discrete Fourier Series
 Discrete Fourier Transform of an N-point sequence

 X~ ( k ) 0 ≤ n ≤ N − 1 ~
X ( k ) ≅ DFT [ x( n )] =  = X ( k )R N ( k )
 0 else
or
X ( k ) = ∑ n =0 x( n )W N nk , 0 ≤ k ≤ N − 1
N −1

X = WN x

 Inverse Discrete Fourier Transform of an N-point sequence

x( n ) ≅ IDFT [ X ( k )] = ~
x ( n )R N ( n )
or
1
∑k =0 X ( k )WN −kn ,
N −1
X( k ) = 0 ≤ n ≤ N −1
N
1
x= WN * X
N
Discrete Fourier Series
 MATLAB implementation
 dfs and idfs MATLAB functions can be renamed as the dft and
idft functions to implement the discrete Fourier transform
computations
function [Xk] = dft(xn,N) function [xn] = idft(Xk,N)
% Computes Discrete Fourier Transform % Computes Inverse Discrete Transform
% -------------------------------- % --------------------------------
% [Xk] = dft(xn,N) % [xn] = idft(Xk,N)
% Xk = DFT coeff. array over 0 <= k <= N-1 % xn = N-point sequence over 0 <= n <= N-1
% xn = N-point finite-duration sequence % Xk = DFT coeff. array over 0 <= k <= N-1
% N = Length of DFT % N = Length of DFT
% %
n = [0:1:N-1]; % row vector for n n = [0:1:N-1]; % row vector for n
k = [0:1:N-1]; % row vector for k k = [0:1:N-1]; % row vector for k
WN = exp(-j*2*pi/N); % Wn factor WN = exp(-j*2*pi/N); % Wn factor
nk = n'*k; % creates a N nk = n'*k; % creates a N
by N matrix of nk values by N matrix of nk values
WNnk = WN .^ nk; % DFT matrix WNnk = WN .^ (-nk); % IDFT matrix
Xk = xn * WNnk; % row vector for DFT xn = (Xk * WNnk)/N; % row vector for IDFT
codfficients values
Discrete Fourier Series
 Example 4: Let x(n) be a 4-point sequence:1 0 ≤ n ≤ 3
x( n ) = 
0 otherwise

 A) Then, the DTFT:


1 − e − j 4w sin( 2 w ) − j 3w / 2

jw 3 − jwn − jw − j 2w − j 3w
X(e )= x( n )e = 1+ e +e +e = = e
0
1 − e − jw sin( w / 2 )
sin( 2w )
X ( e jw ) =
sin( w / 2 )
 3w when sin( 2w ) > 0
 −
2 sin( w / 2 )
∠X ( e jw ) = 
3w sin( 2w )
− ± π when <0
 2 sin( w / 2 )
 B) 4-point DFT of x(n)

∑ ∑n=0 x( n )W4 nk ,
N −1 nk 3
X 4( k ) = n =0
x( n )W N = 0≤k ≤3
W4 = e − j 2 π / 4 = cos( 2π / 4 ) − j sin( 2π / 4 ) = − j

this are similar to those in example 1


Discrete Fourier Series
 Matlab implementation:
% Example 4: Simple DFT Example
x = [1,1,1,1]; subplot(1,1,1);
% a) DTFT
w = [0:1:500]*2*pi/500; [H] = freqz(x,1,w);
magH = abs(H); phaH = angle(H); phaH(126)=-47.5841*pi/180;
Magnitude of the DTFT Angle of the DTFT
subplot(2,2,1); plot(w/pi,magH); grid 4 200
xlabel('frequency in pi units'); ylabel('|X|');
title('Magnitude of the DTFT') 3 100
subplot(2,2,2); plot(w/pi,phaH/pi*180); grid

Degrees
xlabel('frequency in pi units'); ylabel('Degrees'); 2 0

|X|
title('Angle of the DTFT')
1 ­100
%print -deps2 me0506a.eps
% 0 ­200
% b) 4-point DFT 0 0.5 1 1.5 2 0 0.5 1 1.5 2
frequency in pi units frequency in pi units
N = 4; w1 = 2*pi/N; k = 0:N-1; X = dft(x,N); Magnitude of the DFT: N=4 Angle of the DFT: N=4
4 200
magX = abs(X), phaX = angle(X)*180/pi
subplot(2,2,3);plot(w*N/(2*pi),magH,'--'); grid 3 100
axis([0,4,0,4]); hold on

Degrees
2 0

|X(k)|
stem(k,magX); xlabel('k'); ylabel('|X(k)|');
title('Magnitude of the DFT: N=4')
1 ­100
hold off
subplot(2,2,4);plot(w*N/(2*pi),phaH*180/pi,'--'); grid 0 ­200
0 1 2 3 4 0 1 2 3 4
axis([0,4,-200,200]); hold on k k
stem(k,phaX); xlabel('k'); ylabel('Degrees'); title('Angle
of the DFT: N=4')
%print -deps2 me0506b.eps
Discrete Fourier Series
 Example 5: DTFT other sample X(ejw) ?
 For N = 8;
x( n ) = { 1,1,1,1,0 ,0 ,0 ,0 }

∑n=0 x( n )WN nk = ∑n=0 x( n )W8 nk ,


N −1 7
X 8( k ) = 0 ≤ k ≤ 7; W8 = e − jπ / 4
Frequency resolution : w1 = 2π / 8 = π / 4
% Example 5: Zero-padding Example
Magnitude of the DFT: N=8
subplot(1,1,1); x = [1,1,1,1]; 5
% a) DTFT 4
w = [0:1:500]*2*pi/500; [H] = freqz(x,1,w); 3
magH = abs(H); phaH = angle(H); phaH(126)=-47.5841*pi/180; 2

|X(k)|
% b) 8-point DFT 1
N = 8; w1 = 2*pi/N; k = 0:N-1; 0
x = [x, zeros(1,4)]; X = dft(x,N); ­1
0 1 2 3 4 5 6 7 8
magX = abs(X), phaX = angle(X)*180/pi k
subplot(2,1,1);plot(w*N/(2*pi),magH,'--'); Angle of the DFT: N=8
200
axis([-0.1,8.1,-1,5]); hold on
stem(k,magX); xlabel('k'); ylabel('|X(k)|'); 100
title('Magnitude of the DFT: N=8') Degrees
0
hold off
subplot(2,1,2);plot(w*N/(2*pi),phaH*180/pi,'--'); ­100
axis([-0.1,8.1,-200,200]); hold on
­200
stem(k,phaX); xlabel('k'); ylabel('Degrees'); title('Angle 0 1 2 3 4 5 6 7 8
of the DFT: N=8'); k
Discrete Fourier Series
 For N = 16;
x( n ) = { 1,1,1,1,0,0,0,0,0,0 ,0,0,0,0,0,0 }

∑n=0 x( n )WN nk = ∑n=0 x( n )W15 nk ,


N −1 15
X 16 ( k ) = 0 ≤ k ≤ 15; W16 = e − j 2 π / 16

% c) 16-point DFT
subplot(1,1,1)
N = 16; w1 = 2*pi/N; k = 0:N-1; Magnitude of the DFT: N=16
5
x = [x, zeros(1,8)]; 4
X = dft(x,N); 3
magX = abs(X), phaX = angle(X)*180/pi 2

|X(k)|
subplot(2,1,1);plot(w*N/(2*pi),magH,'--'); 1
axis([-0.1,16.1,-1,5]); hold on 0
stem(k,magX); ­1
0 2 4 6 8 10 12 14 16
xlabel('k');
k
ylabel('|X(k)|'); title('Magnitude of the DFT: Angle of the DFT: N=16
N=16') 200

hold off 100


subplot(2,1,2);plot(w*N/(2*pi),phaH*180/pi,'--'
); Degrees
0
axis([-0.1,16.1,-200,200]); hold on
­100
stem(k,phaX);
xlabel('k'); ­200
0 2 4 6 8 10 12 14 16
ylabel('Degrees'); title('Angle of the DFT: k
N=16')
%print -deps2 me0507b.eps
Discrete Fourier Series
 Example 6: To illustrate the difference between the high-density
spectrum and the high-resolution spectrum:
x( n ) = cos( 0.48πn ) + cos( 0.52πn )
DFT of x( n ), 0 ≤ n ≤ 10
 A) Determine the

% Chapter 05: Example 6: HiRes Spectrum

signal x(n), 0 <= n <= 9

2
%
% a. 1

% Spectrum based on the first 10 samples of x(n) 0


n1=[0:1:9];y1=x(1:1:10); ­1
subplot(2,1,1);stem(n1,y1);title('signal x(n), 0 <= n ­2
<= 9');xlabel('n')
axis([0,10,-2.5,2.5]) 0 1 2 3 4 5 6 7 8 9 10
n
Y1=fft(y1);magY1=abs(Y1(1:1:6)); Samples of DTFT Magnitude
10
k1=0:1:5;w1=2*pi/10*k1;
8
subplot(2,1,2);stem(w1/pi,magY1);title('Samples of
DTFT Magnitude'); 6
xlabel('frequency in pi units') 4
axis([0,1,0,10])
2
disp('Press RETURN to continue');pause;
0
%print -deps2 me0508a.eps; subplot 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
% frequency in pi units
Discrete Fourier Series
% High density spectrum (100 samples) based on the first 10
samples of x(n)
n3=[0:1:99];y3=[x(1:1:10) zeros(1,90)];
subplot(2,1,1);stem(n3,y3);title('signal x(n), 0 <= n <= 9 +
90 zeros');xlabel('n')
axis([0,100,-2.5,2.5])
Y3=fft(y3);magY3=abs(Y3(1:1:51));
k3=0:1:50;w3=2*pi/100*k3;
subplot(2,1,2);plot(w3/pi,magY3);title('DTFT
Magnitude');xlabel('frequency in pi units')
axis([0,1,0,10])
disp('Press RETURN to continue');pause;
%print -deps2 me0508b.eps; subplot

% b.
% High resolution spectrum based on 100 samples of the signal
x(n)
subplot(1,1,1)
n=[0:1:99];
x=cos(0.48*pi*n)+cos(0.52*pi*n);
subplot(2,1,1);stem(n,x);title('signal x(n), 0 <= n <=
99');xlabel('n')
axis([0,100,-2.5,2.5])
X=fft(x);magX=abs(X(1:1:51));
k=0:1:50;w=2*pi/100*k;
subplot(2,1,2);plot(w/pi,magX);title('DTFT
Magnitude');xlabel('frequency in pi units')
axis([0,1,0,60])
disp('Press RETURN to continue');pause;
%print -deps2 me0508c.eps; subplot
Discrete Fourier Series
signal x(n), 0 <= n <= 9 + 90 zeros signal x(n), 0 <= n <= 99

2 2

1 1

0 0

­1 ­1

­2 ­2

0 10 20 30 40 50 60 70 80 90 100 0 10 20 30 40 50 60 70 80 90 100
n n
DTFT Magnitude DTFT Magnitude
10 60

8
40
6

4
20
2

0 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
frequency in pi units frequency in pi units
Fast Fourier Transform
(FFT)
 DFT
 DFT is the only transform that is discrete in both the time and
the frequency domains,
 and is defined for finite-duration sequences
 Although it is a computable transform, the straightforward
implementation is very inefficient, especially when the
sequence length N is large
 It also led to the development of other efficient algorithms
 All these algorithms are collectively known as fast Fourier
Transform (FFT) algorithms
 N-point DFT
X(k ) = ∑n =0 x (n ) WN nk , 0 ≤ k ≤ N − 1
N −1


−j
where W = e N

C N = o( N 2 )

 For large N, o(N2) is unacceptable in practice


Fast Fourier Transform
(FFT)
 Goal of an efficient computation
 One algorithm that considers only the periodicity of is the
Goertzel algorithm. This algorithm still requires
multiplications, but it has certain advantages. This algorithm is
described in Chapter 10
 DIT-FFT (decimation-in-time) and DIF-FFT (decimation-in-
frequency)
 Symmetry and periodicity properties in reducing the number
of = o( N log N )
C Ncomputations
Fast Fourier Transform
(FFT)
 Example: Let us discuss the computations of a 4-point DFT
and develop an efficient algorithm for its computation:
∑n =0 x (n )WN nk ,
3
X(k ) = 0 ≤ k ≤ 3; W4 = e − j2 π / 4 = − j

 Can be done in matrix form:


 X(0)   W4 0 W4 0 W4 0 W4 0   x (0) 
 X(1)   0   x (1) 
W W41 W4 2 W4 3 
  =  40  
 X(2) W W4 2 W4 4 W4 6   x (2)
   40   
 X(3)   W4 W4 3 W4 6 9
W4   x (3) 

which requires 16 complex multiplications


Efficient Approach : Using periodicity
W4 0 = W4 4 = 1; W41 = W4 9 = − j
W4 2 = W4 6 = −1; W4 3 = j
 X(0)get
And substituting in the above matrix form, we  1 1 1 1   x (0) 
 X(1)  1 − j − 1 j   x (1) 
  =  
 X(2) 1 − 1 1 − 1  x (2)
    
 X (3)  1 j − 1 − j x (3) 
Fast Fourier Transform
(FFT)
Using symmetry, we obtain
X(0) = x (0) + x (1) + x (2) + x (3) = [ x (0) + x (2)] + [ x (1) + x (3)]
g1 g2
X(0) = x (0) − jx (1) + x (2) + jx (3) = [ x (0) − x (2)] − j[ x (1) − x (3)]
h1 h2
X(0) = x (0) − x (1) + x (2) − x (3) = [ x (0) + x (2)] + [ x (1) + x (3)]
g1 g2
X(0) = x (0) + jx (1) − x (2) − jx (3) = [ x (0) − x (2)] + j[ x (1) − x (3)]
h1 h2
step 1 step 2
g1 = x (0) + x (2) X(0) = g1 + g 2
g 2 = x (1) + x (3) X(1) = h1 − jh 2
h1 = x (0) − x (2) X(2) = g1 − g 2
h 2 = x (1) − x (3) X(3) = h1 + jh 2

 Which requires only 2 complex multiplications, which is a


considerably smaller number, even for this simple example.

Anda mungkin juga menyukai