UNIT - 1: Discrete Fourier Transforms
(DFT)[1, 2, 3, 4, 5]
Dr. Manjunatha. P
manjup.jnnce@gmail.com
Professor
Dept. of ECE
J.N.N. College of Engineering, Shimoga
September 11, 2014
DSP Syllabus Introduction
Digital Signal Processing: Introduction [1, 2, 3, 4]
Slides are prepared to use in class room purpose, may be used as a
reference material
All the slides are prepared based on the reference material
Most of the figures/content used in this material are redrawn, some
of the figures/pictures are downloaded from the Internet.
I will greatly acknowledge for copying the some the images from the
Internet.
This material is not for commercial purpose.
This material is prepared based on Digital Signal Processing for
ECE/TCE course as per Visvesvaraya Technological University (VTU)
syllabus (Karnataka State, India).
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 2 / 91
DSP Syllabus
DSP Syllabus
PART - A
UNIT - 1: Discrete Fourier Transforms (DFT)
Frequency domain sampling and reconstruction of discrete time signals.
DFT as a linear transformation, its relationship with other transforms. 7 Hours
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 3 / 91
Introduction The concept of frequency in continuous and discrete time signals
The concept of frequency in continuous and discrete time signals
Continuous Time Sinusoidal Signals
The concept of frequency is closely related to specific type of motion called harmonic
oscillation which is directly related to the concept of time.
A simple harmonic oscillation is mathematically described by:
xa(t) = Acos(Ωt + θ), − ∞ < t < ∞
The subscript a is used with x(t) to denote an analog signal. A is the amplitude, Ω is the
frequency in radians per second(rad/s), and θ is the phase in radians. The Ω is related by
frequency F in cycles per second or hertz by
Ω = 2πF
xa(t) = Acos(2πFt + θ), − ∞ < t < ∞
Figure 1: Example of an analog sinusoidal signal
Cycle and Period
The completion of one full pattern waveform is called a cycle. A period is defined as the
amount of time required to complete one full cycle.
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 4 / 91
Introduction The concept of frequency in continuous and discrete time signals
Complex exponential signals
xa(t) = Aej(Ωt+θ)
where
e±jφ
= cosφ ± jsinφ
xa(t) = Acos(Ωt + θ) =
A
2
ej(Ωt+θ)
+
A
2
e−j(Ωt+θ)
As time progress the phasors rotate in opposite directions with angular ±Ω frequencies
radians per second.
A positive frequency corresponds to counterclockwise uniform angular motion, a negative
frequency corresponds to clockwise angular motion.
Figure 2: Representation of cosine function by phasor
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 5 / 91
Introduction Discrete Time Sinusoidal Signals
Discrete Time Sinusoidal Signals
A discrete time sinusoidal may expressed as
x(n) = Acos(ωn + θ), − ∞ < t < ∞
where n is an integer variable called the sample number.
A is the amplitude, ω is the frequency in radians per sample(rad/s), and θ is the phase in
radians.
The ω is related by frequency f cycles per sample by
ω = 2πf
x(n) = Acos(2πfn + θ), − ∞ < t < ∞
A discrete time signal x(n) is periodic with period N(N > 0) if and only if
x(n + N) = x(n) for all n
Figure 3: Discrete signal
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 6 / 91
Introduction Discrete Time Sinusoidal Signals
Periodic and aperiodic (non-periodic) signals.
A periodic signal consists a continuously repeated pattern. Signal is periodic if it exhibits
periodicity i.e.
x(t + T) = x(t) for all t
It has a property that it is unchanged by a time shift of T.
An aperiodic signal changes constantly without exhibiting a pattern or cycle that repeats
over the time.
Figure 4: Periodic signals
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 7 / 91
Introduction Discrete Time Sinusoidal Signals
Periodic and aperiodic (non-periodic) signals.
Figure 5: Periodic signal Figure 6: Periodic discrete time signal
Figure 7: Periodic discrete time signal
Figure 8: Periodic discrete time
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 8 / 91
Introduction Discrete Time Sinusoidal Signals
Periodic and aperiodic (non-periodic) signals.
Figure 9: Aperiodic signals
Figure 10: Aperiodic discrete time
signals
Figure 11: Aperiodic discrete time signals
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 9 / 91
Introduction Discrete Time Sinusoidal Signals
Periodic and aperiodic (non-periodic) signals.
Figure 12: Aperiodic (random) signal
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 10 / 91
Fourier series
Fourier series
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 11 / 91
Fourier series Fourier series
Sinusoidal functions are wide applications in Engineering and they are easy to generate.
Fourier has shown that periodic signals can be represented by series of sinusoids with
different frequency.
A signal f (t) is said to be periodic of period T if f (t) = f (t + T) for all t.
Periodic signals can be represented by the Fourier series and non periodic signals can be
represented by the Fourier transform.
For example square wave pattern can be approximated with a suitable sum of a
fundamental sine wave plus a combination of harmonics of this fundamental frequency.
Several waveforms that are represented by sinusoids are as shown in Figure 14. This sum
is called a Fourier series.
The major difference with respect to the line spectra of periodic signals is that the spectra
of aperiodic signals are defined for all real values of the frequency variable ω.
Figure 13: Square Wave from
Fourier Series Figure 14: Waveforms from Fourier Series
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 12 / 91
Fourier series Fourier series
Fourier analysis: Every composite periodic signal can be represented with a series of sine
and cosine functions with different frequencies, phases, and amplitudes.
The functions are integral harmonics of the fundamental frequency f of the composite
signal.
Using the series we can decompose any periodic signal into its harmonics.
f (θ) = a0 +
∞
X
n=1
ancos(nθ) +
∞
X
n=1
bnsin(nθ)
where
a0 =
1
2π
2π
Z
0
f (θ)dθ
an =
1
π
2π
Z
0
f (θ)cos(nθ)dθ
bn =
1
π
2π
Z
0
f (θ)sin(nθ)dθ
Line spectra, harmonics
The fundamental frequency f0 = 1/T. The Fourier series coefficients plotted as a function
of n or nf0 is called a Fourier spectrum.
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 13 / 91
Fourier series Fourier series
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 14 / 91
Fourier series Fourier series
Figure 15: Square Wave
f (θ) =

A when 0  θ  π
−A when π  θ  2π
f (θ + 2π) = f (θ)
a0 =
1
2π
Z 2π
0
f (θ)dθ
=
1
2π
Z π
0
f (θ)dθ +
Z 2π
π
f (θ)dθ

=
1
2π
Z π
0
Adθ +
Z 2π
π
(−A)dθ

= 0
an =
1
π
Z 2π
0
f (θ) cos nθdθ
=
1
π
Z π
0
A cos nθdθ +
Z 2π
π
(−A) cos nθdθ

=
1
π

−A
sin nθ
n
π
0
+
1
π

A
sin nθ
n
2π
π
= 0
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 15 / 91
Fourier series Fourier series
bn =
1
π
Z 2π
0
f (θ) sin nθdθ
=
1
π
Z π
0
A sin nθdθ +
Z 2π
π
(−A) sin nθdθ

=
1
π

−A
cos nθ
n
π
0
+
1
π

A
cos nθ
n
2π
π
=
A
nπ
[− cos nπ + cos 0 + cos 2nπ − cos nπ]
=
A
nπ
[1 + 1 + 1 + 1]
=
4A
nπ
when n is odd
bn =
A
nπ
[− cos nπ + cos 0 + cos 2nπ − cos nπ]
=
A
nπ
[−1 + 1 + 1 − 1]
= 0 when n is even
4A
π

sin θ +
1
3
sin 3θ +
1
5
sin 5θ +
1
7
sin 7θ + · · ·

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 16 / 91
Fourier series Fourier series
4A
π

sin θ +
1
3
sin 3θ +
1
5
sin 5θ +
1
7
sin 7θ + · · ·

Figure 16: Square Wave from Fourier
Series Figure 17: Square Wave from Fourier
Series
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 17 / 91
Fourier series Fourier series
clc;clear all; close all;
f=100;%Fundamental frequency 100 Hz
t=0:.00001:.05;
xsin = sin(2*pi*f*t);
x1 = sin(2*pi*f*t);
x3 = (1/3)*sin(3*2*pi*f*t);
x5 = (1/5)*sin(5*2*pi*f*t);
x7 = (1/7)*sin(7*2*pi*f*t);
x=x1+x3+x5+x7;
subplot(2,1,1)
plot(t,xsin,’linewidth’,2);
xlabel(’theta’,’fontsize’,16)
ylabel(’sin(theta)’,’fontsize’,16)
title(’Fundamental sinusoidal signal’)
subplot(2,1,2)
plot(t,x,’linewidth’,2);
xlabel(’theta’,’fontsize’,16)
ylabel(’f (theta)’,’fontsize’,16)
title(’Reconstructed square wave by Fourier ’)
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05
−1
−0.5
0
0.5
1
θ
sin(θ)
Fundamental sinusoidal signal
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05
−1
−0.5
0
0.5
1
θ
f
(θ)
Reconstructed square wave by Fourier
Figure 18: Square Wave
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 18 / 91
Fourier series Fourier series
Figure 19: Triangular Wave
bn =
2
T
Z T
0
f (t) sin 2πn
T
t

dt
=
4
T
Z T/2
0
f (t) sin 2πn
T
t

dt
=
4
T
Z T/4
0
t sin 2πn
T
t

dt +
4
T
Z T/4
0

−t +
T
2

sin 2πn
T
t

dt
=
4
T

2

T
2πn
2
sin πn
2

#
=
2T
2π2n2
sin πn
2

= 0 when n is even
2T
π2

sin

2π
T
t

−
1
32
sin

6π
T
t

+
1
52
sin

10π
T
t

− · · ·

f (t) =

t when − T
4
≤ t ≤ T
4
−t + T
2
when T
4
≤ t ≤ 3T
4
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 19 / 91
Fourier series Fourier series
Figure 20: Square Wave[6] Figure 21: Sawtooth Signal[6]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 20 / 91
Fourier series Fourier series
The Exponential (Complex) Form of Fourier Series
f (θ) = a0 +
∞
X
n=1
an cos nθ +
∞
X
n=1
bn sin nθ
cosθ =
ejθ + e−jθ
2
sinθ =
ejθ − e−jθ
2j
an cos nθ + bn sin nθ =
= an
ejnθ + e−jnθ
2
+ bn
ejnθ − e−jnθ
2j
= an
ejnθ + e−jnθ
2
− jbn
ejnθ − e−jnθ
2
=

an − jbn
2

ejnθ
+

an + jbn
2

e−jnθ
let cn =

an − jbn
2

c−n =

an + jbn
2

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 21 / 91
Fourier series Fourier series
an cos nθ + bn sin nθ = cnejnθ
+ c−n e−jnθ
f (θ) = c0 +
∞
X
n=1

cnejnθ
+ c−ne−jnθ

=
∞
X
n=−∞
cnejnθ
where
cn =

an − jbn
2

The coefficient cn can be evaluated as.
cn =
1
2π
Z π
−π
f (θ) cos nθdθ −
j
2π
Z π
−π
f (θ) sin nθdθ
=
1
2π
Z π
−π
f (θ) (cos nθ − j sin nθ)dθ
=
1
2π
Z π
−π
f (θ)e−jnθ
dθ
In exponential Fourier series only one
integral has to be calculated and it is
simpler integration.
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 22 / 91
Fourier series Fourier series
Figure 22: Square Wave[6] Figure 23: Sawtooth Signal[6]
 N=256; % number of samples
 T=1/128; % sampling frequency=128Hz
 k=0:N-1; time=k*T;
 f=0.25+2*sin(2*pi*5*k*T)+1*sin(2*pi*12.5*k*T)+…
+1.5*sin(2*pi*20*k*T)+0.5*sin(2*pi*35*k*T);
 plot(time,f); title('Signal sampled at 128Hz');
 F=fft(f);
 magF=abs([F(1)/N,F(2:N/2)/(N/2)]);
 hertz=k(1:N/2)*(1/(N*T));
 stem(hertz,magF), title('Frequency components');
Example
Find the spectrum of the following signal:
f=0.25+2sin(2π5k)+sin(2π12.5k)+1.5sin(2π20k)+0.5sin(2π35k)
Figure 24: Square Wave[6]
Find the
1000 Hz
with ran
e frequency
z. Form a s
dom noise.
y componen
ignal consis
nts of a sig
sting of 50
gnal buried
Hz and 120
d in noise.
0 Hz sinuso
Consider d
oids and co
data sample
orrupt the s
ed at
signal
Figure 25: Sawtooth Signal[6]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 23 / 91
Fourier series Fourier series
-5
-4
-3
-2
-1
0
1
2
3
4
5
0 200 4
400 600
0 800 1000 1200 14
400
Figure 26: Square Wave[6]
Figure 27: Sawtooth Signal[6]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 24 / 91
Fourier Transform
Fourier Transform
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 25 / 91
Fourier Transform Fourier Transform
The Fourier transform is a generalization of the Fourier series representation of functions.
The Fourier series is limited to periodic functions, while the Fourier transform can be used
for a larger class of functions which are not necessarily periodic. S
Sinusoidal functions are wide applications in Engineering and they are easy to generate.
Fourier has shown that periodic signals can be represented by series of sinusoids with
different frequency.
A signal f (t) is said to be periodic of period T if f (t) = f (t + T) for all t.
Periodic signals can be represented by the Fourier series and non periodic signals can be
represented by the Fourier transform.
For example square wave pattern can be approximated with a suitable sum of a
fundamental sine wave plus a combination of harmonics of this fundamental frequency.
Several waveforms that are represented by sinusoids are as shown in Figure 14. This sum
is called a Fourier series.
The major difference with respect to the line spectra of periodic signals is that the spectra
of aperiodic signals are defined for all real values of the frequency variable ω.
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 26 / 91
Fourier Transform Fourier Transform
f (θ) =
∞
X
n=−∞
cnejnθ
where
cn =
1
2π
Z π
−π
f (θ)e−jnθ
dθ
θ = ωt
ω is the angular velocity in radians per
second.
ω = 2πf and θ = 2πft
θ =
2π
T
t and dθ =
2π
T
dt
when θ = −π
−π =
2πt
T
⇒ t = −
T
2
when θ = π
π =
2πt
T
⇒ t =
T
2
f (t) =
∞
X
n=−∞
cnejnωt
cn =
1
T
Z T/2
−T/2
f (t)e−jnωt
dt
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 27 / 91
Fourier Transform Fourier Transform
Relationship from Fourier series to Fourier Transform
f (t) =
∞
X
n=−∞
cnejnωt
cn =
1
T
Z T/2
−T/2
f (t)e−jnωt
dt
As T approaches infinity
ω approaches zero
and n becomes meaningless
nω ⇒ ω ω ⇒ ∆ω
T ⇒ 2π
∆ω
f (t) =
ω
X
n=−ω
cωejωt
cω =
∆ω
2π
Z T/2
−T/2
f (t)e−jωt
dt
f (t) =
1
2π


∞
X
ω=−∞
Z T/2
−T/2
f (t)e−jωt
dt

 ejωt
∆ω
T ⇒ ∞ ∆ω ⇒ dω and
P
⇒
R
f (t) =
1
2
Z ∞
−∞
Z ∞
−∞
f (t)e(−jωt)
dt

