Sunteți pe pagina 1din 24

NUMERICAL ON DFT

Dr Malaya Kumar Hota (Prof., SENSE, VIT University)


Circular Convolution
Example
Determine the circular convolution of the following two sequences:

x1 (n)  1, 2,3,1

 and 
x2 (n)  4,3, 2, 2


Solution: Using Matrix method

1 1 3 2   4  4  3  6  4  17 
2 1 1 3   3  8  3  2  6  19 
  
3 2 1 1   2 12  6  2  2  22
      
1 3 2 1   2  4  9  4  2  19 

DR. MALAYA KUMAR HOTA (PROF., SENSE) 2


Circular Convolution
By means of DFT and IDFT
By means of DFT and IDFT, determine the sequence x3(n) corresponding to
the circular convolution of the following two sequences


x1 (n)  2,1, 2,1

 and 
x2 (n)  1, 2,3, 4


Solution: Using DFT & IDFT method

 2 1  W40 W40 W40 W40  1 1 1 1


1   2  0 
W4 W41 W42 W43  1  j  1 j 
x41    x42    W4   0 6
 
 2  3 W4 W4 W4  1  1
2 4
1  1
    W4  
1  4 W 0 3 6 9
W4 W4 W4   1 j  1  j 
 4

DR. MALAYA KUMAR HOTA (PROF., SENSE) 3


Circular Convolution
By means of DFT and IDFT
6  10 
0  2  j 2 
X 41  W4 x41    X 42  W4 x42   
 2  2 
   
0  2  j 2 


X1 (k )  6,0, 2,0

 and 
X 2 (k )  10,  2  j 2,  2,  2  j 2

X 3 (k )  X 1 (k ). X 2 (k )


 60, 0,  4, 0


DR. MALAYA KUMAR HOTA (PROF., SENSE) 4
Circular Convolution
By means of DFT and IDFT
 60 
0
X 43   
 4 
 
0

14 
16 
1  1 
x43  W 4 X 43  W 4 X 43   
N 4 14 
 
16 


x3 (n)  14,16,14,16


DR. MALAYA KUMAR HOTA (PROF., SENSE) 5
Linear Convolution Output through
Circular Convolution
By padding the sequences x(n) and h(n) with a sufficient number of zeros
forces the circular convolution to yield the same output as linear convolution.

y(n)  x(n)  h(n)

If the input or excitation x(n) is of length L and the inpulse response h(n) is of
length M, then the oupput y(n) will be of length N=(L+M-1).

Pad x(n) with (M-1) zeros and h(n) with (L-1) zeros.
Perform the circular convolution to yield the same output as linear
convolution.

DR. MALAYA KUMAR HOTA (PROF., SENSE) 6


Use of DFT in Linear Filtering
Circular convolution is of no use if our objective is to determine the
output of a linear filter to a given input sequences.
In this case we use linear convolution.

Input x(n) FIR Filter Output y(n)


y(n)  x(n)  h(n)
Impulse response h(n)

DR. MALAYA KUMAR HOTA (PROF., SENSE) 7


Use of DFT in Linear Filtering
Example: By means of DFT and IDFT, determine the response of the FIR
filter with impulse response h(n)  1,2,3  

 
to the input sequence x(n)  1,2,2,1

Solution: .
Response of the FIR filter, y(n)  x(n)  h(n)
Length of y(n), N = 3+4-1 = 6.
If 
x(n)  1, 2, 2,1,0,0

 and 
h(n)  1, 2,3, 0, 0, 0


then response of the FIR filter, y(n)  x(n)  h(n)

DR. MALAYA KUMAR HOTA (PROF., SENSE) 8


Use of DFT in Linear Filtering
Steps: (i) Compute DFT of x(n) to obtain X(k).
(ii) Compute DFT of h(n) to obtain H(k).
(iii) Y(k)= X(k). H(k)
(iv) Compute IDFT of Y(k) to obtain y(n).

NOTE: The efficient computation of the DFT via the fast Fourier
transform (FFT) algorithm is usually performed for a length N that is a
power of 2. For simplicity we compute eight point DFT i.e., N=8.

This computation yields the result,  


y(n)  1, 4,9,11,8,3, 0, 0

The last two values are zero because we used an eight point DFT &
IDFT, when, in fact, the minimum number of points required is six.
DR. MALAYA KUMAR HOTA (PROF., SENSE) 9
Example
Find the DFT of

x ( n)  a n 0  n  N  1

N 1
X (k )   x(n)e  j 2 kn / N 0  k  N 1
n 0
N 1 N 1 n

  a n e j 2 kn / N    ae  j 2 k / N 
n 0 n 0

1  a N e j 2 kN / N 1 aN
  j 2 k / N
 e j 2 k  cos (2 k )  j sin(2 k )  1
1  ae 1  ae  j 2 k / N

