Professional Documents
Culture Documents
Lecture – 8 Objectives
N 1
X k DFT [ x(n)] x n WNnk
n 0
1 N 1
x n IDFT [ X (k )] X k WN nk ,
N k 0
2
j
WN e N
To learn and understand
DFT - the frequency domain
x n ~
~ x n kN
where N is the fundamental period of the sequence.
N 1 2
x n X k e
~ 1 ~ j kn
N
, n 0,1,2,..., N 1 IDFS
N k 0
where X k ,
~
k 0,1,2,..., N 1 are called the discrete
N 1 2
j
X k x n e
~ ~ nk
N
, k 0,1,2,..., N 1 DFS
n 0
2
j
Using WN e N , previous 2 equations can be expressed as
N 1
ˆ DFS~
X k x n ~
x n WNnk
~
n 0
N 1
x n ˆ IDFS X k X k WN
~ 1 ~
~
N
k 0
nk
X N WN x N 1 *
x N WN-1X N WN X N
N
where the matrix WN called a DFS matrix given by
WN ˆ WNkn
x0 X 0
0 k , n N 1
n
x1 X 1
1 1
xN XN
1 ...
WN1 ... WN N 1 :
k 1 :
:
xN - 1 XN 1
: ...
N 1 N 12
1 WN ... WN
n 0
3
X 1 ~
x n j 0 1 j 2 j 3 j 2 2 j
~
Similarly, n 2 3
n 0
3
X 2 x n j 0 1 j 2 j 3 j 2
~ ~ 2n 2 4 6
n 0
3
X 3 ~
x n j 0 1 j 2 j 3 j 2 2 j
~ 3n 3 6 9
n 0
x n is given by,
The DFS of ~
2 2 n
N 1 j N 1
X k ~
x n e xn e
~ nk j k
N N
n 0 n 0
Comparing with z-transform, X z n0
N 1 ~
x n z n
,we have
X k X z z e j 2N k
~
j
X k x n e x n e jn X 2 k
~ ~ nk
~
N
n 0 n 0 2 N
k
N
2 2
Let 1 ˆ and k ˆ k k1 , then the DFS
N N
X k X e jk X e jk1
which means that the DFS is obtained by evenly sampling the
2𝜋
DTFT with the sampling interval 𝑁 .
IUB Dr. Abdur Razzak 10
Discrete Fourier transform ECR 305_L8
X k , 0 k N 1
~
X k ˆ DFTxn
0, elsewhere
N 1
or X k xn WNnk , 0 k N 1
n 0
1 N 1
x n X k WN nk , 0 n N 1
N k 0
x0, n0
x n N
xN n , 1 n N 1
xp n , 0 n N 1
Then the circular shift is x n
0, otherwise
N 1 2
X 2 k x2 n e
j nk
N
, k 0,1,2,..., N 1
n 0
Then X 3 k X 1 k X 2 k
Solution:
N 1
x3 m x nx m n
n 0
1 2 N
where m 0,1,2,..., N 1
x3 m 14,16,14,16
IUB Dr. Abdur Razzak 19
Example-4 (contd..) ECR 305_L8
N 1
x3 m x nx m n
n 0
1 2 N
where m 0,1,2,..., N 1
x3 m 14,16,14,16
IUB Dr. Abdur Razzak 20
Fast Fourier Transform ECR 305_L8
of the factor W .
nk
N
0 9
X 3
4
W W4
3
W4
6
W
4
x 3
step 1 step 2
Hence an efficient algorithm is
g1 x0 x2 X 0 g1 g 2
g 2 x1 x3 X 1 h1 jh2
h1 x0 x2 X 2 g1 g 2
h2 x1 x3 X 3 h1 jh2
MATLAB
Examples
~
Let ~
x and X denote the column vectors corresponding to the
primary periods of sequences and ~ , respectively.
x n
~ X k
~ 1 *~
x WN X
N
where the matrix WN called a DFS matrix given by
n
1 1 ... 1
k 1 ... WN N 1
WN ˆ WNkn 0 k , n N 1
:
WN1
: ...
N 1 N 12
1 WN ... WN
~
X WN ~
x function [Xk] = dfs(xn,N)
% -------------------------------------------------------------------------
% Compute discrete Fourier series coefficients
% Xk : DFS coefficient array over 0 <= k <= N-1
% xn : one period of periodic signal over 0 <= n <= N-1
% N : fundamental period of xn
WN ˆ WNkn 0k , n N 1
% -------------------------------------------------------------------------
n = 0:N-1; % row vector for n
k = 0:N-1; % row vector for k
WN = exp(-j*2*pi/N); % Wn factor
nk = n'*k; % N by N matrix of nk values
WNnk = WN.^nk; % DFS matrix
2 Xk = xn*WNnk; % row vector for DFS coefficient
j
WN e N
% ------------------------------------------------------------------
% N : fundamental period of xn
WN ˆ WNkn 0k , n N 1
% -------------------------------------------------------------------------
n = 0:N-1; % row vector for n
k = 0:N-1; % row vector for k
WN = exp(-j*2*pi/N); % Wn factor
nk = n'*k; % N by N matrix of nk values
WNnk = WN.^(-nk); % DFS matrix
2
j xn = (1/n).*(Xk*WNnk); % row vector for DFS coefficient
WN e N
% -------------------------------------------------------------------------
1, mN n mN L 1
x n
~
0 mN L n m 1N 1
X WN x
1 *
x WN X
N
where the matrix WN called a DFT matrix given by
n
1 1 ... 1
k 1 ... WN N 1
WN ˆ WNkn 0 k , n N 1
:
WN1
: ...
N 1 N 12
1 WN ... WN
% -------------------------------------------------------------------------
% Compute discrete Fourier transform
% Xk : DFT coefficient array over 0 <= k <= N-1
% xn : N-point finite duration sequence
% N : Length of DFT
WN ˆ WNkn 0k , n N 1
% -------------------------------------------------------------------------
n = 0:N-1; % row vector for n
k = 0:N-1; % row vector for k
WN = exp(-j*2*pi/N); % Wn factor
nk = n'*k; % N by N matrix of nk values
WNnk = WN.^nk; % DFT matrix
2 Xk = xn*WNnk; % row vector for DFT coefficient
j
WN e N
% ------------------------------------------------------------------
% N : Length of DFT
WN ˆ WNkn 0k , n N 1
% -------------------------------------------------------------------------
n = 0:N-1; % row vector for n
k = 0:N-1; % row vector for k
WN = exp(-j*2*pi/N); % Wn factor
nk = n'*k; % N by N matrix of nk values
WNnk = WN.^(-nk); % DTS matrix
2
j xn = (1/N).*(Xk*WNnk); % row vector for DFT coefficient
WN e N
% -------------------------------------------------------------------------
% Definition % Plotting
Subplot(2,1,1); stem(m,magXk);
n1=0; n2=3; n=n1:n2; M = 200; k = 0:M; title('Magnitude','fontsize',15);
w=(4*pi/M)*k; N = 4; m = 0:N-1; xlabel('k','fontsize',15);
x = [1,1,1,1]; xn = [1,1,1,1]; ylabel('X(k)','fontsize',15);
grid; hold on
% DTFT plot(w/pi,magX,'--'); axis([0 4 0 5]);
X = dtft(x,n,k); magX=abs(X);
Subplot(2,1,2); stem(m,PhaXk);
angX=angle(X)*180/pi; title('Angle','fontsize',15);
xlabel('k','fontsize',15);
% DFT ylabel('Degrees','fontsize',15);
Xk = dft(xn,N); magXk = abs(Xk); grid; hold on
PhaXk = angle(Xk)*180/pi; plot(w/pi,angX,'--'); axis([0 4 -200 200]);
% Function x subplot(2,1,1)
n = 0:10; stem(n,real(Y))
x = 10*(0.9).^n; title ('Real{DFT[(x((-n))_1_1]}','fontsize',15);
xlabel('k','fontsize',15);
% Circular fold x
y = circfold(x,11); subplot(2,1,2)
stem(n,imag(Y))
% DFT of y title ('Imaginary{DFT[(x((-n))_1_1]}','fontsize',15);
Y = dft(y,11); xlabel('k','fontsize',15);
Digital Filter
Structure