e(jωt)
dω
f (t) =
1
2
Z ∞
−∞
F(ω)e(jωt)
dω
F(ω) =
Z ∞
−∞
f (t)e(−jωt)
dt
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 28 / 91
Fourier Transform Fourier Transform
Figure 28: Rectangular Pulse
Figure 29: Sinc Function
F(ω) =
1/2
Z
−1/2
exp(−jωt)dt =
1
−jω
[exp(−jωt)]
1/2
−1/2
=
1
−jω
[exp(−jω/2) − exp(jω/2)]
=
1
(ω/2)
exp(jω/2) − exp(−jω/2)
2j
=
sin(ω/2)
(ω/2)
= sinc(ω/2) since it is
sinx
x
form
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 29 / 91
Fourier Transform Fourier Transform
Figure 30: Exponential
Figure 31: Gaussian
F(ω) =
∞
Z
0
exp( − at) exp(−jωt)dt
=
∞
Z
0
exp(−at − jωt)dt =
∞
Z
0
exp(−[a + jω]t)dt
=
−1
a + jω
exp(−[a + jω]t)|+∞
0 =
−1
a + jω
[exp(−∞) − exp(0)]
=
−1
a + jω
[0 − 1]
=
1
a + jω
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 30 / 91
Fourier Transform Fourier Transform
∞
Z
−∞
δ(t) exp(−iω t) dt = exp(−iω [0]) = 1
∞
Z
−∞
1 exp(−iω t) dt = 2π δ(ω)
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 31 / 91
Fourier Transform Fourier Transform
F {exp(iω0 t)} =
∞
Z
−∞
exp(iω0 t) exp(−i ω t) dt
=
∞
Z
−∞
exp(−i [ω − ω0] t) dt
= 2π δ(ω − ω0)
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 32 / 91
Fourier Transform Fourier Transform
F {cos(ω0t)} =
∞
Z
−∞
cos(ω0t) exp(−j ω t) dt
=
1
2
∞
Z
−∞
[exp(j ω0 t) + exp(−j ω0 t)] exp(−j ω t) dt
=
1
2
∞
Z
−∞
exp(−j [ω − ω0] t) dt +
1
2
∞
Z
−∞
exp(−j [ω + ω0] t) dt
= π δ(ω − ω0) + π δ(ω + ω0)
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 33 / 91
Fourier Transform Fourier Transform
Figure 32: A signal with four different frequencies
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 34 / 91
Fourier Transform Fourier Transform
Figure 33: A signal with four different frequency components at four different time intervals
Figure 34: Each peak corresponds to a frequency of a periodic component
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 35 / 91
Discrete Fourier Transform (DFT)
Discrete Fourier Transform (DFT)
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 36 / 91
Discrete Fourier Transform (DFT)
Many applications demand the processing of signals in frequency domain.
The analysis of signal frequency, periodicity, energy and power spectrums can be analyzed
in frequency domain.
Frequency analysis of discrete time signals is usually and most conveniently performed on
a digital signal processor.
Applications of DFT:
Spectral analysis
Convolution of signals
Partial differential equations
Multiplication of large integers
Data compression
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 37 / 91
Discrete Fourier Transform (DFT) Summary of FS and FT
Fourier Series is
x(θ) = a0 +
∞
X
n=1
ancos(nθ) +
∞
X
n=1
bnsin(nθ)
where a0 = 1
2π
2π
R
0
x(θ)dθ
an =
1
π
2π
Z
0
x(θ)cos(nθ)dθ bn =
1
π
2π
Z
0
x(θ)sin(nθ)dθ
The Exponential (Complex) Form
x (θ) =
∞
X
n=−∞
cnejnθ
where cn =
1
2π
Z π
−π
x(θ)e−jnθ
dθ
x(t) =
∞
X
n=−∞
cnejnωt
where cn =
1
T
Z T/2
−T/2
x(t)e−jnωt
dt
Fourier Transform pair is
X(ω) =
Z ∞
−∞
f (t)e(−ωt)
dt and x(t) =
1
2
Z ∞
−∞
X(ω)e(jωt)
dω
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 38 / 91
Discrete Fourier Transform (DFT) Summary of FS and FT
Time Domain Frequency Domain Transform
Continuous Periodic Discrete nonperiodic Fourier series
Continuous nonperiodic Continuous nonperiodic Fourier Transform
Discrete nonperiodic Continuous nonperiodic Sequences Fourier Transform
Discrete periodic Discrete periodic Discrete Fourier Transform
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 39 / 91
Discrete Fourier Transform (DFT) Summary of FS and FT
The Fourier Series for Continuous time Periodic Signals
Synthesis Equation x(t) =
∞
P
k=−∞
ck ej2πnft
Analysis Equation cn = 1
T
∞
R
−∞
x(t)e−j2πnft dt
The Fourier Transform for Continuous Time Aperiodic Signals
Synthesis Equation (Inverse transform) x(t) =
∞
R
−∞
X(F)ej2πFt dF
Analysis Equation (Direct transform) X(F) =
∞
R
−∞
x(t)e−j2πFt dt
The Fourier Series for Discrete time Periodic Signals
Synthesis Equation x(n) =
N−1
P
k=0
ck ej2πkn/N
Analysis Equation ck = 1
N
N−1
P
n=0
x(n)e−j2πkn/N
The Fourier Transform of Discrete Time Aperiodic Signals
Synthesis Equation (Inverse transform) x(n) = 1
2π
∞
R
−∞
X(F)ej2πF1t dF
Analysis Equation (Direct transform) X(ω) =
∞
P
n=−∞
x(n)e−j2πkn/N
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 40 / 91
Discrete Fourier Transform (DFT) Summary of FS and FT
DFT transforms the time domain signal samples to the frequency domain components.
Time
Amplitude
Signal
Frequency
Amplitude
Signal
Spectrum
Figure 35: Discrete Fourier Transform
Signal Types of Transforms Example Waveform
Continuous and periodic Fourier Series sine wave
Continuous and aperiodic Fourier Series
Discrete and periodic Fourier Series
Discrete and aperiodic Fourier Series
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 41 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Need For Frequency Domain Sampling
In practical application, signal processed by computer has two main characteristics: It
should be Discrete and Finite length
But nonperiodic sequences Fourier Transform is a continuous function of ω, and it is a
periodic function in ω with a period 2π.
So it is not suitable to solve practical digital signal processing.
Frequency analysis on a discrete-time signal x(n) is achieved by converting time domain
sequence to an equivalent frequency domain representation, which is represented by the
Fourier transform X(ω) of the sequence x(n).
Consider an aperiodic discrete time signal x(n) and its Fourier transform is
X(ω) =
∞
X
n=−∞
x(n)e−jωn
The Fourier transform X(ω) is a continuous function of frequency and it is not a
computationally convenient representation of the sequence.
To overcome the processing, the spectrum of the signal X(ω) is sampled periodically in
frequency at a spacing of δω radians between successive samples.
The signal X(ω) is periodic with period 2π and take N equidistant samples in the interval
0 ≤ ω ≤ 2π with spacing δ = 2π/N .
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 42 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Figure 36: Frequency domain
sampling
Figure 37: Frequency domain
sampling
To Determine The Value Of N
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 43 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Now consider ω = 2πk/N
X

2π
N
k

=
∞
X
n=−∞
x(n)e−j2πkn/N
k = 0, 1, 2, . . . N − 1
X

2π
N
k

= · · · +
−1
X
n=−N
x(n)e−j2πkn/N
+
N−1
X
n=0
x(n)e−j2πkn/N
+
2N−1
X
n=N
x(n)e−j2πkn/N
+ · · ·
=
∞
X
n=−∞
lN+N−1
X
n=lN
x(n)e−j2πkn/N
By changing the index in the inner summation from n to n − lN and interchanging the
order of summation
X

2π
N
k

=
N−1
X
n=0


∞
X
n=−∞
x(n − lN)

 e−j 2π
N
k(n−lN)
=
N−1
X
n=0


∞
X
n=−∞
x(n − lN)

 e−j 2π
N
kn
e−j2πkl
e−j2πkl = 1 ∵ both k and l integers
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 44 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
X

2π
N
k

=
N−1
X
n=0


∞
X
n=−∞
x(n − lN)

 e−j2πkn/N
k = 0, 1, 2, . . . N − 1
Let xp(n) =
∞
X
n=−∞
x(n − lN)
The term xp(n) is obtained by the periodic repetition of x(n) every N samples hence it is
a periodic signal. This can be expanded by Fourier series as
xp(n) =
N−1
X
k=0
ck ej2πkn/N
n = 0, 1, · · · N − 1
where ck is the fourier coefficients expressed as
ck =
1
N
N−1
X
n=0
xp(n)e−j2πkn/N
k = 0, 1, · · · N − 1
Upon comparing
ck =
1
N
X

2π
N
k

k = 0, 1, · · · N − 1
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 45 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
xp(n) =
1
N
N−1
X
k=0
X

2π
N
k

ej2πkn/N
n = 0, 1, · · · N − 1
xp(n) is the reconstruction of the periodic signal from the spectrum X(ω) (IDFT).
The equally spaced frequency samples X 2π
N

k = 0, 1, · · · N − 1 do not uniquely
represent the original sequence when x(n) has infinite duration. When x(n) has a finite
duration then xp(n) is a periodic repetition of x(n) and xp(n) over a single period is
xp(n) =

x(n) 0 ≤ n ≤ L − 1
0 L ≤ n ≤ N − 1
For the finite duration sequence of length L the Fourier transform is:
X(ω) =
L−1
X
n=0
x(n)e−jωn
0 ≤ ω ≤ 2π
When X(ω) is sampled at frequencies ωk = 2πk/N k = 0, 1, 2, . . . N − 1 then
X(k) = X

2πk
N

=
L−1
X
n=0
x(n)e−j2πkn/N
=
N−1
X
n=0
x(n)e−j2πkn/N
The upper index in the sum has been increased from L − 1 to N − 1 since x(n)=0 for n ≥ L
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 46 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
DFT and IDFT expressions are
DFT expressions is
X(k) =
N−1
X
n=0
x(n)e−j2πkn/N
k = 0, 1, . . . N − 1
IDFT expressions is
xp(n) =
1
N
N−1
X
k=0
X

2π
N
k

ej2πkn/N
n = 0, 1, · · · N − 1
If xp(n) is evaluated for n = 0, 1, 2 . . . N − 1 then xp(n) = x(n)
x(n) =
1
N
N−1
X
k=0
X (k) ej2πkn/N
n = 0, 1, · · · N − 1
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 47 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
DFT as a Linear Transformation
X(k) =
N−1
X
n=0
x(n)e−j 2π
N
kn
k = 0, 1, . . . N − 1
Let
WN = e−j 2π
N is called twiddle factor
X(k) =
N−1
X
x=0
x(n)W nk
N for k = 0, 1.., N − 1







X(0)
X(1)
X(2)
.
.
.
X(3)







=










1 1 1 1 . . . 1
1 W W 2 W 3 . . . W N−1
1 W 2 W 2 W 4 . . . W 2(N−1)
1 W 3 W 6 W 9 . . . W 3(N−1)
.
.
.
1 W N−1 W N−2 W N−3 . . . W (N−1)(N−1)










.







x(0)
x(1)
x(2)
.
.
.
x(N − 1)







Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 48 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Periodicity property of WN
WN = e−j 2π
N
Let us consider for N=8
W8 = e−j 2π
8 1 = e−j π
4
kn W kn
8 = e− π
4
kn
Result
0 W 0
8 = e0 Magnitude 1 Phase 0
1 W 1
8 = e−j π
4
1
= e−j π
4 Magnitude 1 Phase −π/4
2 W 2
8 = e−j π
4
2
= e−j π
2 Magnitude 1 Phase −π/2
3 W 3
8 = e−j π
4
3
= e−j3 π
4 Magnitude 1 Phase −3π
4
4 W 4
8 = e−j π
4
4
= e−jπ Magnitude 1 Phase −π
5 W 5
8 = e−j π
4
5
= e−j3 π
5 Magnitude 1 Phase −5π/4
6 W 6
8 = e−j π
4
6
= e−j3 π
2 Magnitude 1 Phase −3π/2
7 W 7
8 = e−j π
4
7
= e−j7 π
4 Magnitude 1 Phase −7π/4
8 W 8
8 = e−j π
4
8
= e−j2π Magnitude 1 Phase −2π W 8
8 = W 0
8
9 W 9
8 = e−j π
4
9
= e−j(2π+ π
4
)
Magnitude 1 Phase (−2π + π/4) W 9
8 = W 1
8
10 W 10
8 = e−j π
4
10
= e−j(2π π
2
)
Magnitude 1 Phase (−2π+π/2) W 10
8 = W 2
8
11 W 11
8 = e−j π
4
11
= e−j2π+ 3π
4 W 11
8 = W 3
8
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 49 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Real part
of WN
0 8
8 8 .. 1
W W
= = =
Imaginary
part of WN
4 12
8 8 ..
1
W W
= =
= −
2 10
8 8 ..
W W j
= = = −
1 9
8 8 ..
1 1
2 2
W W
j
= =
= −
3 11
8 8 ..
1 1
2 2
W W
j
= =
= − −
5 13
8 8 ..
1 1
2 2
W W
j
= =
= − +
6 14
8 8 ..
W W j
= = =
7 15
8 8 ..
1 1
2 2
W W
j
= =
= +
Figure 38: Periodicity of WN and its values
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 50 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Real part
of WN
0 4
4 4
8
4
1
W W
W
= =
=
2 6
4 4
10
4
1
W W
W
= − =
=
3 7 11
4 4 4
W j W W
= = =
1 5 9
4 4 4
W j W W
= − = =
Imaginary
part of WN
Figure 39: Periodicity of WN and its values
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 51 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find Discrete Fourier Transform (DFT) of x(n) = [2 3 4 4]
Solution:
X(k) =
N−1
X
n=0
x(n)e−j 2π
N
nk
for k = 0, 1.., N − 1
e−j π
2 = cos
π
2
− jsin
π
2
= −j e−jπ
= cos(π) − jsin(π) = −1
e−j 3π
2 = cos
3π
2
− jsin
3π
2
= j e−j2π
= cos(2π) − jsin2(π) = 1
for k=0,1,2,3
X(0) =
3
P
n=0
x(n)e0 =

2e0 + 3e0 + 4e0 + 4e0

= [2 + 3 + 4 + 4] = 13
X(1) =
3
P
n=0
x(n)e−j 2πn
4 =

2e0 + 3e−jπ/2 + 4e−jπ + 4e−j3π/2

= [2 − 3j − 4 + 4j] = [−2 + j]
X(2) =
3
P
n=0
x(n)e
−j4πn
4 =

2e0 + 3e−jπ + 4e−j2π + 4e−j3π

= [2 − 3 + 4 − 4] = [−1 − 0j] = −1
X(3) =
3
P
n=0
x(n)e
−j6πn
4 =

2e0 + 3e−j3π/2 + 4e−j3π + 4e−j9π/2

= [2 + 3j − 4 − 4j][−2 − j]
The DFT of the sequence x(n) = [2 3 4 4] is [13, -2+j, -1, -2-j]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 52 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find Discrete Fourier Transform (DFT) of x(n) = [2 3 4 4]
X(k) =
N−1
X
n=0
x(n)e−j 2π
N
nk
for k = 0, 1.., N − 1
Matlab code for the DFT equation is:
clc; clear all; close all
xn=[2 3 4 4]
N=length(xn);
n=0:N-1;
k=0:N-1;
WN=exp(-1j*2*pi/N);
nk=n’*k;
WNnk=WN.^nk;
Xk=xn*WNnk
Matlab code using FFT command
clc; clear all; close all
xn=[2 3 4 4]
y=fft(xn)
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 53 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find DFT for a given a sequence x(n) for 0 ≤ n ≤ 3 where
x(0) = 1, x(1) = 2, x(2) = 3, x(3) = 4
Solution:
x(n) = [1 2 3 4]
for k=0,1,2,3
X(0) =
3
P
n=0
x(n)e0 =

4e0 + 2e0 + 3e0 + 4e0

= [1 + 2 + 3 + 4] = 10
X(1) =
3
P
n=0
x(n)e−j 2πn
4 =

1e0 + 2e−jπ/2 + 2e−jπ + 4e−j3π/2

= [1 − j2 − 3 + j4] = [−2 + j2]
X(2) =
3
P
n=0
x(n)e
−j4πn
4 =

1e0 + 2e−jπ + 3e−j2π + 4e−j3π