DR. MALAYA KUMAR HOTA (PROF., SENSE) 10


Find the N-point DFT
x ( n)   ( n)
N 1
X (k )   x(n)e  j 2kn / N k  0,1,2,......., ( N  1)
n 0
N 1
   (n)e  j 2kn / N  1.e  j 2k ( 0) / N
n 0

1

 (n) 1
DFT
N

DR. MALAYA KUMAR HOTA (PROF., SENSE) 11


Find the N-point DFT
x(n)   (n  n0 ) , 0  n0  N  1
N 1
X (k )   x(n)e  j 2kn / N k  0,1,2,......., ( N  1)
n 0
N 1
   (n  n0 )e  j 2kn / N  1.e  j 2k ( n0 ) / N
n 0

 e  j 2k ( n0 ) / N  WNkn0

DR. MALAYA KUMAR HOTA (PROF., SENSE) 12


Find the IDFT
X (k )   (k )
N 1
1
x ( n) 
N
 X
k 0
( k )e j 2kn / N
n  0,1,2,......., ( N  1)

1 N 1 1
   (k )e j 2kn / N
 .1.e j 2 ( 0) n / N
N k 0 N
1

N

DR. MALAYA KUMAR HOTA (PROF., SENSE) 13


Note Point
1 DFT
  (k )

N N

1 N (k )
DFT
N
N 1 N 1

 1.
n 0
e  j 2kn / N
  e  j 2kn / N

n 0
 N ( k )

e j 2k0 n / N  N (k  k0 )
DFT
N
N 1 N 1

 e
n 0
j 2k 0 n / N  j 2kn / N
.e   e  j 2 ( k  k 0 ) n / N

n 0
 N ( k  k 0 )

DR. MALAYA KUMAR HOTA (PROF., SENSE) 14


Example
Find the DFT of
x(n)  e j (2 / N ) K0n 0  n  N 1

N 1
X (k )   x(n)e  j 2 kn / N 0  k  N 1
n 0
N 1  j 2 k n
 e  j 2 kn / N
0
N
e
n 0
N 1
  e  j 2 ( k  k0 ) n / N  N . (k  k0 )
n 0

DR. MALAYA KUMAR HOTA (PROF., SENSE) 15


Example
Find the DFT of
 2 
x(n)  cos  K0n  0  n  N 1
 N 
 2 
x(n)  cos  K0n  0  n  N 1
 N 
1  j 2N K0 n  j 2N K0 n 
 e e 
2 

Using linearity and time shifting property,

1
X (k )   N .  (k  k0 )  N  N .  (k  k0 )  N 
2

DR. MALAYA KUMAR HOTA (PROF., SENSE) 16


Example
Find the DFT of
 2 
x(n)  sin  K0 n  0  n  N 1
 N 

 2 
x(n)  sin  K0n  0  n  N 1
 N 
1  j 2N K0n  j 2N K0n 
 e e 
2j  

Using linearity and time shifting property,

1
X (k )   N .  (k  k0 )  N  N .  (k  k0 )  N 
2j

DR. MALAYA KUMAR HOTA (PROF., SENSE) 17


Example
If X(k) is the DFT of the sequence x(n), determine N point
DFTs of xc(n) and xs(n) in terms of X(k).

2k0 n
xc (n)  x(n) cos , 0  n  N 1
N

2k0 n
xs (n)  x(n) sin , 0  n  N 1
N

18
Solution
2k0 n
xc (n)  x(n) cos
N
1  j 2Nk0 n j
2k 0 n

 x ( n ) e e N

2  

X c (k )  X ((k  k0 )) N  X ((k  k0 )) N 
1
2

19
Solution
2k0 n
xs (n)  x(n) sin
N
1  j 2Nk0 n j
2k 0 n

 x ( n ) e e N

2j  

X c (k ) 
1
X ((k  k0 )) N  X ((k  k0 )) N 
2j

20
Example
For the sequence x1(n) and x2(n), determine
N point circular convolution and
circular correlation.

2n 2n
x1 (n)  cos x2 (n)  sin
N N

21
Solution
2n 2n
2n 1  j  j 
x1 (n)  cos  e N
e N

N 2 

X 1 (k )   ((k  1)) N   ((k  1)) N 


N
2
2n 2n
2n 1  jN j 
x2 (n)  sin  e e N

N 2j  

X 2 (k ) 
N
 ((k  1)) N   ((k  1)) N 
2j

22
Solution

X 3 (k )  X 1 (k ). X 2 (k )
N2
  ((k  1)) N   ((k  1)) N 
4j

N 2n
Convolution x3 (n)  sin
2 N

23
Solution

Rx1x2 (k )  X 1 (k ). X 2 (k )
*

N2
  ((k  1)) N   ((k  1)) N 
4j

N 2n
Correlation rx1x2 (n)  sin
2 N

24

S-ar putea să vă placă și