Professional Documents
Culture Documents
809 27 22 Jayan DSP Part1
809 27 22 Jayan DSP Part1
● Mapping from one domain to another domain.
● Information not clearly visible in one domain may
be clearly visible in another domain.
● Example: presence of weak harmonics in a
power line may be feebly visible in the waveform
[time domain representation of amplitude (V)
versus time (t)].
● But it will be clearly visible as vertical lines in the
frequency domain (spectral) representation.
1
ARJ_DSP_2010
Frequency analysis tools
● Fourier series continuous time periodic signals
● Fourier transform – continuous time aperiodic
signals
● Discrete Fourier series – discrete time periodic
signals
● Discrete Fourier transform – discrete time
aperiodic signals
2
ARJ_DSP_2010
Discrete Fourier Series (DFS)
● For a periodic signal with period N
x n = x nN
The discrete Fourier series (DFS) is defined as
N −1
1 j2 nk/ N
x n =
N
∑ X k e
k=0
3
ARJ_DSP_2010
DFS
Where
N−1
− j2 nk/ N
X k = ∑ x n e
n =0
The DFS coefficients are periodic with period N
X k N = X k
4
ARJ_DSP_2010
DFS
● Decomposition of x n
into sum of N complex exponentials.
Orthogonality property of complex exponentials
N−1 k −l
j2 n
N
∑e = N ; k=l
k =0
N−1 k −l
j2 n
N
∑e =0 ; k ≠l
k =0
5
ARJ_DSP_2010
Discrete Fourier Transform (DFT)
N −1
X k = ∑ x n−nk
N
n=0
N =cos 2 nk / N j sin 2 nk / N
Analysis equation : Mapping from time domain to frequency domain
6
ARJ_DSP_2010
Inverse Discrete Fourier Transform
(IDFT)
N −1
x n=1/ N ∑ X k nk
N
n=0
N =e j2 nk / N
N =cos 2 nk / N j sin 2 nk / N
Synthesis equation : Mapping from frequency domain to time domain
7
ARJ_DSP_2010
DFT
Compute 5 point and 50 point DFT of
n
x n = 0.8 u n
n
8
ARJ_DSP_2010
50 point DFT
k
9
ARJ_DSP_2010
Fourier Transform
∞
− j n
X = ∑ x n e
n=−∞
∞
n − j n 1
X = ∑ 0.8 e = − j
n= 0 1−0.8 e
10
ARJ_DSP_2010
Important property
● Unlike a CT sinusoid with frequency ranging
from 0 to infinity, frequency of a complex
exponential in discrete time domain ranges from
0 to2
j2 f t
e ; f ranges from 0 to infinity
jn j 2 n j2 n
e =e because e =1
In discrete time domain, we cannot distinguish
frequencies above 2 11
ARJ_DSP_2010
Xa(F)
Analog frequency F
X(F/Fs)
Analog frequency F
12
ARJ_DSP_2010
Analog frequency and digital
frequency
Analog signal : A sin 2 F t
Frequency : F Hz
Angular frequency :Omega=2 F radian/sec
2F n
Sampled analog signal : Asin
Fs
digital frequency : f =F / F s
digital angular frequency : =2 f =2 F / F s
Fs Fs
As F ranges from − to :ranges from −to
2 2
ARJ_DSP_2010
13
1
2
F
−F s Fs
2 2
14
ARJ_DSP_2010
Relation between DFT and Fourier
Transform
● In Fourier transform, the frequency variable is continuous.
● In DFT, the frequency variable is made discrete.
● Envelope of Fourier transform is same as envelope of DFT.
● DFT is actually sampled version of the FT along the frequency
axis. Samples are taken 2*pi/N apart.
● The number of points in DFT computation determines the
frequency resolution of the DFT.
● If we increase N, more samples are taken along the frequency
axis, and we get more resolution.
15
ARJ_DSP_2010
Example : DFT computation
● Compute DFT of the rectangular pulse train for
N = 5.
0 1 2 3 4
n
16
ARJ_DSP_2010
5 point DFT
4 4
X k = ∑ x n−nk ∑ −nk
5 = 5
n=0 n=0
−nk
5 =cos 2 nk /5− j sin 2 nk /5
X 0=11111=4
X 1=10.30−0.95i−0.80−0.58i−0.800.58i0.300.95i=0
X 2=0
X 3=0 4
X 4=0
0 k 17
ARJ_DSP_2010
10 point DFT
9 9
X k = ∑ x n−nk ∑ −nk
10 = 10
n=0 n=0
−nk
10 =cos 2 nk /10− j sin 2 nk /10
X 0=11111...1=10
X 1=0
X 2=0
X 3=0
10
X 9=0
0 18
ARJ_DSP_2010
DFT
● 5 point DFT is not equal to 10 point DFT
N
∑ −nk
N =N for k =0 ; k= N , k=2 N ,...
n=0
N
∑ −nk
N =0 for n≠kN where k≥0
n=0
19
ARJ_DSP_2010
DFT example 2
x n =sin 2 f nT ; n=0 :31
f =10 Hz ; T =1 /64
20
ARJ_DSP_2010
32 point DFT magnitude and phase
magnitude
phase
21
ARJ_DSP_2010
Interpretation of DFT
● One peak at k = 5
● Sampling frequency = Fs
● N point DFT
● Fs is sampled at N points
● Bins in DFT are separated by Fs/N Hz
● Peak at k = 5 corresponds to 5*Fs/N =
5*64/32 = 10 Hz
● DFT is a mapping from time domain to frequency domain.
● Frequency resolving power of DFT = Fs/N
22
ARJ_DSP_2010
DFT Example
x n =1 ; 0≤n≤2 ; 0 otherwise
Compute DFT for N = 4 and N = 8, , and plot the
magnitude responses
23
ARJ_DSP_2010
DFT for N = 4
24
ARJ_DSP_2010
DFT for N = 8
25
ARJ_DSP_2010
DFT as a Linear transformation
N −1
X k = ∑ x n−nk
N
n=0
N −1
1
x n= ∑ X k Nnk
N k=0
Computation of each point of DF is performed by
N complex multiplications and N1 complex additions.
Total number of computations to evaluate N point DFT
2
N complex multiplications
N N −1complex additions
26
ARJ_DSP_2010
let input sequence x n is viewed as an N point vector x N
x 0 x 0
x 1 x 1
x N= X N=
x 2 ... x 2 ...
x N−1 x N −1
WN 11 1 . . ... . . . . . . . . . . .1
2 N −1
1W N W . . . . . . . . W
N N
2 4 2 N −1
1W N W N . . . . . . . . W N
N −1 2 N −1 N−1 N −1
1W N WN ........W N
27
ARJ_DSP_2010
DFT X N =W N x N
−1
IDFT x N =W N
xN
−11
W = conjugate W N
N
N
28
ARJ_DSP_2010
Example
● Compute DFT of the 4 point sequence
x n = 0,1, 2, 3
29
ARJ_DSP_2010
Relation of DFT to Fourier series
coefficients
X k =N c k
N −1
1 − j2 nk / N
ck =
N
∑ x p n e
n=0
N point DFT provides exact shape of spectrum of
a periodic sequence with fundamental period N
30
ARJ_DSP_2010
Relation of DFT to Fourier transform
N point DFT provides exact shape of spectrum of
a periodic sequence with fundamental period N
31
ARJ_DSP_2010
Relation of DFT to Z transform
N −1
X k = ∑ x n−nk
N
n=0
32
ARJ_DSP_2010
Relation of DFT to Z transform
N −1
X k = ∑ x n−nk
N
n=0
N −1
X z = ∑ x n z−n
n=0
N −1 N −1
1 j2 nk / N
X z = ∑ [ ∑ −n
X k e ]z
n=0 N k=0
N −1 N −1
1
X z =
N
∑ X k [ ∑ e j2 nk / N z−n ]
k=0 n=0
33
ARJ_DSP_2010
Properties of DFT
● Periodicity
X(n+K) = X(k)
● Linearity
if x1(n) has DFT X1(k) and x2(n) has DFT
X2(k),
DFT of ax1(n) + bx2(n) = aX1(k) + bX2(k)
34
ARJ_DSP_2010
Circular convolution
● Let DFT of x1(n) = X1(k) and DFT of x2(n) =
X2(k).
● The product of DFTs X1(k)X2(k) is the DFT of
the sequence obtained from the circular
convolution of x1(n) with x2(n)
35
ARJ_DSP_2010
Example: Circular convolution
● Let x1(n) = [2,1,2,1] and x2(n) = [1 2 3 4]. Perform
4 point circular convolution of x1(n) and x2(n).
● Find the 4 point DFTs X1(k) and X2(k).
● Find the product DFT and prove that it is the DFT
of the circular convolution result from step 1.
36
ARJ_DSP_2010
Circular convolution
● x1(n) = [2,1,2,1] 2
● x2(n) = [1,2,3,4] 1
4 4
3 2 3 2
1 1
37
ARJ_DSP_2010
x1(n) = 2 1 2 1
x2(n) = 1 4 3 2
x3(0) = 2.1 + 1.4 + 2.3 + 1.2 = 14
x3(1) = 2.2 + 1.1 + 2.4 + 1.3 = 16
x3(2) = 2.3 + 1.2 + 2.1 + 1.4 = 14
x3(3) = 2.4 + 1.3 + 2.2 + 1.1 = 16
38
ARJ_DSP_2010
4 point DFT of x1(n)
X1(k) =[6,0,2,0]
4 point DFT of x2(n)
X2(k) =[10, 2+j2, 2, 2j2]
X1(k).X2(k) = [60,04,0]
4 point IDFT of X1(k).X2(k)
[16,14,16,14] = 4 point circular convolution of x1(n)
And x2(n)
39
ARJ_DSP_2010
Linear convolution with DFT
● If x1(n) has N1 points and x2(n) has N2 points,
their linear convolution results in N3 = N1+N21
points.
● To perform linear convolution with DFT, first pad
x1(n) and x2(n) with zeros to have N3 points.
● Perform N3 point DFT of x1(n), and x2(n).
● Compute the product of these N3 point DFTs.
● Find the N3 point IDFT to get the linear convolution
result
40
ARJ_DSP_2010
example
● Linear filtering with DFT and IDFT
● Let input sequence x(n) = [1,2,2,1].
● Impulse response h(n) = [1,2,3].
● The output of the system = x(n)*h(n)
● N3 = 4+31 = 6.
● Zero padded sequence x'(n) = [1,2,2,1,0,0]
● Zero padded sequence h'(n) = [1,2,3,0,0,0]
41
ARJ_DSP_2010
● Linear filtering with DFT and IDFT
● Linear convolution of x(n) with h(n) = [1,4,9,11,8,3].
● 6 point DFT of x'(n) = [6, j3,46, 0, 0, 0, j3.46 ]
● 6 point DFT of h'(n) = [6, 0.5j4.33, 1.5+j0.866, 2, 1.5j0.866j,
0.5+j4.33]
● Product of DFT's = [36, 15j1.732,0,0,0,15+j1.732]
● 6 point IDFT of [36, 15j1.732,0,0,0,15+j1.732] =
[1,4,9,11,8,3], the linear convolution of x(n) and h(n)
x(n) Zero pad to
Have N3 point DFT
N3 points
N3 point IDFT
h(n) Zero pad to
Have N3 point DFT
N3 points
42
ARJ_DSP_2010
example
● Linear filtering with DFT and IDFT
● Let input sequence x(n) = [1,2,2,1].
● Impulse response h(n) = [1,2,3].
● The output of the system = x(n)*h(n)
● N3 = 4+31 = 6.
● Zero padded sequence x'(n) = [1,2,2,1,0,0]
● Zero padded sequence h'(n) = [1,2,3,0,0,0]
43
ARJ_DSP_2010
example
● Linear filtering with DFT and IDFT
● Let input sequence x(n) = [1,2,2,1].
● Impulse response h(n) = [1,2,3].
● The output of the system = x(n)*h(n)
● N3 = 4+31 = 6.
● Zero padded sequence x'(n) = [1,2,2,1,0,0]
● Zero padded sequence h'(n) = [1,2,3,0,0,0]
44
ARJ_DSP_2010
FFT: Fast Fourier Transform
● N point DFT direct evaluation :
Each point in DFT : N complex multiplications,
N complex additions
● Total computations for k = 0 to N1 is N2 complex
multiplications
2
● N complex additions
● Computational complexity is proportional to N2
45
ARJ_DSP_2010
FFT
● Divide and conquer approach
● Split N point into two N/2, N/2 point sequences ,and
so on until we reach 2 point DFT.
● This process of splitting the sequence into sub
sequences is called decimation
● Decimation can be performed in time (along n) or in
frequency (along k)
● Computational complexity is proportional to
N log2N
46
ARJ_DSP_2010
2
N log2N < < N
47
ARJ_DSP_2010
Decimation in time (DIT) FFT
algorithm
N −1
X k = ∑ x n−nk
N
n=0
N =e j2 nk / N
Splitting input sequence X(k) into two parts
(even and odd half) based on the time index n
N −1 N −1
X k = ∑ x n nk
N ∑ x nnk
N
n=odd n n= even n
48
ARJ_DSP_2010
DIT (Decimation in time)
N /2−1 N /2−1
X k = ∑ x 2 r 1N2r1 k ∑ x 2 r 2rk
N
r=0 r =0
N /2−1 N /2−1
2rk rk
N = N /2
49
ARJ_DSP_2010
N point DFT is periodic
with period N
N−1
X k = ∑ x n
−nk
N
n =0
N −1
−n k N
X k N = ∑ x n N
n=0
N −1
X k N = ∑ x n
−nk
N =X k
n=0
−Nk − j2 Nk / N − j2 k
N =e =e =cos 2 k =1
50
ARJ_DSP_2010
8 point DIT Algorithm: STEP 1
X(0)
x(0)
x(2) X(1)
4 point
X(2)
x(4) DFT
x(6) X3)
X(4)
x(1)
x(3) 80
4 point X(5)
x(0) X(0)
2 point
x(4)
X(1)
x(2) 0 X(2)
2 point 4
x(6) 1 X3)
4
x(1) X(4)
2 point
x(5) X(5)
x(3) X(6)
0
x(7) 2 point 4
X(7)
1
4
52
ARJ_DSP_2010
8 point DIT Algorithm: STEP 3
This process is repeated for each 2 point DFT block
02
53
ARJ_DSP_2010
8 point DIF Algorithm: Flow graph
x(0) X(0)
x(4) X(4)
02
x(2) 0 X(2)
4
x(6) X(6)
0 1
2 4
X(1)
x(1)
80
x(5) 0 0
X(5)
1
2 4 8
x(3) X(3)
54
ARJ_DSP_2010