= [1 − 2 + 3 − 4] = [−1 − 0j] = −2
X(3) =
3
P
n=0
x(n)e
−j6πn
4 =

1e0 + 2e−j3π/2 + 3e−j3π + 4e−j9π/2

= [1 + 2j − 3 − 4j][−2 − j2]
The DFT of the sequence x(n) = [1 2 3 4] is [10, − 2 + j2, − 2, − 2 − j2]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 54 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find 8 point DFT for a given a sequence x(n) = [1, 1, 1, 1] assume imaginary part is zero. Also
calculate magnitude and phase
Solution:
x(n) = [1 1 1 1]
The 8 point DFT is of length 8. Append zeros at the end of the sequence. x(n) = [1 1 1 1 0 0 0
0]











X(0)
X(1)
X(2)
X(3)
X(4)
X(5)
X(6)
X(7)











=











1 1 1 1 1 1 1 1
1 W 1
8 W 2
8 W 3
8 W 4
8 W 5
8 W 6
8 W 7
8
1 W 2
8 W 4
8 W 6
8 W 8
8 W 10
8 W 12
8 W 14
8
1 W 3
8 W 6
8 W 9
8 W 12
8 W 15
8 W 18
8 W 21
8
1 W 4
8 W 8
8 W 12
8 W 16
8 W 20
8 W 24
8 W 28
8
1 W 5
8 W 10
8 W 15
8 W 20
8 W 25
8 W 30
8 W 35
8
1 W 6
8 W 12
8 W 18
8 W 24
8 W 30
8 W 36
8 W 42
8
1 W 7
8 W 14
8 W 21
8 W 28
8 W 35
8 W 42
8 W 49
8











=











x(0)
x(1)
x(2)
x(3)
x(4)
x(5)
x(6)
x(7)











Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 55 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
W 0
8 = W 8
8 = W 16
8 = W 24
8 = W 40
8 ... = 1
W 1
8 = W 9
8 = W 17
8 = W 25
8 = W 33
8 ... = 1
√
2
− j 1
√
2
W 2
8 = W 10
8 = W 18
8 = W 26
8 = W 34
8 ... = −j
W 3
8 = W 11
8 = W 19
8 = W 27
8 = W 35
8 ... = − 1
√
2
− j 1
√
2
W 4
8 = W 12
8 = W 20
8 = W 28
8 = W 36
8 ... = −1
W 5
8 = W 13
8 = W 21
8 = W 29
8 = W 37
8 ... = − 1
√
2
+ j 1
√
2
W 6
8 = W 14
8 = W 22
8 = W 30
8 = W 38
8 ... = j
W 7
8 = W 15
8 = W 23
8 = W 31
8 = W 39
8 ... = 1
√
2
+ j 1
√
2











X(0)
X(1)
X(2)
X(3)
X(4)
X(5)
X(6)
X(7)











=














1 1 1 1 1 1 1 1
1 1
√
2
− j 1
√
2
−j − 1
√
2
− j 1
√
2
−1 − 1
√
2
+ j 1
√
2
j 1
√
2
+ j 1
√
2
1 −j −1 j 1 −j −1 j
1 − 1
√
2
− j 1
√
2
j 1
√
2
− j 1
√
2
1 1
√
2
+ j 1
√
2
−j − 1
√
2
+ j 1
√
2
1 −1 1 −1 1 −1 1 −1
1 − 1
√
2
+ j 1
√
2
−j 1
√
2
+ j 1
√
2
−1 1
√
2
− j 1
√
2
j − 1
√
2
− j 1
√
2
1 j −1 −j 1 j −1 −j
1 1
√
2
+ j 1
√
2
j − 1
√
2
+ j 1
√
2
−1 − 1
√
2
− j 1
√
2
−j 1
√
2
− j 1
√
2














=











1
1
1
1
0
0
0
0






















4
1 − j(1 +
√
2)
0
1 + j(1 −
√
2)
0
1 − j(1 −
√
2)
0
1 + j(1 +
√
2)











=











XR (0)
XR (1)
XR (2)
XR (3)
XR (4)
XR (5)
XR (6)
XR (7)






















4
1
0
1
0
1
0
1











and











XI (0)
XI (1)
XI (2)
XI (3)
XI (4)
XI (5)
XI (6)
XI (7)






















0
−(1 +
√
2)
0
(1 −
√
2)
0
−(1 −
√
2)
0
(1 +
√
2)











Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 56 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find DFT for a given a sequence x(n) = [2 3 4 4]
Solution: 



X(0)
X(1)
X(2)
X(3)



 =




1 1 1 1
1 W W 2 W 3
1 W 2 W 4 W 6
1 W 3 W 6 W 9



 =




2
3
4
4




WN = e− 2π
N = e− 2π
4 = e− π
2 = −j
W 2 = −j2
= −1, W 3 = −j3
= j
Using the property of periodicity of W W p = W P+r.N = j with basic period N = 4
W 4 = W 4−4 = W 0 = 1, W 6 = W 6−4 = W 2 = −1, W 9 = W 9−2.4 = W 1 = −j




X(0)
X(1)
X(2)
X(3)



 =




1 1 1 1
1 −j −1 j
1 −1 1 −1
1 j −1 −j








2
3
4
4



 =




13
−2 + j
−1
−2 − j




The DFT of the sequence x(n) = [2 3 4 4] is [13, − 2 + j, − 1, − 2 − j]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 57 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find DFT for a given a sequence x(n) = [1 2 3 4]
Solution: 



X(0)
X(1)
X(2)
X(3)



 =




1 1 1 1
1 W W 2 W 3
1 W 2 W 4 W 6
1 W 3 W 6 W 9



 =




1
2
3
4




WN = e− 2π
N = e− 2π
4 = e− π
2 = −j
W 2 = −j2
= −1, W 3 = −j3
= j
Using the property of periodicity of W W p = W P+r.N = j with basic period N = 4
W 4 = W 4−4 = W 0 = 1, W 6 = W 6−4 = W 2 = −1, W 9 = W 9−2.4 = W 1 = −j




X(0)
X(1)
X(2)
X(3)



 =




1 1 1 1
1 −j −1 j
1 −1 1 −1
1 j −1 −j








1
2
3
4



 =




10
−2 + 2j
−2
−2 − 2j




The DFT of the sequence x(n) = [1 2 3 4] is [10, − 2 + j2, − 2, − 2 − j2]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 58 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Inverse DFT: Find the IDFT for X(k) = [10, − 2 + j2, − 2, − 2 − j2]
x(n) =
1
N
N−1
X
k=0
X(k)e
2π
N
kn
for n = 0, 1.., N − 1
x(n) =
1
N
N−1
X
k=0
X(k)W ∗kn
for n = 0, 1.., N − 1 where W ∗
= e
2π
N
x(0) =
1
4
N−1
X
k=0
X(k)ej0
= X(0)ej0
+ X(1)ej0
+ X(2)ej0
+ X(3)ej0
=
1
4
(10 + (−2 + j2) − 2 + (−2 − j2)) = 1
x(1) =
1
4
N−1
X
k=0
X(k)ej kπ
2 = X(0)ej0
+ X(1)ej π
2 + X(2)ejπ
+ X(3)ej 3π
2
=
1
4
(X(0) + jX(1) − X(2) − jX(3)
=
1
4
(10 + j(−2 + j2) − (−2) − j(−2 − j2)) = 2
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 59 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
x(2) =
1
4
N−1
X
k=0
X(k)ej kπ
2 = X(0)ej0
+ X(1)ejπ
+ X(2)ej2π
+ X(3)ej3π
=
1
4
(X(0) − X(1) + X(2) − X(3)
=
1
4
(10 − (−2 + j2) + (−2) − (−2 − j2)) = 3
x(1) =
1
4
N−1
X
k=0
X(k)ej kπ3
2 = X(0)ej0
+ X(1)ej 3π
2 + X(2)ej3π
+ X(3)ej 9π
2
=
1
4
(X(0) − jX(1) − X(2) + jX(3)
=
1
4
(10 − j(−2 + j2) − (−2) + j(−2 − j2)) = 4
Matlab command used to calculate the Inverse DFT is ifft
x=[10 -2+j2 -2 -2-j2]
y=ifft(x)
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 60 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find the Discrete Fourier Transform of the following signal: x(n), n = 0,1,2,3 = [1, 1, -1, -1].
Solution:
N=4 The matrix notation is
X = T.f
where T is matrix of the transform with elements Tkn = W kn
N k, n = 0, 1.., N − 1




X(0)
X(1)
X(2)
X(3)



 =




1 1 1 1
1 −j −1 j
1 −1 1 −1
1 j −1 −j








1
1
−1
−1



 =




0
2 − 2j
0
2 + 2j




The DFT of the sequence x(n) = [1 1 -1 -1] is [0, 2 − j2, 0, 2 + j2]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 61 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find the Inverse Discrete Fourier Transform of the following signal: x(n), n = 0,1,2,3 = [0, 2-2j,
0, 2+2j].
Solution:
The IDFT of the discrete signal X(k)is x(n):
N = 4 and W4 = e−π/2
x(n) =
1
N
N−1
X
k=0
X(k)W −kn
N for n = 0, 1.., N − 1 where W = e− 2π
N
N=4 The matrix notation is
[WN ] =




1 1 1 1
1 −j −1 j
1 −1 1 −1
1 j −1 −j



 [W ∗
N ] =




1 1 1 1
1 j −1 −j
1 −1 1 −1
1 −j −1 j








x(0)
x(1)
x(2)
x(3)



 =
1
N




1 1 1 1
1 j −1 −j
1 −1 1 −1
1 −j −1 j








0
2 − 2j
0
2 + 2j



 =




1
1
−1
−1




The IDFT of the sequence X(k) = [0, 2 − j2, 0, 2 + j2] is [1 1 -1 -1]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 62 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find DFT for a given a sequence x[0]=1, x[1]=2, x[2]=2, x[3]=1, x[n]=0 otherwise: x =
[1,2,2,1]
Solution:
x(n) = [1 2 2 1]
for k=0,1,2,3
X(0) =
3
P
n=0
x(n)e0 =

1e0 + 2e0 + 2e0 + 1e0

= [1 + 2 + 2 + 1] = 6
X(1) =
3
P
n=0
x(n)e−j 2πn
4 =

1e0 + 2e−jπ/2 + 2e−jπ + 1e−j3π/2

= [1 − j2 − 2 + j1] = [−1 − j1]
X(2) =
3
P
n=0
x(n)e
−j4πn
4 =

1e0 + 2e−jπ + 2e−j2π + 1e−j3π

= [1 − 2 + 2 − 1] = [0] = 0
X(3) =
3
P
n=0
x(n)e
−j6πn
4 =

1e0 + 2e−j3π/2 + 2e−j3π + 1e−j9π/2

= [1 + 2j − 2 − 1j][−1 + j1]
The DFT of the sequence x(n) = [1 2 2 1] is [6, − 1 − j1, 0, − 1 + j1]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 63 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find IDFT for a given a sequence X[0]=6, X[1]=-1-j1, X[2]=0, X[3]=-1+j1, X[n]=0 otherwise:
x = [6, − 1 − j1, 0, − 1 + j1]
Solution:
x(n) = [6, − 1 − j1, 0, − 1 + j1]
for k=0,1,2,3
X(0) = 1
4
3
P
n=0
x(n)e0 =

6e0 + (−1 − j1)e0 + 0e0 + (−1 + j1)e0

= 1
4
[6−1−j1+0−1+j1] = 1
X(1) = 1
4
3
P
n=0
x(n)ej 2πn
4 =

6e0 + (−1 − j1)ejπ/2 + 0ejπ + (−1 + j1)ej3π/2

=
1
4
[6 − j + 1 + j + 1] = [2]
X(2) = 1
4
3
P
n=0
x(n)e
j4πn
4 =

6e0 + (−1 − j1)ejπ + 0ej2π + (−1 + j1)ej3π

=
1
4
[6 + (−1 − j1)(j) + 0 + (−1 + j)(−j)] = 1
4
[6 − j1 + 1 + 0 + 1 + j] = [2]
X(3) = 1
4
3
P
n=0
x(n)e
−j6πn
4 =

6e0 + (−1 − j1)ej3π/2 + 0ej3π + (−1 + j1)ej9π/2

=
1
4
[6 + (−1 − j1)(−j) + 0 + (−1 + j)(j)] = 1
4
[6 + j1 − 1 + 0 − 1 − j] = [1]
The IDFT of the sequence [6, − 1 − j1, 0, − 1 + j1] is x(n) = [1 2 2 1]
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 64 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Continuous Time Fourier Transform (CTFT)
X(jω) =
∞
Z
−∞
x(t)e−jωt
dt
x(t) =
1
2π
∞
Z
−∞
X(jω)ejωt
dω
Discrete Time Fourier Transform (DTFT)
X(ejω
) =
∞
X
−∞
x(n)e−jωn
x(n) =
1
2π
Z
2π
X(ejω
)ejωn
dω
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 65 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Unit sample δ(n)
x(n) =

1 for n = 0
0 for n 6= 0
X(k) =
N−1
X
x=0
x(n)e−j 2π
N
nk
=
N−1
X
x=0
x(0)e0
= 1 × 1 = 1
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 66 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find the N Point DFT of x(n) = an for 0 ≤ n ≤ N − 1
X(k) =
N−1
X
x=0
x(n)e−j 2π
N
nk
=
N−1
X
x=0
an
e−j 2π
N
nk
=
N−1
X
x=0
(ae−j 2πk
N )n
X(k) =
1 − aN e−j2πk
1 − ae−j2πk /N
Using series expansion
N−1
X
k=0
ak
=
aN1 − aN2+1
1 − a
!
e−j2πk = 1
X(k) =
1 − aN
1 − ae−j2πk /N
x[n] = (0.5)n
u[n] 0 ≤ n ≤ 3
X(k) =
1 − (0.5)4
1 − 0.5e−j2πk /4
=
0.9375
1 − 0.5e−jπ/2k
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 67 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find the 4 Point DFT of x(n) = cos( nπ
4
)
Solution:
x(0) = cos(0) = 1
x(1) = cos( 1π
4
) = 0.707
x(2) = cos( 2π
4
) = 0
x(3) = cos( 3π
4
) = −0.707




x(0)
x(1)
x(2)
x(3)



 =
1
N




1 1 1 1
1 −j −1 j
1 −1 1 −1
1 j −1 −j








1
0.707
0
−0.707



 =




1
1 − j1.414
1
1 + j1.414




Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 68 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
If the length of x[n] is N=4, and if its 8-point DFT is: X8[k]
k = 0..7 = [5, 3 −
√
2j, 3, 1 −
√
2j, 1, 1 +
√
2j, 3, 3 +
√
2j] , find the 4 point DFT of the signal
x[n].
Solution:
The samples of Xs [k] are eight equally spaced samples from the frequency spectrum of
the signal x[n]:
More precisely, they are samples from the spectrum for the following frequencies:
ωT =

0, π
4
, π
2
, 3π
4
, π 5π
4
, 3π
2
, 7π
4

With 4-point DFT of x[n] we get 4 samples from the spectrum of x[n]: ωT =

0, π
2
, π, 3π
2

By comparing the two sets of frequencies:
X4[0] = X(ej0) = Xs [0] = 5
X4[1] = X(ejπ/2) = Xs [2] = 3
X4[2] = X(ejπ) = Xs [4] = 1
X4[3] = X(ej3π/2) = Xs [6] = 3
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 69 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find the Fourier Transform of the sequence
x[n] =

1 0 ≤ n ≤ 4
0 else
X

ejw

=
∞
X
n=−∞
x [n] e−jwn
X

ejω

= e−j2ω sin (5ω/2)
sin (ω/2)
Consider a causal sequence x[n] where;
x[n] = (0.5)n
u[n]
Its DTFT X ejw

can be obtained as
X

ejw

=
∞
X
n=−∞
(0.5)n
u[n]e−jwn
=
∞
X
n=0
(0.5)n
(1)e−jwn
=
∞
X
n=0

0.5ejw
n
=
1
1 − 0.5e−jw
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 70 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
Find the N Point DFT of x(n) = 4 + cos2(2πn
N
)
Solution:
x(0) = 4 + cos2(0) = 5
x(1) = 4 + cos2(2π1
10
) = 4.6545
x(2) = 4 + cos2(2π2
10
) = 4.09549
x(3) = 4 + cos2(2π3
10
) = 4.09549
x(4) = 4 + cos2(2π4
10
) = 4.09549
x(5) = 4 + cos2(2π5
10
) = 5
x(6) = 4 + cos2(2π6
10
) = 4.6545
x(7) = 4 + cos2(2π7
10
) = 4.09549
x(8) = 4 + cos2(2π8
10
) = 4.09549
x(9) = 4 + cos2(2π9
10
) = 4.6545
x(n) = x(N − n)
Cosine function is even function
x(n) = x(−n)
X(k) =
N−1
X
n=0
x(n)cos

2πkn
N

0 ≤ k ≤ N − 1
X(k) =
N−1
X
n=0

4 + cos2
(
2πn
N
)

cos

2πkn
N

0 ≤ k ≤ N − 1
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 71 / 91
Relationship of the DFT to other Transforms Relationship of the DFT to other Transforms
Relationship of the DFT to other Transforms
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 72 / 91
Relationship of the DFT to other Transforms Relationship of the DFT to other Transforms
Relationship to the Fourier series coefficients of periodic sequence
DFT expression is
X(k) =
N−1
X
n=0
x(n)e−j2πkn/N
k = 0, 1, . . . N − 1 (1)
IDFT expression is
x(n) =
1
N
N−1
X
k=0
X(k)ej2πkn/N
n = 0, 1, · · · N − 1 (2)
Fourier series is
xp(n) =
N−1
X
k=0
ck ej 2π
N
nk
− ∞ ≤ n ≤ ∞ (3)
Fourier series coefficients are expressed as:
ck =
1
N
N−1
X
k=0
xp(n)e−j 2π
N
nk
k = 0, 1.., N − 1 (4)
By comparing X(k) and ck fourier series coefficients has the form of a DFT.
x(n) = xp(n) 0 ≤ n ≤ N − 1
X(k) = Nck 0 ≤ n ≤ N − 1
Fourier series has the form of an IDFT
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 73 / 91
Relationship of the DFT to other Transforms Relationship of the DFT to other Transforms
Relationship to the Fourier transform of an aperiodic sequence (DFT and DTFT)
Fourier transform X(ω)
X(ω) =
∞
X
n=−∞
x(n)−jωn
− ∞ ≤ n ≤ ∞ (5)
X(k) = X(ω|ω=2πk/N ) =
∞
X
n=−∞
x(n)−j 2π
N
nk
− ∞ ≤ n ≤ ∞ (6)
DFT coefficients are expressed as:
xp(n) =
∞
X
n=−∞
x(n − lN) (7)
xp(n) is determined by aliasing x(n) over the interval 0 ≤ n ≤ N − 1. The finite duration
sequence
x̂(n) =

xp(n) 0 ≤ n ≤ N − 1
0 Otherwise
The relation between x̂(n) and x(n) exist when x(n) is of finite duration
x(n) = x̂(n) 0 ≤ n ≤ N − 1
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 74 / 91
Relationship of the DFT to other Transforms Relationship of the DFT to other Transforms
Relationship to the Z Transform
Z transform of the sequence x(n) is
X(z) =
∞
X
n=−∞
x(n)z−n
(8)
Sample X(z) at N equally spaced points on the unit circle. These points will be
Zk = ej2πk/N
k = 0, 1, · · · N − 1 (9)
X(z)|zk = ej2πk/N
=
∞
X
n=−∞
x(n)e−j2πkn/N
(10)
If x(n) is causal and has N number of samples then
X(z)|zk = ej2πk/N
=
∞
X
n=0
x(n)e−j2πkn/N
(11)
This is equivalent to DFT X(k)
X(k) = X(z)|zk = ej2πk/N
(12)
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 75 / 91
Relationship of the DFT to other Transforms Relationship of the DFT to other Transforms
Parseval’s Theorem
Consider a sequence x(n) and y(n)
x(n)
DFT
↔ X(k)
y(n)
DFT
↔ Y (k)
N−1
X
n=0
x(n)y∗
(n) =
1
N
N−1
X
k=0
X(k)Y ∗
(k) (13)
When x(n)=y(n)
N−1
X
n=0
|x(n)|2
=
1
N
N−1
X
k=0
|X(k)|2
(14)
This equation give the energy of finite duration sequence it terms of its frequency
components
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 76 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
Determine the DFT of the sequence for N=8, h(n) =
 1
2
− 2 ≤ n ≤ 2
0 otherwise
Plot the magnitude and phase response for N=8
Solution:
h(n) =





1
2
,
1
2
,
1
2
↑
,
1
2
,
1
2





Consider a sequence x(n) and its DFT is
x(n)
DFT
↔ X(k)
xp(n)
DFT
↔ X(k)
where xp(n) is the periodic sequence of x(n) in this example x(n) is of h(n) and is of
h(n) =





1
2
,
1
2
,
1
2
↑
,
1
2
,
1
2





There are 5 samples in h(n) append 3 zeros to the right side of the sequence h(n)
h(n) =





1
2
,
1
2
,
1
2
↑
,
1
2
,
1
2
, 0, 0, 0





Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 77 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
The DFT of h(n) and hp(n) is h(n)
DFT
↔ H(k) hp(n)
DFT
↔ H(k)
n
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13
These are new
sequences x(n)
( )
p
h n
-2 -1 0 1 2 3 4 5 n
( )
h n
1
2
Figure 40: Plot of h(n) and hp(n)
The value of h(n) from the Figure is represented as
h(n) =

hp(n) 0 ≤ n ≤ N − 1
0 Otherwise
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 78 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
The new sequence h(n) from hp(n) is
h(n) =





1
2
↑
,
1
2
,
1
2
, 0, 0, 0,
1
2
,
1
2
















X(0)
X(1)
X(2)
X(3)
X(4)
X(5)
X(6)
X(7)











=











1 1 1 1 1 1 1 1
1 W 1
8 W 2
8 W 3
8 W 4
8 W 5
8 W 6
8 W 7
8
1 W 2
8 W 4
8 W 6
8 W 8
8 W 10
8 W 12
8 W 14
8
1 W 3
8 W 6
8 W 9
8 W 12
8 W 15
8 W 18
8 W 21
8
1 W 4
8 W 8
8 W 12
8 W 16
8 W 20
8 W 24
8 W 28
8
1 W 5
8 W 10
8 W 15
8 W 20
8 W 25
8 W 30
8 W 35
8
1 W 6
8 W 12
8 W 18
8 W 24
8 W 30
8 W 36
8 W 42
8
1 W 7
8 W 14
8 W 21
8 W 28
8 W 35
8 W 42
8 W 49
8











=











x(0)
x(1)
x(2)
x(3)
x(4)
x(5)
x(6)
x(7)











Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 79 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
W 0
8 = W 8
8 = W 16
8 = W 24
8 = W 40
8 ... = 1
W 1
8 = W 9
8 = W 17
8 = W 25
8 = W 33
8 ... = 1
√
2
− j 1
√
2
W 2
8 = W 10
8 = W 18
8 = W 26
8 = W 34
8 ... = −j
W 3
8 = W 11
8 = W 19
8 = W 27
8 = W 35
8 ... = − 1
√
2
− j 1
√
2
W 4
8 = W 12
8 = W 20
8 = W 28
8 = W 36
8 ... = −1
W 5
8 = W 13
8 = W 21
8 = W 29
8 = W 37
8 ... = − 1
√
2
+ j 1
√
2
W 6
8 = W 14
8 = W 22
8 = W 30
8 = W 38
8 ... = j
W 7
8 = W 15
8 = W 23
8 = W 31
8 = W 39
8 ... = 1
√
2
+ j 1
√
2
|H(k)|
Magnitude
0 1 2 3 4 5 6 7 k
0
.5
1
1.5
2
2.5
0 1 2 3 4 5 6 7 k
-180
180
-90
90
Phase of H(k)











X(0)
X(1)
X(2)
X(3)
X(4)
X(5)
X(6)
X(7)











=














1 1 1 1 1 1 1 1
1 1
√
2
− j 1
√
2
−j − 1
√
2
− j 1
√
2
−1 − 1
√
2
+ j 1
√
2
j 1
√
2
+ j 1
√
2
1 −j −1 j 1 −j −1 j
1 − 1
√
2
− j 1
√
2
j 1
√
2
− j 1
√
2
1 1
√
2
+ j 1
√
2
−j − 1
√
2
+ j 1
√
2
1 −1 1 −1 1 −1 1 −1
1 − 1
√
2
+ j 1
√
2
−j 1
√
2
+ j 1
√
2
−1 1
√
2
− j 1
√
2
j − 1
√
2
− j 1
√
2
1 j −1 −j 1 j −1 −j
1 1
√
2
+ j 1
√
2
j − 1
√
2
+ j 1
√
2
−1 − 1
√
2
− j 1
√
2
−j 1
√
2
− j 1
√
2














=












1
2
1
2
1
2
0
0
0
1
2
1
2























2.5
1.207
−0.5
−0.207
0.5
−0.207
−0.5
1.207











=











2.5∠0
1.207∠0
0.5∠ − 180
0.207∠ − 180
0.5∠0
0.207∠ − 180
0.5∠ − 180
1.207∠0











Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 80 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
The unit sample response of the first order recursive filter is given as h(n) = anu(n)
i) Determine the Fourier transform H(ω)
ii) DFT H(k) of h(n)
iii) Relationship between H(ω) and H(k)
H(ω) =
∞
X
n=−∞
h(n)e−jωn
=
∞
X
n=−∞
an
u(n)e−jωn
=
∞
X
n=0
(ae−jω)n
∵ u(n) = 0 for n  0
N−1
X
k=0
ak
=
(
N for a = 1
1−aN
1−a
for a 6= 1
H(ω) =
(ae−jω)0 − (ae−jω)∞+1
1 − ae−jω
=
1
1 − ae−jω
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 81 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
The DFT of h(n) and hp(n) is
h(n)
DFT
↔ H(k) hp(n)
DFT
↔ H(k)
where hp(n) is related as
hp(n) =
∞
X
l=−∞
h(n − lN)
Consider l=-p
hp(n) =
−∞
X
l=∞
h(n + pN) hp(n) =
∞
X
l=−∞
h(n + pN)
N point DFT H(k) in terms of hp(n) is
H(k) =
N−1
X
n=0
h(n)e−j 2π
N
kn
H(k) =
N−1
X
n=0


∞
X
n=−∞
h(n + pN)

 e−j 2π
N
kn
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 82 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
H(k) =
N−1
X
n=0


∞
X
n=−∞
a(n+pN)
u(n + pN)

 e−j 2π
N
kn
=
N−1
X
n=0
 ∞
X
n=0
a(n+pN)
#
e−j 2π
N
kn
∵ u(n) = 0 for n  0
=
N−1
X
n=0
 ∞
X
n=0
an
apN
#
e−j 2π
N
kn
Interchanging the summations
H(k) =
∞
X
n=0
apN
N−1
X
n=0
an
e−j 2π
N
kn
N
X
k=0
ak
=
1 − aN
1 − a
∞
X
p=0
apN
=
∞
X
p=0
aNp
=
1 − (aN )∞+1
1 − aN
=
1
1 − aN
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 83 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
N−1
X
n=0
an
e−j 2π
N
kn
=
N−1
X
n=0
(ae−j 2π
N
k)n
=
(ae−j2πk/N )0 − (ae−j2πk/N )N
1 − (ae−j2πk/N )
N−1
X
n=0
(ae−j 2π
N
k)n
=
1 − aN e−j2πk
1 − (ae−j2πk/N )
=
1 − aN
1 − (ae−j2πk/N )
∵ e−j2πk
= 1
H(k) =
1
1 − aN
1 − aN
1 − (ae−j2πk/N )
=
1
1 − (ae−j2πk/N )
H(ω) = =
1
1 − ae−jω
and H(k) =
1
1 − (ae−j2πk/N )
H(k) = H(ω)|ω=2πk/N
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 84 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
Compute the DFT of the following finite length sequence of length N x(n) = u(n) − u(n − N)
u(n)
0 1 2 3 4 N-3 N-2 N-1 N N+1 N+2 … n
Unit step sequence u(n)
u(n-N)
0 1 2 3 4 N-3 N-2 N-1 N N+1 N+2 … n
Unit step sequence delayed by N samples
x(n)=u(n)-u(n-N)
0 1 2 3 4 N-3 N-2 N-1 N N+1 N+2 … n
Subtraction of u(n-N) from u(n)
Figure 41: Generation of x(n) = u(n) − u(n − N)
The value of x(n) as shown in Figure is represented as
x(n) =

1 0 ≤ n ≤ N − 1
0 Otherwise
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 85 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
DFT expression is
X(k) =
N−1
X
n=0
x(n)e−j2πkn/N
k = 0, 1, . . . N − 1
=
N−1
X
n=0
1e−j2πkn/N
=
N−1
X
n=0
(e−j2πk/N
)n
(1)
N−1
X
k=0
ak
=
1 − aN
1 − a
#
X(k) =
1 − e−j2πk
e−j2πk/N
=
1 − 1
e−j2πk/N
= 0
When k=0 From the expression (1)
X(k) =
N−1
X
n=0
(1)n
= N
X(k) =

0 when k 6= 0
N when k = 0
X(k) = Nδ(k)
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 86 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
If x(n)=[1,2,0,3,-2, 4,7,5] evaluate the following i) X(0) ii) X(4) iii)
7
P
k=0
X(k) iv)
7
P
k=0
|X(k)|2
X(0) is
X(k) =
N−1
X
n=0
x(n)e−j2πkn/N
with k=0 and N=8
X(0) =
N−1
X
n=0
x(n) = 1 + 2 + 0 + 3 − 2 + 4 + 7 + 5 = 20
X(4) is
X(k) =
N−1
X
n=0
x(n)e−j2πkn/N
with k=4 and N=8
X(4) =
N−1
X
n=0
x(n)e−j2π4n/8
=
N−1
X
n=0
x(n)e−jπn
=
N−1
X
n=0
x(n)(−1)n
X(4) == 1 − 2 + 0 − 3 − 2 − 4 + 7 − 5 = −8
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 87 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
iii)
7
P
k=0
X(k)
We Know the IDFT expression as
x(n) =
1
N
N−1
X
n=0
X(k)ej2πkn/N
With n=0 and N=8 it becomes
x(0) =
1
8
N−1
X
n=0
X(k)
∴
N−1
X
n=0
X(k) = 8x(0) = 8 × 1 = 8
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 88 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
The value of
7
P
k=0
|X(k)|2 is
The expression for Parseval’s theorem is
N−1
X
n=0
|x(n)|2
=
1
N
N−1
X
k=0
|X(k)|2
7
P
k=0
|X(k)|2is related as
N−1
X
n=0
|x(n)|2
=
1
N
N−1
X
k=0
|X(k)|2
N=8 Then
7
X
n=0
|x(n)|2
=
1
8
7
X
k=0
|X(k)|2
7
X
k=0
|X(k)|2
= 8
7
X
n=0
|x(n)|2
= 8[1 + 4 + 0 + 9 − 4 + 4 + 49 + 25] = 864
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 89 / 91
Thank You
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 90 / 91
References
J. G. Proakis and D. G. Monalakis, Digital signal processing Principles Algorithms 
Applications, 4th ed. Pearson education, 2007.
Oppenheim and Schaffer, Discrete Time Signal Processing. Pearson education, Prentice
Hall, 2003.
S. K. Mitra, Digital Signal Processing. Tata Mc-Graw Hill, 2004.
L. Tan, Digital Signal Processing. Elsivier publications, 2007.
J. S. Chitode, Digital signal processing. Technical Pulications.
B. Forouzan, Data Communication and Networking, 4th ed. McGraw-Hill, 2006.
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5]
September 11, 2014 91 / 91

DTS 01discrete-fourier-transform (1).pdf

  • 1.
    UNIT - 1:Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] Dr. Manjunatha. P manjup.jnnce@gmail.com Professor Dept. of ECE J.N.N. College of Engineering, Shimoga September 11, 2014
  • 2.
    DSP Syllabus Introduction DigitalSignal Processing: Introduction [1, 2, 3, 4] Slides are prepared to use in class room purpose, may be used as a reference material All the slides are prepared based on the reference material Most of the figures/content used in this material are redrawn, some of the figures/pictures are downloaded from the Internet. I will greatly acknowledge for copying the some the images from the Internet. This material is not for commercial purpose. This material is prepared based on Digital Signal Processing for ECE/TCE course as per Visvesvaraya Technological University (VTU) syllabus (Karnataka State, India). Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 2 / 91
  • 3.
    DSP Syllabus DSP Syllabus PART- A UNIT - 1: Discrete Fourier Transforms (DFT) Frequency domain sampling and reconstruction of discrete time signals. DFT as a linear transformation, its relationship with other transforms. 7 Hours Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 3 / 91
  • 4.
    Introduction The conceptof frequency in continuous and discrete time signals The concept of frequency in continuous and discrete time signals Continuous Time Sinusoidal Signals The concept of frequency is closely related to specific type of motion called harmonic oscillation which is directly related to the concept of time. A simple harmonic oscillation is mathematically described by: xa(t) = Acos(Ωt + θ), − ∞ < t < ∞ The subscript a is used with x(t) to denote an analog signal. A is the amplitude, Ω is the frequency in radians per second(rad/s), and θ is the phase in radians. The Ω is related by frequency F in cycles per second or hertz by Ω = 2πF xa(t) = Acos(2πFt + θ), − ∞ < t < ∞ Figure 1: Example of an analog sinusoidal signal Cycle and Period The completion of one full pattern waveform is called a cycle. A period is defined as the amount of time required to complete one full cycle. Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 4 / 91
  • 5.
    Introduction The conceptof frequency in continuous and discrete time signals Complex exponential signals xa(t) = Aej(Ωt+θ) where e±jφ = cosφ ± jsinφ xa(t) = Acos(Ωt + θ) = A 2 ej(Ωt+θ) + A 2 e−j(Ωt+θ) As time progress the phasors rotate in opposite directions with angular ±Ω frequencies radians per second. A positive frequency corresponds to counterclockwise uniform angular motion, a negative frequency corresponds to clockwise angular motion. Figure 2: Representation of cosine function by phasor Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 5 / 91
  • 6.
    Introduction Discrete TimeSinusoidal Signals Discrete Time Sinusoidal Signals A discrete time sinusoidal may expressed as x(n) = Acos(ωn + θ), − ∞ < t < ∞ where n is an integer variable called the sample number. A is the amplitude, ω is the frequency in radians per sample(rad/s), and θ is the phase in radians. The ω is related by frequency f cycles per sample by ω = 2πf x(n) = Acos(2πfn + θ), − ∞ < t < ∞ A discrete time signal x(n) is periodic with period N(N > 0) if and only if x(n + N) = x(n) for all n Figure 3: Discrete signal Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 6 / 91
  • 7.
    Introduction Discrete TimeSinusoidal Signals Periodic and aperiodic (non-periodic) signals. A periodic signal consists a continuously repeated pattern. Signal is periodic if it exhibits periodicity i.e. x(t + T) = x(t) for all t It has a property that it is unchanged by a time shift of T. An aperiodic signal changes constantly without exhibiting a pattern or cycle that repeats over the time. Figure 4: Periodic signals Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 7 / 91
  • 8.
    Introduction Discrete TimeSinusoidal Signals Periodic and aperiodic (non-periodic) signals. Figure 5: Periodic signal Figure 6: Periodic discrete time signal Figure 7: Periodic discrete time signal Figure 8: Periodic discrete time Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 8 / 91
  • 9.
    Introduction Discrete TimeSinusoidal Signals Periodic and aperiodic (non-periodic) signals. Figure 9: Aperiodic signals Figure 10: Aperiodic discrete time signals Figure 11: Aperiodic discrete time signals Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 9 / 91
  • 10.
    Introduction Discrete TimeSinusoidal Signals Periodic and aperiodic (non-periodic) signals. Figure 12: Aperiodic (random) signal Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 10 / 91
  • 11.
    Fourier series Fourier series Dr.Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 11 / 91
  • 12.
    Fourier series Fourierseries Sinusoidal functions are wide applications in Engineering and they are easy to generate. Fourier has shown that periodic signals can be represented by series of sinusoids with different frequency. A signal f (t) is said to be periodic of period T if f (t) = f (t + T) for all t. Periodic signals can be represented by the Fourier series and non periodic signals can be represented by the Fourier transform. For example square wave pattern can be approximated with a suitable sum of a fundamental sine wave plus a combination of harmonics of this fundamental frequency. Several waveforms that are represented by sinusoids are as shown in Figure 14. This sum is called a Fourier series. The major difference with respect to the line spectra of periodic signals is that the spectra of aperiodic signals are defined for all real values of the frequency variable ω. Figure 13: Square Wave from Fourier Series Figure 14: Waveforms from Fourier Series Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 12 / 91
  • 13.
    Fourier series Fourierseries Fourier analysis: Every composite periodic signal can be represented with a series of sine and cosine functions with different frequencies, phases, and amplitudes. The functions are integral harmonics of the fundamental frequency f of the composite signal. Using the series we can decompose any periodic signal into its harmonics. f (θ) = a0 + ∞ X n=1 ancos(nθ) + ∞ X n=1 bnsin(nθ) where a0 = 1 2π 2π Z 0 f (θ)dθ an = 1 π 2π Z 0 f (θ)cos(nθ)dθ bn = 1 π 2π Z 0 f (θ)sin(nθ)dθ Line spectra, harmonics The fundamental frequency f0 = 1/T. The Fourier series coefficients plotted as a function of n or nf0 is called a Fourier spectrum. Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 13 / 91
  • 14.
    Fourier series Fourierseries Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 14 / 91
  • 15.
    Fourier series Fourierseries Figure 15: Square Wave f (θ) = A when 0 θ π −A when π θ 2π f (θ + 2π) = f (θ) a0 = 1 2π Z 2π 0 f (θ)dθ = 1 2π Z π 0 f (θ)dθ + Z 2π π f (θ)dθ = 1 2π Z π 0 Adθ + Z 2π π (−A)dθ = 0 an = 1 π Z 2π 0 f (θ) cos nθdθ = 1 π Z π 0 A cos nθdθ + Z 2π π (−A) cos nθdθ = 1 π −A sin nθ n π 0 + 1 π A sin nθ n 2π π = 0 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 15 / 91
  • 16.
    Fourier series Fourierseries bn = 1 π Z 2π 0 f (θ) sin nθdθ = 1 π Z π 0 A sin nθdθ + Z 2π π (−A) sin nθdθ = 1 π −A cos nθ n π 0 + 1 π A cos nθ n 2π π = A nπ [− cos nπ + cos 0 + cos 2nπ − cos nπ] = A nπ [1 + 1 + 1 + 1] = 4A nπ when n is odd bn = A nπ [− cos nπ + cos 0 + cos 2nπ − cos nπ] = A nπ [−1 + 1 + 1 − 1] = 0 when n is even 4A π sin θ + 1 3 sin 3θ + 1 5 sin 5θ + 1 7 sin 7θ + · · · Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 16 / 91
  • 17.
    Fourier series Fourierseries 4A π sin θ + 1 3 sin 3θ + 1 5 sin 5θ + 1 7 sin 7θ + · · · Figure 16: Square Wave from Fourier Series Figure 17: Square Wave from Fourier Series Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 17 / 91
  • 18.
    Fourier series Fourierseries clc;clear all; close all; f=100;%Fundamental frequency 100 Hz t=0:.00001:.05; xsin = sin(2*pi*f*t); x1 = sin(2*pi*f*t); x3 = (1/3)*sin(3*2*pi*f*t); x5 = (1/5)*sin(5*2*pi*f*t); x7 = (1/7)*sin(7*2*pi*f*t); x=x1+x3+x5+x7; subplot(2,1,1) plot(t,xsin,’linewidth’,2); xlabel(’theta’,’fontsize’,16) ylabel(’sin(theta)’,’fontsize’,16) title(’Fundamental sinusoidal signal’) subplot(2,1,2) plot(t,x,’linewidth’,2); xlabel(’theta’,’fontsize’,16) ylabel(’f (theta)’,’fontsize’,16) title(’Reconstructed square wave by Fourier ’) 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 −1 −0.5 0 0.5 1 θ sin(θ) Fundamental sinusoidal signal 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05 −1 −0.5 0 0.5 1 θ f (θ) Reconstructed square wave by Fourier Figure 18: Square Wave Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 18 / 91
  • 19.
    Fourier series Fourierseries Figure 19: Triangular Wave bn = 2 T Z T 0 f (t) sin 2πn T t dt = 4 T Z T/2 0 f (t) sin 2πn T t dt = 4 T Z T/4 0 t sin 2πn T t dt + 4 T Z T/4 0 −t + T 2 sin 2πn T t dt = 4 T 2 T 2πn 2 sin πn 2 # = 2T 2π2n2 sin πn 2 = 0 when n is even 2T π2 sin 2π T t − 1 32 sin 6π T t + 1 52 sin 10π T t − · · · f (t) = t when − T 4 ≤ t ≤ T 4 −t + T 2 when T 4 ≤ t ≤ 3T 4 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 19 / 91
  • 20.
    Fourier series Fourierseries Figure 20: Square Wave[6] Figure 21: Sawtooth Signal[6] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 20 / 91
  • 21.
    Fourier series Fourierseries The Exponential (Complex) Form of Fourier Series f (θ) = a0 + ∞ X n=1 an cos nθ + ∞ X n=1 bn sin nθ cosθ = ejθ + e−jθ 2 sinθ = ejθ − e−jθ 2j an cos nθ + bn sin nθ = = an ejnθ + e−jnθ 2 + bn ejnθ − e−jnθ 2j = an ejnθ + e−jnθ 2 − jbn ejnθ − e−jnθ 2 = an − jbn 2 ejnθ + an + jbn 2 e−jnθ let cn = an − jbn 2 c−n = an + jbn 2 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 21 / 91
  • 22.
    Fourier series Fourierseries an cos nθ + bn sin nθ = cnejnθ + c−n e−jnθ f (θ) = c0 + ∞ X n=1 cnejnθ + c−ne−jnθ = ∞ X n=−∞ cnejnθ where cn = an − jbn 2 The coefficient cn can be evaluated as. cn = 1 2π Z π −π f (θ) cos nθdθ − j 2π Z π −π f (θ) sin nθdθ = 1 2π Z π −π f (θ) (cos nθ − j sin nθ)dθ = 1 2π Z π −π f (θ)e−jnθ dθ In exponential Fourier series only one integral has to be calculated and it is simpler integration. Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 22 / 91
  • 23.
    Fourier series Fourierseries Figure 22: Square Wave[6] Figure 23: Sawtooth Signal[6] N=256; % number of samples T=1/128; % sampling frequency=128Hz k=0:N-1; time=k*T; f=0.25+2*sin(2*pi*5*k*T)+1*sin(2*pi*12.5*k*T)+… +1.5*sin(2*pi*20*k*T)+0.5*sin(2*pi*35*k*T); plot(time,f); title('Signal sampled at 128Hz'); F=fft(f); magF=abs([F(1)/N,F(2:N/2)/(N/2)]); hertz=k(1:N/2)*(1/(N*T)); stem(hertz,magF), title('Frequency components'); Example Find the spectrum of the following signal: f=0.25+2sin(2π5k)+sin(2π12.5k)+1.5sin(2π20k)+0.5sin(2π35k) Figure 24: Square Wave[6] Find the 1000 Hz with ran e frequency z. Form a s dom noise. y componen ignal consis nts of a sig sting of 50 gnal buried Hz and 120 d in noise. 0 Hz sinuso Consider d oids and co data sample orrupt the s ed at signal Figure 25: Sawtooth Signal[6] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 23 / 91
  • 24.
    Fourier series Fourierseries -5 -4 -3 -2 -1 0 1 2 3 4 5 0 200 4 400 600 0 800 1000 1200 14 400 Figure 26: Square Wave[6] Figure 27: Sawtooth Signal[6] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 24 / 91
  • 25.
    Fourier Transform Fourier Transform Dr.Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 25 / 91
  • 26.
    Fourier Transform FourierTransform The Fourier transform is a generalization of the Fourier series representation of functions. The Fourier series is limited to periodic functions, while the Fourier transform can be used for a larger class of functions which are not necessarily periodic. S Sinusoidal functions are wide applications in Engineering and they are easy to generate. Fourier has shown that periodic signals can be represented by series of sinusoids with different frequency. A signal f (t) is said to be periodic of period T if f (t) = f (t + T) for all t. Periodic signals can be represented by the Fourier series and non periodic signals can be represented by the Fourier transform. For example square wave pattern can be approximated with a suitable sum of a fundamental sine wave plus a combination of harmonics of this fundamental frequency. Several waveforms that are represented by sinusoids are as shown in Figure 14. This sum is called a Fourier series. The major difference with respect to the line spectra of periodic signals is that the spectra of aperiodic signals are defined for all real values of the frequency variable ω. Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 26 / 91
  • 27.
    Fourier Transform FourierTransform f (θ) = ∞ X n=−∞ cnejnθ where cn = 1 2π Z π −π f (θ)e−jnθ dθ θ = ωt ω is the angular velocity in radians per second. ω = 2πf and θ = 2πft θ = 2π T t and dθ = 2π T dt when θ = −π −π = 2πt T ⇒ t = − T 2 when θ = π π = 2πt T ⇒ t = T 2 f (t) = ∞ X n=−∞ cnejnωt cn = 1 T Z T/2 −T/2 f (t)e−jnωt dt Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 27 / 91
  • 28.
    Fourier Transform FourierTransform Relationship from Fourier series to Fourier Transform f (t) = ∞ X n=−∞ cnejnωt cn = 1 T Z T/2 −T/2 f (t)e−jnωt dt As T approaches infinity ω approaches zero and n becomes meaningless nω ⇒ ω ω ⇒ ∆ω T ⇒ 2π ∆ω f (t) = ω X n=−ω cωejωt cω = ∆ω 2π Z T/2 −T/2 f (t)e−jωt dt f (t) = 1 2π   ∞ X ω=−∞ Z T/2 −T/2 f (t)e−jωt dt   ejωt ∆ω T ⇒ ∞ ∆ω ⇒ dω and P ⇒ R f (t) = 1 2 Z ∞ −∞ Z ∞ −∞ f (t)e(−jωt) dt e(jωt) dω f (t) = 1 2 Z ∞ −∞ F(ω)e(jωt) dω F(ω) = Z ∞ −∞ f (t)e(−jωt) dt Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 28 / 91
  • 29.
    Fourier Transform FourierTransform Figure 28: Rectangular Pulse Figure 29: Sinc Function F(ω) = 1/2 Z −1/2 exp(−jωt)dt = 1 −jω [exp(−jωt)] 1/2 −1/2 = 1 −jω [exp(−jω/2) − exp(jω/2)] = 1 (ω/2) exp(jω/2) − exp(−jω/2) 2j = sin(ω/2) (ω/2) = sinc(ω/2) since it is sinx x form Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 29 / 91
  • 30.
    Fourier Transform FourierTransform Figure 30: Exponential Figure 31: Gaussian F(ω) = ∞ Z 0 exp( − at) exp(−jωt)dt = ∞ Z 0 exp(−at − jωt)dt = ∞ Z 0 exp(−[a + jω]t)dt = −1 a + jω exp(−[a + jω]t)|+∞ 0 = −1 a + jω [exp(−∞) − exp(0)] = −1 a + jω [0 − 1] = 1 a + jω Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 30 / 91
  • 31.
    Fourier Transform FourierTransform ∞ Z −∞ δ(t) exp(−iω t) dt = exp(−iω [0]) = 1 ∞ Z −∞ 1 exp(−iω t) dt = 2π δ(ω) Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 31 / 91
  • 32.
    Fourier Transform FourierTransform F {exp(iω0 t)} = ∞ Z −∞ exp(iω0 t) exp(−i ω t) dt = ∞ Z −∞ exp(−i [ω − ω0] t) dt = 2π δ(ω − ω0) Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 32 / 91
  • 33.
    Fourier Transform FourierTransform F {cos(ω0t)} = ∞ Z −∞ cos(ω0t) exp(−j ω t) dt = 1 2 ∞ Z −∞ [exp(j ω0 t) + exp(−j ω0 t)] exp(−j ω t) dt = 1 2 ∞ Z −∞ exp(−j [ω − ω0] t) dt + 1 2 ∞ Z −∞ exp(−j [ω + ω0] t) dt = π δ(ω − ω0) + π δ(ω + ω0) Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 33 / 91
  • 34.
    Fourier Transform FourierTransform Figure 32: A signal with four different frequencies Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 34 / 91
  • 35.
    Fourier Transform FourierTransform Figure 33: A signal with four different frequency components at four different time intervals Figure 34: Each peak corresponds to a frequency of a periodic component Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 35 / 91
  • 36.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 36 / 91
  • 37.
    Discrete Fourier Transform(DFT) Many applications demand the processing of signals in frequency domain. The analysis of signal frequency, periodicity, energy and power spectrums can be analyzed in frequency domain. Frequency analysis of discrete time signals is usually and most conveniently performed on a digital signal processor. Applications of DFT: Spectral analysis Convolution of signals Partial differential equations Multiplication of large integers Data compression Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 37 / 91
  • 38.
    Discrete Fourier Transform(DFT) Summary of FS and FT Fourier Series is x(θ) = a0 + ∞ X n=1 ancos(nθ) + ∞ X n=1 bnsin(nθ) where a0 = 1 2π 2π R 0 x(θ)dθ an = 1 π 2π Z 0 x(θ)cos(nθ)dθ bn = 1 π 2π Z 0 x(θ)sin(nθ)dθ The Exponential (Complex) Form x (θ) = ∞ X n=−∞ cnejnθ where cn = 1 2π Z π −π x(θ)e−jnθ dθ x(t) = ∞ X n=−∞ cnejnωt where cn = 1 T Z T/2 −T/2 x(t)e−jnωt dt Fourier Transform pair is X(ω) = Z ∞ −∞ f (t)e(−ωt) dt and x(t) = 1 2 Z ∞ −∞ X(ω)e(jωt) dω Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 38 / 91
  • 39.
    Discrete Fourier Transform(DFT) Summary of FS and FT Time Domain Frequency Domain Transform Continuous Periodic Discrete nonperiodic Fourier series Continuous nonperiodic Continuous nonperiodic Fourier Transform Discrete nonperiodic Continuous nonperiodic Sequences Fourier Transform Discrete periodic Discrete periodic Discrete Fourier Transform Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 39 / 91
  • 40.
    Discrete Fourier Transform(DFT) Summary of FS and FT The Fourier Series for Continuous time Periodic Signals Synthesis Equation x(t) = ∞ P k=−∞ ck ej2πnft Analysis Equation cn = 1 T ∞ R −∞ x(t)e−j2πnft dt The Fourier Transform for Continuous Time Aperiodic Signals Synthesis Equation (Inverse transform) x(t) = ∞ R −∞ X(F)ej2πFt dF Analysis Equation (Direct transform) X(F) = ∞ R −∞ x(t)e−j2πFt dt The Fourier Series for Discrete time Periodic Signals Synthesis Equation x(n) = N−1 P k=0 ck ej2πkn/N Analysis Equation ck = 1 N N−1 P n=0 x(n)e−j2πkn/N The Fourier Transform of Discrete Time Aperiodic Signals Synthesis Equation (Inverse transform) x(n) = 1 2π ∞ R −∞ X(F)ej2πF1t dF Analysis Equation (Direct transform) X(ω) = ∞ P n=−∞ x(n)e−j2πkn/N Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 40 / 91
  • 41.
    Discrete Fourier Transform(DFT) Summary of FS and FT DFT transforms the time domain signal samples to the frequency domain components. Time Amplitude Signal Frequency Amplitude Signal Spectrum Figure 35: Discrete Fourier Transform Signal Types of Transforms Example Waveform Continuous and periodic Fourier Series sine wave Continuous and aperiodic Fourier Series Discrete and periodic Fourier Series Discrete and aperiodic Fourier Series Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 41 / 91
  • 42.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Need For Frequency Domain Sampling In practical application, signal processed by computer has two main characteristics: It should be Discrete and Finite length But nonperiodic sequences Fourier Transform is a continuous function of ω, and it is a periodic function in ω with a period 2π. So it is not suitable to solve practical digital signal processing. Frequency analysis on a discrete-time signal x(n) is achieved by converting time domain sequence to an equivalent frequency domain representation, which is represented by the Fourier transform X(ω) of the sequence x(n). Consider an aperiodic discrete time signal x(n) and its Fourier transform is X(ω) = ∞ X n=−∞ x(n)e−jωn The Fourier transform X(ω) is a continuous function of frequency and it is not a computationally convenient representation of the sequence. To overcome the processing, the spectrum of the signal X(ω) is sampled periodically in frequency at a spacing of δω radians between successive samples. The signal X(ω) is periodic with period 2π and take N equidistant samples in the interval 0 ≤ ω ≤ 2π with spacing δ = 2π/N . Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 42 / 91
  • 43.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Figure 36: Frequency domain sampling Figure 37: Frequency domain sampling To Determine The Value Of N Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 43 / 91
  • 44.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Now consider ω = 2πk/N X 2π N k = ∞ X n=−∞ x(n)e−j2πkn/N k = 0, 1, 2, . . . N − 1 X 2π N k = · · · + −1 X n=−N x(n)e−j2πkn/N + N−1 X n=0 x(n)e−j2πkn/N + 2N−1 X n=N x(n)e−j2πkn/N + · · · = ∞ X n=−∞ lN+N−1 X n=lN x(n)e−j2πkn/N By changing the index in the inner summation from n to n − lN and interchanging the order of summation X 2π N k = N−1 X n=0   ∞ X n=−∞ x(n − lN)   e−j 2π N k(n−lN) = N−1 X n=0   ∞ X n=−∞ x(n − lN)   e−j 2π N kn e−j2πkl e−j2πkl = 1 ∵ both k and l integers Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 44 / 91
  • 45.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) X 2π N k = N−1 X n=0   ∞ X n=−∞ x(n − lN)   e−j2πkn/N k = 0, 1, 2, . . . N − 1 Let xp(n) = ∞ X n=−∞ x(n − lN) The term xp(n) is obtained by the periodic repetition of x(n) every N samples hence it is a periodic signal. This can be expanded by Fourier series as xp(n) = N−1 X k=0 ck ej2πkn/N n = 0, 1, · · · N − 1 where ck is the fourier coefficients expressed as ck = 1 N N−1 X n=0 xp(n)e−j2πkn/N k = 0, 1, · · · N − 1 Upon comparing ck = 1 N X 2π N k k = 0, 1, · · · N − 1 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 45 / 91
  • 46.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) xp(n) = 1 N N−1 X k=0 X 2π N k ej2πkn/N n = 0, 1, · · · N − 1 xp(n) is the reconstruction of the periodic signal from the spectrum X(ω) (IDFT). The equally spaced frequency samples X 2π N k = 0, 1, · · · N − 1 do not uniquely represent the original sequence when x(n) has infinite duration. When x(n) has a finite duration then xp(n) is a periodic repetition of x(n) and xp(n) over a single period is xp(n) = x(n) 0 ≤ n ≤ L − 1 0 L ≤ n ≤ N − 1 For the finite duration sequence of length L the Fourier transform is: X(ω) = L−1 X n=0 x(n)e−jωn 0 ≤ ω ≤ 2π When X(ω) is sampled at frequencies ωk = 2πk/N k = 0, 1, 2, . . . N − 1 then X(k) = X 2πk N = L−1 X n=0 x(n)e−j2πkn/N = N−1 X n=0 x(n)e−j2πkn/N The upper index in the sum has been increased from L − 1 to N − 1 since x(n)=0 for n ≥ L Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 46 / 91
  • 47.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) DFT and IDFT expressions are DFT expressions is X(k) = N−1 X n=0 x(n)e−j2πkn/N k = 0, 1, . . . N − 1 IDFT expressions is xp(n) = 1 N N−1 X k=0 X 2π N k ej2πkn/N n = 0, 1, · · · N − 1 If xp(n) is evaluated for n = 0, 1, 2 . . . N − 1 then xp(n) = x(n) x(n) = 1 N N−1 X k=0 X (k) ej2πkn/N n = 0, 1, · · · N − 1 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 47 / 91
  • 48.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) DFT as a Linear Transformation X(k) = N−1 X n=0 x(n)e−j 2π N kn k = 0, 1, . . . N − 1 Let WN = e−j 2π N is called twiddle factor X(k) = N−1 X x=0 x(n)W nk N for k = 0, 1.., N − 1        X(0) X(1) X(2) . . . X(3)        =           1 1 1 1 . . . 1 1 W W 2 W 3 . . . W N−1 1 W 2 W 2 W 4 . . . W 2(N−1) 1 W 3 W 6 W 9 . . . W 3(N−1) . . . 1 W N−1 W N−2 W N−3 . . . W (N−1)(N−1)           .        x(0) x(1) x(2) . . . x(N − 1)        Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 48 / 91
  • 49.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Periodicity property of WN WN = e−j 2π N Let us consider for N=8 W8 = e−j 2π 8 1 = e−j π 4 kn W kn 8 = e− π 4 kn Result 0 W 0 8 = e0 Magnitude 1 Phase 0 1 W 1 8 = e−j π 4 1 = e−j π 4 Magnitude 1 Phase −π/4 2 W 2 8 = e−j π 4 2 = e−j π 2 Magnitude 1 Phase −π/2 3 W 3 8 = e−j π 4 3 = e−j3 π 4 Magnitude 1 Phase −3π 4 4 W 4 8 = e−j π 4 4 = e−jπ Magnitude 1 Phase −π 5 W 5 8 = e−j π 4 5 = e−j3 π 5 Magnitude 1 Phase −5π/4 6 W 6 8 = e−j π 4 6 = e−j3 π 2 Magnitude 1 Phase −3π/2 7 W 7 8 = e−j π 4 7 = e−j7 π 4 Magnitude 1 Phase −7π/4 8 W 8 8 = e−j π 4 8 = e−j2π Magnitude 1 Phase −2π W 8 8 = W 0 8 9 W 9 8 = e−j π 4 9 = e−j(2π+ π 4 ) Magnitude 1 Phase (−2π + π/4) W 9 8 = W 1 8 10 W 10 8 = e−j π 4 10 = e−j(2π π 2 ) Magnitude 1 Phase (−2π+π/2) W 10 8 = W 2 8 11 W 11 8 = e−j π 4 11 = e−j2π+ 3π 4 W 11 8 = W 3 8 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 49 / 91
  • 50.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Real part of WN 0 8 8 8 .. 1 W W = = = Imaginary part of WN 4 12 8 8 .. 1 W W = = = − 2 10 8 8 .. W W j = = = − 1 9 8 8 .. 1 1 2 2 W W j = = = − 3 11 8 8 .. 1 1 2 2 W W j = = = − − 5 13 8 8 .. 1 1 2 2 W W j = = = − + 6 14 8 8 .. W W j = = = 7 15 8 8 .. 1 1 2 2 W W j = = = + Figure 38: Periodicity of WN and its values Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 50 / 91
  • 51.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Real part of WN 0 4 4 4 8 4 1 W W W = = = 2 6 4 4 10 4 1 W W W = − = = 3 7 11 4 4 4 W j W W = = = 1 5 9 4 4 4 W j W W = − = = Imaginary part of WN Figure 39: Periodicity of WN and its values Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 51 / 91
  • 52.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find Discrete Fourier Transform (DFT) of x(n) = [2 3 4 4] Solution: X(k) = N−1 X n=0 x(n)e−j 2π N nk for k = 0, 1.., N − 1 e−j π 2 = cos π 2 − jsin π 2 = −j e−jπ = cos(π) − jsin(π) = −1 e−j 3π 2 = cos 3π 2 − jsin 3π 2 = j e−j2π = cos(2π) − jsin2(π) = 1 for k=0,1,2,3 X(0) = 3 P n=0 x(n)e0 = 2e0 + 3e0 + 4e0 + 4e0 = [2 + 3 + 4 + 4] = 13 X(1) = 3 P n=0 x(n)e−j 2πn 4 = 2e0 + 3e−jπ/2 + 4e−jπ + 4e−j3π/2 = [2 − 3j − 4 + 4j] = [−2 + j] X(2) = 3 P n=0 x(n)e −j4πn 4 = 2e0 + 3e−jπ + 4e−j2π + 4e−j3π = [2 − 3 + 4 − 4] = [−1 − 0j] = −1 X(3) = 3 P n=0 x(n)e −j6πn 4 = 2e0 + 3e−j3π/2 + 4e−j3π + 4e−j9π/2 = [2 + 3j − 4 − 4j][−2 − j] The DFT of the sequence x(n) = [2 3 4 4] is [13, -2+j, -1, -2-j] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 52 / 91
  • 53.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find Discrete Fourier Transform (DFT) of x(n) = [2 3 4 4] X(k) = N−1 X n=0 x(n)e−j 2π N nk for k = 0, 1.., N − 1 Matlab code for the DFT equation is: clc; clear all; close all xn=[2 3 4 4] N=length(xn); n=0:N-1; k=0:N-1; WN=exp(-1j*2*pi/N); nk=n’*k; WNnk=WN.^nk; Xk=xn*WNnk Matlab code using FFT command clc; clear all; close all xn=[2 3 4 4] y=fft(xn) Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 53 / 91
  • 54.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find DFT for a given a sequence x(n) for 0 ≤ n ≤ 3 where x(0) = 1, x(1) = 2, x(2) = 3, x(3) = 4 Solution: x(n) = [1 2 3 4] for k=0,1,2,3 X(0) = 3 P n=0 x(n)e0 = 4e0 + 2e0 + 3e0 + 4e0 = [1 + 2 + 3 + 4] = 10 X(1) = 3 P n=0 x(n)e−j 2πn 4 = 1e0 + 2e−jπ/2 + 2e−jπ + 4e−j3π/2 = [1 − j2 − 3 + j4] = [−2 + j2] X(2) = 3 P n=0 x(n)e −j4πn 4 = 1e0 + 2e−jπ + 3e−j2π + 4e−j3π = [1 − 2 + 3 − 4] = [−1 − 0j] = −2 X(3) = 3 P n=0 x(n)e −j6πn 4 = 1e0 + 2e−j3π/2 + 3e−j3π + 4e−j9π/2 = [1 + 2j − 3 − 4j][−2 − j2] The DFT of the sequence x(n) = [1 2 3 4] is [10, − 2 + j2, − 2, − 2 − j2] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 54 / 91
  • 55.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find 8 point DFT for a given a sequence x(n) = [1, 1, 1, 1] assume imaginary part is zero. Also calculate magnitude and phase Solution: x(n) = [1 1 1 1] The 8 point DFT is of length 8. Append zeros at the end of the sequence. x(n) = [1 1 1 1 0 0 0 0]            X(0) X(1) X(2) X(3) X(4) X(5) X(6) X(7)            =            1 1 1 1 1 1 1 1 1 W 1 8 W 2 8 W 3 8 W 4 8 W 5 8 W 6 8 W 7 8 1 W 2 8 W 4 8 W 6 8 W 8 8 W 10 8 W 12 8 W 14 8 1 W 3 8 W 6 8 W 9 8 W 12 8 W 15 8 W 18 8 W 21 8 1 W 4 8 W 8 8 W 12 8 W 16 8 W 20 8 W 24 8 W 28 8 1 W 5 8 W 10 8 W 15 8 W 20 8 W 25 8 W 30 8 W 35 8 1 W 6 8 W 12 8 W 18 8 W 24 8 W 30 8 W 36 8 W 42 8 1 W 7 8 W 14 8 W 21 8 W 28 8 W 35 8 W 42 8 W 49 8            =            x(0) x(1) x(2) x(3) x(4) x(5) x(6) x(7)            Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 55 / 91
  • 56.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) W 0 8 = W 8 8 = W 16 8 = W 24 8 = W 40 8 ... = 1 W 1 8 = W 9 8 = W 17 8 = W 25 8 = W 33 8 ... = 1 √ 2 − j 1 √ 2 W 2 8 = W 10 8 = W 18 8 = W 26 8 = W 34 8 ... = −j W 3 8 = W 11 8 = W 19 8 = W 27 8 = W 35 8 ... = − 1 √ 2 − j 1 √ 2 W 4 8 = W 12 8 = W 20 8 = W 28 8 = W 36 8 ... = −1 W 5 8 = W 13 8 = W 21 8 = W 29 8 = W 37 8 ... = − 1 √ 2 + j 1 √ 2 W 6 8 = W 14 8 = W 22 8 = W 30 8 = W 38 8 ... = j W 7 8 = W 15 8 = W 23 8 = W 31 8 = W 39 8 ... = 1 √ 2 + j 1 √ 2            X(0) X(1) X(2) X(3) X(4) X(5) X(6) X(7)            =               1 1 1 1 1 1 1 1 1 1 √ 2 − j 1 √ 2 −j − 1 √ 2 − j 1 √ 2 −1 − 1 √ 2 + j 1 √ 2 j 1 √ 2 + j 1 √ 2 1 −j −1 j 1 −j −1 j 1 − 1 √ 2 − j 1 √ 2 j 1 √ 2 − j 1 √ 2 1 1 √ 2 + j 1 √ 2 −j − 1 √ 2 + j 1 √ 2 1 −1 1 −1 1 −1 1 −1 1 − 1 √ 2 + j 1 √ 2 −j 1 √ 2 + j 1 √ 2 −1 1 √ 2 − j 1 √ 2 j − 1 √ 2 − j 1 √ 2 1 j −1 −j 1 j −1 −j 1 1 √ 2 + j 1 √ 2 j − 1 √ 2 + j 1 √ 2 −1 − 1 √ 2 − j 1 √ 2 −j 1 √ 2 − j 1 √ 2               =            1 1 1 1 0 0 0 0                       4 1 − j(1 + √ 2) 0 1 + j(1 − √ 2) 0 1 − j(1 − √ 2) 0 1 + j(1 + √ 2)            =            XR (0) XR (1) XR (2) XR (3) XR (4) XR (5) XR (6) XR (7)                       4 1 0 1 0 1 0 1            and            XI (0) XI (1) XI (2) XI (3) XI (4) XI (5) XI (6) XI (7)                       0 −(1 + √ 2) 0 (1 − √ 2) 0 −(1 − √ 2) 0 (1 + √ 2)            Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 56 / 91
  • 57.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find DFT for a given a sequence x(n) = [2 3 4 4] Solution:     X(0) X(1) X(2) X(3)     =     1 1 1 1 1 W W 2 W 3 1 W 2 W 4 W 6 1 W 3 W 6 W 9     =     2 3 4 4     WN = e− 2π N = e− 2π 4 = e− π 2 = −j W 2 = −j2 = −1, W 3 = −j3 = j Using the property of periodicity of W W p = W P+r.N = j with basic period N = 4 W 4 = W 4−4 = W 0 = 1, W 6 = W 6−4 = W 2 = −1, W 9 = W 9−2.4 = W 1 = −j     X(0) X(1) X(2) X(3)     =     1 1 1 1 1 −j −1 j 1 −1 1 −1 1 j −1 −j         2 3 4 4     =     13 −2 + j −1 −2 − j     The DFT of the sequence x(n) = [2 3 4 4] is [13, − 2 + j, − 1, − 2 − j] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 57 / 91
  • 58.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find DFT for a given a sequence x(n) = [1 2 3 4] Solution:     X(0) X(1) X(2) X(3)     =     1 1 1 1 1 W W 2 W 3 1 W 2 W 4 W 6 1 W 3 W 6 W 9     =     1 2 3 4     WN = e− 2π N = e− 2π 4 = e− π 2 = −j W 2 = −j2 = −1, W 3 = −j3 = j Using the property of periodicity of W W p = W P+r.N = j with basic period N = 4 W 4 = W 4−4 = W 0 = 1, W 6 = W 6−4 = W 2 = −1, W 9 = W 9−2.4 = W 1 = −j     X(0) X(1) X(2) X(3)     =     1 1 1 1 1 −j −1 j 1 −1 1 −1 1 j −1 −j         1 2 3 4     =     10 −2 + 2j −2 −2 − 2j     The DFT of the sequence x(n) = [1 2 3 4] is [10, − 2 + j2, − 2, − 2 − j2] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 58 / 91
  • 59.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Inverse DFT: Find the IDFT for X(k) = [10, − 2 + j2, − 2, − 2 − j2] x(n) = 1 N N−1 X k=0 X(k)e 2π N kn for n = 0, 1.., N − 1 x(n) = 1 N N−1 X k=0 X(k)W ∗kn for n = 0, 1.., N − 1 where W ∗ = e 2π N x(0) = 1 4 N−1 X k=0 X(k)ej0 = X(0)ej0 + X(1)ej0 + X(2)ej0 + X(3)ej0 = 1 4 (10 + (−2 + j2) − 2 + (−2 − j2)) = 1 x(1) = 1 4 N−1 X k=0 X(k)ej kπ 2 = X(0)ej0 + X(1)ej π 2 + X(2)ejπ + X(3)ej 3π 2 = 1 4 (X(0) + jX(1) − X(2) − jX(3) = 1 4 (10 + j(−2 + j2) − (−2) − j(−2 − j2)) = 2 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 59 / 91
  • 60.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) x(2) = 1 4 N−1 X k=0 X(k)ej kπ 2 = X(0)ej0 + X(1)ejπ + X(2)ej2π + X(3)ej3π = 1 4 (X(0) − X(1) + X(2) − X(3) = 1 4 (10 − (−2 + j2) + (−2) − (−2 − j2)) = 3 x(1) = 1 4 N−1 X k=0 X(k)ej kπ3 2 = X(0)ej0 + X(1)ej 3π 2 + X(2)ej3π + X(3)ej 9π 2 = 1 4 (X(0) − jX(1) − X(2) + jX(3) = 1 4 (10 − j(−2 + j2) − (−2) + j(−2 − j2)) = 4 Matlab command used to calculate the Inverse DFT is ifft x=[10 -2+j2 -2 -2-j2] y=ifft(x) Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 60 / 91
  • 61.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find the Discrete Fourier Transform of the following signal: x(n), n = 0,1,2,3 = [1, 1, -1, -1]. Solution: N=4 The matrix notation is X = T.f where T is matrix of the transform with elements Tkn = W kn N k, n = 0, 1.., N − 1     X(0) X(1) X(2) X(3)     =     1 1 1 1 1 −j −1 j 1 −1 1 −1 1 j −1 −j         1 1 −1 −1     =     0 2 − 2j 0 2 + 2j     The DFT of the sequence x(n) = [1 1 -1 -1] is [0, 2 − j2, 0, 2 + j2] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 61 / 91
  • 62.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find the Inverse Discrete Fourier Transform of the following signal: x(n), n = 0,1,2,3 = [0, 2-2j, 0, 2+2j]. Solution: The IDFT of the discrete signal X(k)is x(n): N = 4 and W4 = e−π/2 x(n) = 1 N N−1 X k=0 X(k)W −kn N for n = 0, 1.., N − 1 where W = e− 2π N N=4 The matrix notation is [WN ] =     1 1 1 1 1 −j −1 j 1 −1 1 −1 1 j −1 −j     [W ∗ N ] =     1 1 1 1 1 j −1 −j 1 −1 1 −1 1 −j −1 j         x(0) x(1) x(2) x(3)     = 1 N     1 1 1 1 1 j −1 −j 1 −1 1 −1 1 −j −1 j         0 2 − 2j 0 2 + 2j     =     1 1 −1 −1     The IDFT of the sequence X(k) = [0, 2 − j2, 0, 2 + j2] is [1 1 -1 -1] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 62 / 91
  • 63.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find DFT for a given a sequence x[0]=1, x[1]=2, x[2]=2, x[3]=1, x[n]=0 otherwise: x = [1,2,2,1] Solution: x(n) = [1 2 2 1] for k=0,1,2,3 X(0) = 3 P n=0 x(n)e0 = 1e0 + 2e0 + 2e0 + 1e0 = [1 + 2 + 2 + 1] = 6 X(1) = 3 P n=0 x(n)e−j 2πn 4 = 1e0 + 2e−jπ/2 + 2e−jπ + 1e−j3π/2 = [1 − j2 − 2 + j1] = [−1 − j1] X(2) = 3 P n=0 x(n)e −j4πn 4 = 1e0 + 2e−jπ + 2e−j2π + 1e−j3π = [1 − 2 + 2 − 1] = [0] = 0 X(3) = 3 P n=0 x(n)e −j6πn 4 = 1e0 + 2e−j3π/2 + 2e−j3π + 1e−j9π/2 = [1 + 2j − 2 − 1j][−1 + j1] The DFT of the sequence x(n) = [1 2 2 1] is [6, − 1 − j1, 0, − 1 + j1] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 63 / 91
  • 64.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find IDFT for a given a sequence X[0]=6, X[1]=-1-j1, X[2]=0, X[3]=-1+j1, X[n]=0 otherwise: x = [6, − 1 − j1, 0, − 1 + j1] Solution: x(n) = [6, − 1 − j1, 0, − 1 + j1] for k=0,1,2,3 X(0) = 1 4 3 P n=0 x(n)e0 = 6e0 + (−1 − j1)e0 + 0e0 + (−1 + j1)e0 = 1 4 [6−1−j1+0−1+j1] = 1 X(1) = 1 4 3 P n=0 x(n)ej 2πn 4 = 6e0 + (−1 − j1)ejπ/2 + 0ejπ + (−1 + j1)ej3π/2 = 1 4 [6 − j + 1 + j + 1] = [2] X(2) = 1 4 3 P n=0 x(n)e j4πn 4 = 6e0 + (−1 − j1)ejπ + 0ej2π + (−1 + j1)ej3π = 1 4 [6 + (−1 − j1)(j) + 0 + (−1 + j)(−j)] = 1 4 [6 − j1 + 1 + 0 + 1 + j] = [2] X(3) = 1 4 3 P n=0 x(n)e −j6πn 4 = 6e0 + (−1 − j1)ej3π/2 + 0ej3π + (−1 + j1)ej9π/2 = 1 4 [6 + (−1 − j1)(−j) + 0 + (−1 + j)(j)] = 1 4 [6 + j1 − 1 + 0 − 1 − j] = [1] The IDFT of the sequence [6, − 1 − j1, 0, − 1 + j1] is x(n) = [1 2 2 1] Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 64 / 91
  • 65.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Continuous Time Fourier Transform (CTFT) X(jω) = ∞ Z −∞ x(t)e−jωt dt x(t) = 1 2π ∞ Z −∞ X(jω)ejωt dω Discrete Time Fourier Transform (DTFT) X(ejω ) = ∞ X −∞ x(n)e−jωn x(n) = 1 2π Z 2π X(ejω )ejωn dω Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 65 / 91
  • 66.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Unit sample δ(n) x(n) = 1 for n = 0 0 for n 6= 0 X(k) = N−1 X x=0 x(n)e−j 2π N nk = N−1 X x=0 x(0)e0 = 1 × 1 = 1 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 66 / 91
  • 67.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find the N Point DFT of x(n) = an for 0 ≤ n ≤ N − 1 X(k) = N−1 X x=0 x(n)e−j 2π N nk = N−1 X x=0 an e−j 2π N nk = N−1 X x=0 (ae−j 2πk N )n X(k) = 1 − aN e−j2πk 1 − ae−j2πk /N Using series expansion N−1 X k=0 ak = aN1 − aN2+1 1 − a ! e−j2πk = 1 X(k) = 1 − aN 1 − ae−j2πk /N x[n] = (0.5)n u[n] 0 ≤ n ≤ 3 X(k) = 1 − (0.5)4 1 − 0.5e−j2πk /4 = 0.9375 1 − 0.5e−jπ/2k Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 67 / 91
  • 68.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find the 4 Point DFT of x(n) = cos( nπ 4 ) Solution: x(0) = cos(0) = 1 x(1) = cos( 1π 4 ) = 0.707 x(2) = cos( 2π 4 ) = 0 x(3) = cos( 3π 4 ) = −0.707     x(0) x(1) x(2) x(3)     = 1 N     1 1 1 1 1 −j −1 j 1 −1 1 −1 1 j −1 −j         1 0.707 0 −0.707     =     1 1 − j1.414 1 1 + j1.414     Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 68 / 91
  • 69.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) If the length of x[n] is N=4, and if its 8-point DFT is: X8[k] k = 0..7 = [5, 3 − √ 2j, 3, 1 − √ 2j, 1, 1 + √ 2j, 3, 3 + √ 2j] , find the 4 point DFT of the signal x[n]. Solution: The samples of Xs [k] are eight equally spaced samples from the frequency spectrum of the signal x[n]: More precisely, they are samples from the spectrum for the following frequencies: ωT = 0, π 4 , π 2 , 3π 4 , π 5π 4 , 3π 2 , 7π 4 With 4-point DFT of x[n] we get 4 samples from the spectrum of x[n]: ωT = 0, π 2 , π, 3π 2 By comparing the two sets of frequencies: X4[0] = X(ej0) = Xs [0] = 5 X4[1] = X(ejπ/2) = Xs [2] = 3 X4[2] = X(ejπ) = Xs [4] = 1 X4[3] = X(ej3π/2) = Xs [6] = 3 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 69 / 91
  • 70.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find the Fourier Transform of the sequence x[n] = 1 0 ≤ n ≤ 4 0 else X ejw = ∞ X n=−∞ x [n] e−jwn X ejω = e−j2ω sin (5ω/2) sin (ω/2) Consider a causal sequence x[n] where; x[n] = (0.5)n u[n] Its DTFT X ejw can be obtained as X ejw = ∞ X n=−∞ (0.5)n u[n]e−jwn = ∞ X n=0 (0.5)n (1)e−jwn = ∞ X n=0 0.5ejw n = 1 1 − 0.5e−jw Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 70 / 91
  • 71.
    Discrete Fourier Transform(DFT) Discrete Fourier Transform (DFT) Find the N Point DFT of x(n) = 4 + cos2(2πn N ) Solution: x(0) = 4 + cos2(0) = 5 x(1) = 4 + cos2(2π1 10 ) = 4.6545 x(2) = 4 + cos2(2π2 10 ) = 4.09549 x(3) = 4 + cos2(2π3 10 ) = 4.09549 x(4) = 4 + cos2(2π4 10 ) = 4.09549 x(5) = 4 + cos2(2π5 10 ) = 5 x(6) = 4 + cos2(2π6 10 ) = 4.6545 x(7) = 4 + cos2(2π7 10 ) = 4.09549 x(8) = 4 + cos2(2π8 10 ) = 4.09549 x(9) = 4 + cos2(2π9 10 ) = 4.6545 x(n) = x(N − n) Cosine function is even function x(n) = x(−n) X(k) = N−1 X n=0 x(n)cos 2πkn N 0 ≤ k ≤ N − 1 X(k) = N−1 X n=0 4 + cos2 ( 2πn N ) cos 2πkn N 0 ≤ k ≤ N − 1 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 71 / 91
  • 72.
    Relationship of theDFT to other Transforms Relationship of the DFT to other Transforms Relationship of the DFT to other Transforms Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 72 / 91
  • 73.
    Relationship of theDFT to other Transforms Relationship of the DFT to other Transforms Relationship to the Fourier series coefficients of periodic sequence DFT expression is X(k) = N−1 X n=0 x(n)e−j2πkn/N k = 0, 1, . . . N − 1 (1) IDFT expression is x(n) = 1 N N−1 X k=0 X(k)ej2πkn/N n = 0, 1, · · · N − 1 (2) Fourier series is xp(n) = N−1 X k=0 ck ej 2π N nk − ∞ ≤ n ≤ ∞ (3) Fourier series coefficients are expressed as: ck = 1 N N−1 X k=0 xp(n)e−j 2π N nk k = 0, 1.., N − 1 (4) By comparing X(k) and ck fourier series coefficients has the form of a DFT. x(n) = xp(n) 0 ≤ n ≤ N − 1 X(k) = Nck 0 ≤ n ≤ N − 1 Fourier series has the form of an IDFT Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 73 / 91
  • 74.
    Relationship of theDFT to other Transforms Relationship of the DFT to other Transforms Relationship to the Fourier transform of an aperiodic sequence (DFT and DTFT) Fourier transform X(ω) X(ω) = ∞ X n=−∞ x(n)−jωn − ∞ ≤ n ≤ ∞ (5) X(k) = X(ω|ω=2πk/N ) = ∞ X n=−∞ x(n)−j 2π N nk − ∞ ≤ n ≤ ∞ (6) DFT coefficients are expressed as: xp(n) = ∞ X n=−∞ x(n − lN) (7) xp(n) is determined by aliasing x(n) over the interval 0 ≤ n ≤ N − 1. The finite duration sequence x̂(n) = xp(n) 0 ≤ n ≤ N − 1 0 Otherwise The relation between x̂(n) and x(n) exist when x(n) is of finite duration x(n) = x̂(n) 0 ≤ n ≤ N − 1 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 74 / 91
  • 75.
    Relationship of theDFT to other Transforms Relationship of the DFT to other Transforms Relationship to the Z Transform Z transform of the sequence x(n) is X(z) = ∞ X n=−∞ x(n)z−n (8) Sample X(z) at N equally spaced points on the unit circle. These points will be Zk = ej2πk/N k = 0, 1, · · · N − 1 (9) X(z)|zk = ej2πk/N = ∞ X n=−∞ x(n)e−j2πkn/N (10) If x(n) is causal and has N number of samples then X(z)|zk = ej2πk/N = ∞ X n=0 x(n)e−j2πkn/N (11) This is equivalent to DFT X(k) X(k) = X(z)|zk = ej2πk/N (12) Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 75 / 91
  • 76.
    Relationship of theDFT to other Transforms Relationship of the DFT to other Transforms Parseval’s Theorem Consider a sequence x(n) and y(n) x(n) DFT ↔ X(k) y(n) DFT ↔ Y (k) N−1 X n=0 x(n)y∗ (n) = 1 N N−1 X k=0 X(k)Y ∗ (k) (13) When x(n)=y(n) N−1 X n=0 |x(n)|2 = 1 N N−1 X k=0 |X(k)|2 (14) This equation give the energy of finite duration sequence it terms of its frequency components Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 76 / 91
  • 77.
    Problems and Solutionson DFT Problems and Solutions on DFT Determine the DFT of the sequence for N=8, h(n) = 1 2 − 2 ≤ n ≤ 2 0 otherwise Plot the magnitude and phase response for N=8 Solution: h(n) =      1 2 , 1 2 , 1 2 ↑ , 1 2 , 1 2      Consider a sequence x(n) and its DFT is x(n) DFT ↔ X(k) xp(n) DFT ↔ X(k) where xp(n) is the periodic sequence of x(n) in this example x(n) is of h(n) and is of h(n) =      1 2 , 1 2 , 1 2 ↑ , 1 2 , 1 2      There are 5 samples in h(n) append 3 zeros to the right side of the sequence h(n) h(n) =      1 2 , 1 2 , 1 2 ↑ , 1 2 , 1 2 , 0, 0, 0      Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 77 / 91
  • 78.
    Problems and Solutionson DFT Problems and Solutions on DFT The DFT of h(n) and hp(n) is h(n) DFT ↔ H(k) hp(n) DFT ↔ H(k) n -10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 These are new sequences x(n) ( ) p h n -2 -1 0 1 2 3 4 5 n ( ) h n 1 2 Figure 40: Plot of h(n) and hp(n) The value of h(n) from the Figure is represented as h(n) = hp(n) 0 ≤ n ≤ N − 1 0 Otherwise Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 78 / 91
  • 79.
    Problems and Solutionson DFT Problems and Solutions on DFT The new sequence h(n) from hp(n) is h(n) =      1 2 ↑ , 1 2 , 1 2 , 0, 0, 0, 1 2 , 1 2                 X(0) X(1) X(2) X(3) X(4) X(5) X(6) X(7)            =            1 1 1 1 1 1 1 1 1 W 1 8 W 2 8 W 3 8 W 4 8 W 5 8 W 6 8 W 7 8 1 W 2 8 W 4 8 W 6 8 W 8 8 W 10 8 W 12 8 W 14 8 1 W 3 8 W 6 8 W 9 8 W 12 8 W 15 8 W 18 8 W 21 8 1 W 4 8 W 8 8 W 12 8 W 16 8 W 20 8 W 24 8 W 28 8 1 W 5 8 W 10 8 W 15 8 W 20 8 W 25 8 W 30 8 W 35 8 1 W 6 8 W 12 8 W 18 8 W 24 8 W 30 8 W 36 8 W 42 8 1 W 7 8 W 14 8 W 21 8 W 28 8 W 35 8 W 42 8 W 49 8            =            x(0) x(1) x(2) x(3) x(4) x(5) x(6) x(7)            Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 79 / 91
  • 80.
    Problems and Solutionson DFT Problems and Solutions on DFT W 0 8 = W 8 8 = W 16 8 = W 24 8 = W 40 8 ... = 1 W 1 8 = W 9 8 = W 17 8 = W 25 8 = W 33 8 ... = 1 √ 2 − j 1 √ 2 W 2 8 = W 10 8 = W 18 8 = W 26 8 = W 34 8 ... = −j W 3 8 = W 11 8 = W 19 8 = W 27 8 = W 35 8 ... = − 1 √ 2 − j 1 √ 2 W 4 8 = W 12 8 = W 20 8 = W 28 8 = W 36 8 ... = −1 W 5 8 = W 13 8 = W 21 8 = W 29 8 = W 37 8 ... = − 1 √ 2 + j 1 √ 2 W 6 8 = W 14 8 = W 22 8 = W 30 8 = W 38 8 ... = j W 7 8 = W 15 8 = W 23 8 = W 31 8 = W 39 8 ... = 1 √ 2 + j 1 √ 2 |H(k)| Magnitude 0 1 2 3 4 5 6 7 k 0 .5 1 1.5 2 2.5 0 1 2 3 4 5 6 7 k -180 180 -90 90 Phase of H(k)            X(0) X(1) X(2) X(3) X(4) X(5) X(6) X(7)            =               1 1 1 1 1 1 1 1 1 1 √ 2 − j 1 √ 2 −j − 1 √ 2 − j 1 √ 2 −1 − 1 √ 2 + j 1 √ 2 j 1 √ 2 + j 1 √ 2 1 −j −1 j 1 −j −1 j 1 − 1 √ 2 − j 1 √ 2 j 1 √ 2 − j 1 √ 2 1 1 √ 2 + j 1 √ 2 −j − 1 √ 2 + j 1 √ 2 1 −1 1 −1 1 −1 1 −1 1 − 1 √ 2 + j 1 √ 2 −j 1 √ 2 + j 1 √ 2 −1 1 √ 2 − j 1 √ 2 j − 1 √ 2 − j 1 √ 2 1 j −1 −j 1 j −1 −j 1 1 √ 2 + j 1 √ 2 j − 1 √ 2 + j 1 √ 2 −1 − 1 √ 2 − j 1 √ 2 −j 1 √ 2 − j 1 √ 2               =             1 2 1 2 1 2 0 0 0 1 2 1 2                        2.5 1.207 −0.5 −0.207 0.5 −0.207 −0.5 1.207            =            2.5∠0 1.207∠0 0.5∠ − 180 0.207∠ − 180 0.5∠0 0.207∠ − 180 0.5∠ − 180 1.207∠0            Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 80 / 91
  • 81.
    Problems and Solutionson DFT Problems and Solutions on DFT The unit sample response of the first order recursive filter is given as h(n) = anu(n) i) Determine the Fourier transform H(ω) ii) DFT H(k) of h(n) iii) Relationship between H(ω) and H(k) H(ω) = ∞ X n=−∞ h(n)e−jωn = ∞ X n=−∞ an u(n)e−jωn = ∞ X n=0 (ae−jω)n ∵ u(n) = 0 for n 0 N−1 X k=0 ak = ( N for a = 1 1−aN 1−a for a 6= 1 H(ω) = (ae−jω)0 − (ae−jω)∞+1 1 − ae−jω = 1 1 − ae−jω Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 81 / 91
  • 82.
    Problems and Solutionson DFT Problems and Solutions on DFT The DFT of h(n) and hp(n) is h(n) DFT ↔ H(k) hp(n) DFT ↔ H(k) where hp(n) is related as hp(n) = ∞ X l=−∞ h(n − lN) Consider l=-p hp(n) = −∞ X l=∞ h(n + pN) hp(n) = ∞ X l=−∞ h(n + pN) N point DFT H(k) in terms of hp(n) is H(k) = N−1 X n=0 h(n)e−j 2π N kn H(k) = N−1 X n=0   ∞ X n=−∞ h(n + pN)   e−j 2π N kn Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 82 / 91
  • 83.
    Problems and Solutionson DFT Problems and Solutions on DFT H(k) = N−1 X n=0   ∞ X n=−∞ a(n+pN) u(n + pN)   e−j 2π N kn = N−1 X n=0 ∞ X n=0 a(n+pN) # e−j 2π N kn ∵ u(n) = 0 for n 0 = N−1 X n=0 ∞ X n=0 an apN # e−j 2π N kn Interchanging the summations H(k) = ∞ X n=0 apN N−1 X n=0 an e−j 2π N kn N X k=0 ak = 1 − aN 1 − a ∞ X p=0 apN = ∞ X p=0 aNp = 1 − (aN )∞+1 1 − aN = 1 1 − aN Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 83 / 91
  • 84.
    Problems and Solutionson DFT Problems and Solutions on DFT N−1 X n=0 an e−j 2π N kn = N−1 X n=0 (ae−j 2π N k)n = (ae−j2πk/N )0 − (ae−j2πk/N )N 1 − (ae−j2πk/N ) N−1 X n=0 (ae−j 2π N k)n = 1 − aN e−j2πk 1 − (ae−j2πk/N ) = 1 − aN 1 − (ae−j2πk/N ) ∵ e−j2πk = 1 H(k) = 1 1 − aN 1 − aN 1 − (ae−j2πk/N ) = 1 1 − (ae−j2πk/N ) H(ω) = = 1 1 − ae−jω and H(k) = 1 1 − (ae−j2πk/N ) H(k) = H(ω)|ω=2πk/N Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 84 / 91
  • 85.
    Problems and Solutionson DFT Problems and Solutions on DFT Compute the DFT of the following finite length sequence of length N x(n) = u(n) − u(n − N) u(n) 0 1 2 3 4 N-3 N-2 N-1 N N+1 N+2 … n Unit step sequence u(n) u(n-N) 0 1 2 3 4 N-3 N-2 N-1 N N+1 N+2 … n Unit step sequence delayed by N samples x(n)=u(n)-u(n-N) 0 1 2 3 4 N-3 N-2 N-1 N N+1 N+2 … n Subtraction of u(n-N) from u(n) Figure 41: Generation of x(n) = u(n) − u(n − N) The value of x(n) as shown in Figure is represented as x(n) = 1 0 ≤ n ≤ N − 1 0 Otherwise Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 85 / 91
  • 86.
    Problems and Solutionson DFT Problems and Solutions on DFT DFT expression is X(k) = N−1 X n=0 x(n)e−j2πkn/N k = 0, 1, . . . N − 1 = N−1 X n=0 1e−j2πkn/N = N−1 X n=0 (e−j2πk/N )n (1) N−1 X k=0 ak = 1 − aN 1 − a # X(k) = 1 − e−j2πk e−j2πk/N = 1 − 1 e−j2πk/N = 0 When k=0 From the expression (1) X(k) = N−1 X n=0 (1)n = N X(k) = 0 when k 6= 0 N when k = 0 X(k) = Nδ(k) Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 86 / 91
  • 87.
    Problems and Solutionson DFT Problems and Solutions on DFT If x(n)=[1,2,0,3,-2, 4,7,5] evaluate the following i) X(0) ii) X(4) iii) 7 P k=0 X(k) iv) 7 P k=0 |X(k)|2 X(0) is X(k) = N−1 X n=0 x(n)e−j2πkn/N with k=0 and N=8 X(0) = N−1 X n=0 x(n) = 1 + 2 + 0 + 3 − 2 + 4 + 7 + 5 = 20 X(4) is X(k) = N−1 X n=0 x(n)e−j2πkn/N with k=4 and N=8 X(4) = N−1 X n=0 x(n)e−j2π4n/8 = N−1 X n=0 x(n)e−jπn = N−1 X n=0 x(n)(−1)n X(4) == 1 − 2 + 0 − 3 − 2 − 4 + 7 − 5 = −8 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 87 / 91
  • 88.
    Problems and Solutionson DFT Problems and Solutions on DFT iii) 7 P k=0 X(k) We Know the IDFT expression as x(n) = 1 N N−1 X n=0 X(k)ej2πkn/N With n=0 and N=8 it becomes x(0) = 1 8 N−1 X n=0 X(k) ∴ N−1 X n=0 X(k) = 8x(0) = 8 × 1 = 8 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 88 / 91
  • 89.
    Problems and Solutionson DFT Problems and Solutions on DFT The value of 7 P k=0 |X(k)|2 is The expression for Parseval’s theorem is N−1 X n=0 |x(n)|2 = 1 N N−1 X k=0 |X(k)|2 7 P k=0 |X(k)|2is related as N−1 X n=0 |x(n)|2 = 1 N N−1 X k=0 |X(k)|2 N=8 Then 7 X n=0 |x(n)|2 = 1 8 7 X k=0 |X(k)|2 7 X k=0 |X(k)|2 = 8 7 X n=0 |x(n)|2 = 8[1 + 4 + 0 + 9 − 4 + 4 + 49 + 25] = 864 Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 89 / 91
  • 90.
    Thank You Dr. Manjunatha.P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 90 / 91
  • 91.
    References J. G. Proakisand D. G. Monalakis, Digital signal processing Principles Algorithms Applications, 4th ed. Pearson education, 2007. Oppenheim and Schaffer, Discrete Time Signal Processing. Pearson education, Prentice Hall, 2003. S. K. Mitra, Digital Signal Processing. Tata Mc-Graw Hill, 2004. L. Tan, Digital Signal Processing. Elsivier publications, 2007. J. S. Chitode, Digital signal processing. Technical Pulications. B. Forouzan, Data Communication and Networking, 4th ed. McGraw-Hill, 2006. Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, 5] September 11, 2014 91 / 91