0% found this document useful (0 votes)
294 views

Discrete Fourier Transform

This document discusses discrete Fourier transforms and contains the following information: 1) It provides an introduction to discrete Fourier transforms including definitions of continuous and discrete time sinusoidal signals, the concepts of frequency, period, and periodic versus aperiodic signals. 2) It explains that periodic signals can be represented by a Fourier series as a sum of sinusoids with different frequencies, while non-periodic signals can be represented by the Fourier transform. 3) The document is intended for use in a classroom and covers topics related to digital signal processing as outlined in a syllabus for a course on the subject for an engineering program.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
294 views

Discrete Fourier Transform

This document discusses discrete Fourier transforms and contains the following information: 1) It provides an introduction to discrete Fourier transforms including definitions of continuous and discrete time sinusoidal signals, the concepts of frequency, period, and periodic versus aperiodic signals. 2) It explains that periodic signals can be represented by a Fourier series as a sum of sinusoids with different frequencies, while non-periodic signals can be represented by the Fourier transform. 3) The document is intended for use in a classroom and covers topics related to digital signal processing as outlined in a syllabus for a course on the subject for an engineering program.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 91

UNIT - 1: Discrete Fourier Transforms

(DFT)[1, 2, 3, 4, 5]

Dr. Manjunatha. P
[email protected]

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, September
5] 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, September


5] 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, September
5] 11, 2014 4 / 91
Introduction The concept of frequency in continuous and discrete time signals

Complex exponential signals


xa (t) = Ae j(Ωt+θ)
where
e ±jφ = cosφ ± jsinφ

A j(Ωt+θ) A
xa (t) = Acos(Ωt + θ) = e + e −j(Ωt+θ)
2 2
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, September


5] 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, September


5] 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, September
5] 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 8: Periodic discrete time

Figure 7: Periodic discrete time signal

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, September


5] 11, 2014 8 / 91
Introduction Discrete Time Sinusoidal Signals

Periodic and aperiodic (non-periodic) signals.

Figure 10: Aperiodic discrete time


Figure 9: Aperiodic signals signals

Figure 11: Aperiodic discrete time signals


Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4, September
5] 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,September


5] 11, 2014 10 / 91
Fourier series

Fourier series

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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,September
5] 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.


X ∞
X
f (θ) = a0 + an cos(nθ) + bn sin(nθ)
n=1 n=1

where
Z2π
1
a0 = f (θ)dθ

0
Z2π
1
an = f (θ)cos(nθ)dθ
π
0
Z2π
1
bn = f (θ)sin(nθ)dθ
π
0

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,September
5] 11, 2014 13 / 91
Fourier series Fourier series

 
 

   

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 14 / 91
Fourier series Fourier series

Figure 15: Square Wave


1
Z 2π
an = f (θ) cos nθdθ

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

sin nθ π

1

sin nθ 2π

= −A + A =0
π n 0 π n π

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

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 15 / 91
Fourier series Fourier series

1
Z 2π
bn = f (θ) sin nθdθ
π 0
1
Z π Z 2π 
= A sin nθdθ + (−A) sin nθdθ
π 0 π
cos nθ π cos nθ 2π
   
1 1
= −A + A
π n 0 π n π
A
= [− cos nπ + cos 0 + cos 2nπ − cos nπ]

A
= [1 + 1 + 1 + 1]

4A
= when n is odd

A
bn = [− cos nπ + cos 0 + cos 2nπ − cos nπ]

A
= [−1 + 1 + 1 − 1]

= 0 when n is even
 
4A 1 1 1
sin θ + sin 3θ + sin 5θ + sin 7θ + · · ·
π 3 5 7

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 16 / 91
Fourier series Fourier series

 
4A 1 1 1
sin θ + sin 3θ + sin 5θ + sin 7θ + · · ·
π 3 5 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,September


5] 11, 2014 17 / 91
Fourier series Fourier series

Fundamental sinusoidal signal


1

0.5

sin(θ)
0

−0.5

clc;clear all; close all; −1


0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05

f=100;%Fundamental frequency 100 Hz θ


Reconstructed square wave by Fourier
1
t=0:.00001:.05; 0.5

xsin = sin(2*pi*f*t);

f (θ)
0

x1 = sin(2*pi*f*t); −0.5

−1
x3 = (1/3)*sin(3*2*pi*f*t); 0 0.005 0.01 0.015 0.02 0.025
θ
0.03 0.035 0.04 0.045 0.05

x5 = (1/5)*sin(5*2*pi*f*t);
x7 = (1/7)*sin(7*2*pi*f*t); Figure 18: Square Wave
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 ’)

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 18 / 91
 
Fourier series Fourier series

t when − T4 ≤ t ≤ T4

f (t) =
−t + T2 when T4 ≤ t ≤ 3T
4

Figure 19: Triangular Wave

2
Z T
2πn

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

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

2πn 2πn
 
= t sin T
t dt + −t + sin T
t dt
T 0 T 0 2
"  2 #
4 T πn

= 2 sin 2
T 2πn
2T
sin πn

= 2
2π 2 n2
= 0 when n is even
       
2T 2π 1 6π 1 10π
sin t − sin t + sin t − · · ·
π2 T 32 T 52 T
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September
5] 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,September


5] 11, 2014 20 / 91
Fourier series Fourier series

The Exponential (Complex) Form of Fourier Series


X ∞
X
f (θ) = a0 + an cos nθ + bn sin nθ
n=1 n=1

e jθ + e −jθ e jθ − e −jθ
cosθ = sinθ =
2 2j

an cos nθ + bn sin nθ =

e jnθ + e −jnθ e jnθ − e −jnθ


= an + bn
2 2j
e jnθ + e −jnθ e jnθ − e −jnθ
= an − jbn
2 2
   
an − jbn an + jbn
= jnθ
e + e −jnθ
2 2

   
an − jbn an + jbn
let cn = c−n =
2 2

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 21 / 91
Fourier series Fourier series

an cos nθ + bn sin nθ = cn e jnθ + c−n e −jnθ


In exponential Fourier series only one
integral has to be calculated and it is
∞   simpler integration.
X
f (θ) = c0 + cn e jnθ + c−n e −jnθ
n=1

X
= cn e jnθ
n=−∞

where
 
an − jbn
cn =
2

The coefficient cn can be evaluated as.


Z π Z π
1 j
cn = f (θ) cos nθdθ − f (θ) sin nθdθ
2π −π 2π −π
Z π
1
= f (θ) (cos nθ − j sin nθ)dθ
2π −π
Z π
1
= f (θ)e −jnθ dθ
2π −π
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September
5] 11, 2014 22 / 91
Fourier series Fourier series
 

 
 

Figure 22: Square Wave[6] Figure 23: Sawtooth Signal[6]


 

   

Find the
e frequency
y componen nts of a siggnal buried
d in noise. Consider data
d sample ed at
1000 Hzz. Form a signal consissting of 50 Hz and 1200 Hz sinusooids and co
orrupt the signal
s
Example with random noise.

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)
>> 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');

 
    

Figure 24: Square Wave[6] Figure 25: Sawtooth Signal[6]

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 23 / 91
Fourier series Fourier series

 
5
 
4
 3

 2
1
 
0
  0
-1 200 400 600
0 800 1000 1200 14
400
-2
 
-3
-4
 
-5
 

Figure 27: Sawtooth Signal[6]

Figure 26: Square Wave[6]

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 24 / 91
Fourier Transform

Fourier Transform

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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,September


5] 11, 2014 26 / 91
Fourier Transform Fourier Transform


X when θ = π
f (θ) = cn e jnθ
n=−∞ 2πt T
π= ⇒ t=
T 2
where

1
Z π
cn = f (θ)e −jnθ dθ ∞
2π −π
X
f (t) = cn e jnωt
n=−∞

θ = ωt
ω is the angular velocity in radians per
1
Z T /2
second.
cn = f (t)e −jnωt dt
T −T /2
ω = 2πf and θ = 2πft

2π 2π
θ= t and dθ = dt
T T
when θ = −π

2πt T
−π = ⇒ t=−
T 2

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 27 / 91
Fourier Transform Fourier Transform

Relationship from Fourier series to Fourier Transform


 
∞ Z T /2
∞ 1  X −jωt  jωt
f (t) = f (t)e dt e ∆ω
X
f (t) = cn e jnωt 2π ω=−∞ −T /2
n=−∞

P R
T ⇒ ∞ ∆ω ⇒ dω and ⇒
1
Z T /2
cn = f (t)e −jnωt dt
T 1
Z ∞ Z ∞ 
−T /2
f (t) = f (t)e(−jωt) dt e(jωt) dω
2 −∞ −∞
As T approaches infinity
ω approaches zero
and n becomes meaningless 1
Z ∞
nω ⇒ ω ω ⇒ ∆ω f (t) = F (ω)e(jωt) dω
2π 2 −∞
T ⇒ ∆ω

ω
Z ∞

f (t) =
X
cω e jωt F (ω) = f (t)e(−jωt) dt
−∞
n=−ω

∆ω
Z T /2
cω = f (t)e −jωt dt
2π −T /2

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 28 / 91
Fourier Transform Fourier Transform

Figure 28: Rectangular Pulse  

Figure 29: Sinc Function

Z1/2
1 1/2
F (ω) = exp(−jωt)dt = [exp(−jωt)]−1/2
−jω
−1/2
1
= [exp(−jω/2) − exp(jω/2)]
−jω
1 exp(jω/2) − exp(−jω/2)
=
(ω/2) 2j
sin(ω/2)
=
(ω/2)
sinx
= sinc(ω/2) since it is form
x

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 29 / 91
Fourier Transform Fourier Transform

Figure 30: Exponential


 
Figure 31: Gaussian

Z∞
F (ω) = exp( − at) exp(−jωt)dt
0
Z∞ Z∞
= exp(−at − jωt)dt = exp(−[a + jω]t)dt
0 0
−1 −1
= exp(−[a + jω]t)|+∞
0 = [exp(−∞) − exp(0)]
a + jω a + jω
−1
= [0 − 1]
a + jω
1
=
a + jω

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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,September


5] 11, 2014 31 / 91
Fourier Transform Fourier Transform

Z∞
F {exp(iω0 t)} = 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,September


5] 11, 2014 32 / 91
Fourier Transform Fourier Transform

Z∞
F {cos(ω0 t)} = cos(ω0 t) exp(−j ω t) dt
−∞
Z∞
1
= [exp(j ω0 t) + exp(−j ω0 t)] exp(−j ω t) dt
2
−∞
Z∞ Z∞
1 1
= exp(−j [ω − ω0 ] t) dt + exp(−j [ω + ω0 ] t) dt
2 2
−∞ −∞
= π δ(ω − ω0 ) + π δ(ω + ω0 )

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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,September


5] 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,September


5] 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,September


5] 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,September


5] 11, 2014 37 / 91
Discrete Fourier Transform (DFT) Summary of FS and FT

Fourier Series is

X ∞
X
x(θ) = a0 + an cos(nθ) + bn sin(nθ)
n=1 n=1


1
R
where a0 = 2π
x(θ)dθ
0

Z2π Z2π
1 1
an = x(θ)cos(nθ)dθ bn = x(θ)sin(nθ)dθ
π π
0 0

The Exponential (Complex) Form


∞ Z π
X 1
x (θ) = cn e jnθ where cn = x(θ)e −jnθ dθ
n=−∞
2π −π

∞ Z T /2
X 1
x(t) = cn e jnωt where cn = x(t)e −jnωt dt
n=−∞
T −T /2

Fourier Transform pair is


Z ∞ 1
Z ∞
X (ω) = f (t)e (−ωt) dt and x(t) = X (ω)e (jωt) dω
−∞ 2 −∞

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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,September


5] 11, 2014 39 / 91
Discrete Fourier Transform (DFT) Summary of FS and FT

The Fourier Series for Continuous time Periodic Signals



ck e j2πnft
P
Synthesis Equation x(t) =
k=−∞

1
x(t)e −j2πnft dt
R
Analysis Equation cn = T
−∞

The Fourier Transform for Continuous Time Aperiodic Signals



X (F )e j2πFt dF
R
Synthesis Equation (Inverse transform) x(t) =
−∞

x(t)e −j2πFt dt
R
Analysis Equation (Direct transform) X (F ) =
−∞

The Fourier Series for Discrete time Periodic Signals


N−1
ck e j2πkn/N
P
Synthesis Equation x(n) =
k=0
N−1
1
x(n)e −j2πkn/N
P
Analysis Equation ck = N
n=0

The Fourier Transform of Discrete Time Aperiodic Signals



1
X (F )e j2πF1 t dF
R
Synthesis Equation (Inverse transform) x(n) = 2π
−∞

x(n)e −j2πkn/N
P
Analysis Equation (Direct transform) X (ω) =
n=−∞

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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.

Signal
Amplitude

Amplitude
Signal Spectrum

Time Frequency

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,September


5] 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 (ω) = x(n)e −jωn
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,September


5] 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,September


5] 11, 2014 43 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Now consider ω = 2πk/N


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

  −1 N−1
2π X X
X k = ··· + x(n)e −j2πkn/N + x(n)e −j2πkn/N
N n=−N n=0
2N−1
X
+ x(n)e −j2πkn/N + · · ·
n=N

X lN+N−1
X
= x(n)e −j2πkn/N
n=−∞ n=lN

By changing the index in the inner summation from n to n − lN and interchanging the
order of summation
 
  N−1 ∞
2π X X 2π
X k =  x(n − lN) e −j N k(n−lN)
N n=0 n=−∞
 
N−1 ∞
X X 2π
=  x(n − lN) e −j N kn e −j2πkl
n=0 n=−∞

e −j2πkl = 1 ∵ both k and l integers


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

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


X
Let xp (n) = x(n − lN)
n=−∞

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

N−1
X
xp (n) = ck e j2πkn/N n = 0, 1, · · · N − 1
k=0

where ck is the fourier coefficients expressed as

N−1
1 X
ck = xp (n)e −j2πkn/N k = 0, 1, · · · N − 1
N n=0

Upon comparing
 
1 2π
ck = X k k = 0, 1, · · · N − 1
N N

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 45 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

N−1  
1 X 2π
xp (n) = X k e j2πkn/N n = 0, 1, · · · N − 1
N k=0 N

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

x(n) 0≤n ≤L−1
xp (n) =
0 L≤n ≤N −1

For the finite duration sequence of length L the Fourier transform is:
L−1
X
X (ω) = x(n)e −jωn 0 ≤ ω ≤ 2π
n=0

When X (ω) is sampled at frequencies ωk = 2πk/N k = 0, 1, 2, . . . N − 1 then


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

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,September
5] 11, 2014 46 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

DFT and IDFT expressions are


DFT expressions is

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

IDFT expressions is

N−1  
1 X 2π
xp (n) = X k e j2πkn/N n = 0, 1, · · · N − 1
N k=0 N

If xp (n) is evaluated for n = 0, 1, 2 . . . N − 1 then xp (n) = x(n)

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

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 47 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

DFT as a Linear Transformation

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

Let

WN = e −j N is called twiddle factor

N−1
X
X (k) = x(n)WNnk for k = 0, 1.., N − 1
x=0

 
1 1 1 1 ... 1
X (0) x(0)
   
 1 W W2 W3 ... W N−1 
X (1)     x(1)
1 W2 W2 W4 ... W 2(N−1)
 
   
X (2) x(2)
 
   
= W3 W6 W9 W 3(N−1) .
 
1 ...
. ..
 
   
..
 
  .  
.
..
   
x(N − 1)
 
X (3)
1 W N−1 W N−2 W N−3 ... W (N−1)(N−1)

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 48 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Periodicity property of WN

WN = e −j N

Let us consider for N=8


2π π
W8 = e −j 8 1 = e −j 4

π
kn W8kn = e − 4 kn Result
0 W80 = e 0 Magnitude 1 Phase 0
π π
1 W81 = e −j 4 1 = e −j 4 Magnitude 1 Phase −π/4
2 −j π 2 −j π
2 W8 = e 4 = e 2 Magnitude 1 Phase −π/2
−j π 3 −j3 π
3 3
W8 = e 4 = e 4 Magnitude 1 Phase −3 π4
4 −j π 4 −jπ
4 W8 = e 4 = e Magnitude 1 Phase −π
π π
5 W85 = e −j 4 5 = e −j3 5 Magnitude 1 Phase −5π/4
π π
6 W86 = e −j 4 6 = e −j3 2 Magnitude 1 Phase −3π/2
7 −j π 7 −j7 π
7 W8 = e 4 = e 4 Magnitude 1 Phase −7π/4
8 −j π 8 −j2π
8 W8 = e 4 = e Magnitude 1 Phase −2π W88 = W80
π π
9 W89 = e −j 4 9 = e −j(2π+ 4 ) Magnitude 1 Phase (−2π + π/4) W89 = W81
π π
10 W810 = e −j 4 10 = e −j(2π 2 ) Magnitude 1 Phase (−2π +π/2) W810 = W82
π 3π
11 W811 = e −j 4 11 = e −j2π+ 4 W811 = W83

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 49 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Imaginary
part of WN
W85 = W813 = .. W86 = W814 = .. = j
1 1
=− +j W87 = W815 = ..
2 2
1 1
= +j
2 2

Real part
W84 = W812 = .. of WN
W80 = W88 = .. = 1
= −1

W83 = W811 = ..
W81 = W89 = ..
1 1
=− −j 1 1
2 2 W82 = W810 = .. = − j = −j
2 2

Figure 38: Periodicity of WN and its values

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 50 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Imaginary
part of WN
W43 = j = W47 = W411

Real part
W42 = −1 = W46 W40 = 1 = W44 of WN

= W410 = W48

W41 = − j = W45 = W49

Figure 39: Periodicity of WN and its values

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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:

N−1
X 2π nk
X (k) = x(n)e −j N for k = 0, 1.., N − 1
n=0

π π π
e −j 2 = cos − jsin = −j e −jπ = cos(π) − jsin(π) = −1
2 2
3π 3π 3π
e −j 2 = cos − jsin =j e −j2π = cos(2π) − jsin2(π) = 1
2 2

for k=0,1,2,3
3
x(n)e 0 = 2e 0 + 3e 0 + 4e 0 + 4e 0 = [2 + 3 + 4 + 4] = 13
P  
X (0) =
n=0
3 2πn
x(n)e −j = 2e 0 + 3e −jπ/2 + 4e −jπ + 4e −j3π/2 = [2 − 3j − 4 + 4j] = [−2 + j]
P  
X (1) = 4
n=0
3 −j4πn
= 2e 0 + 3e −jπ + 4e −j2π + 4e −j3π = [2 − 3 + 4 − 4] = [−1 − 0j] = −1
P  
X (2) = x(n)e 4
n=0
3 −j6πn
= 2e 0 + 3e −j3π/2 + 4e −j3π + 4e −j9π/2 = [2 + 3j − 4 − 4j][−2 − j]
P  
X (3) = x(n)e 4
n=0
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,September


5] 11, 2014 52 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Find Discrete Fourier Transform (DFT) of x(n) = [2 3 4 4]

N−1
X 2π nk
X (k) = x(n)e −j N for k = 0, 1.., N − 1
n=0

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,September


5] 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
3
x(n)e 0 = 4e 0 + 2e 0 + 3e 0 + 4e 0 = [1 + 2 + 3 + 4] = 10
P  
X (0) =
n=0
3 2πn
x(n)e −j = 1e 0 + 2e −jπ/2 + 2e −jπ + 4e −j3π/2 = [1 − j2 − 3 + j4] = [−2 + j2]
P  
X (1) = 4
n=0
3 −j4πn
= 1e 0 + 2e −jπ + 3e −j2π + 4e −j3π = [1 − 2 + 3 − 4] = [−1 − 0j] = −2
P  
X (2) = x(n)e 4
n=0
3 −j6πn
= 1e 0 + 2e −j3π/2 + 3e −j3π + 4e −j9π/2 = [1 + 2j − 3 − 4j][−2 − j2]
P  
X (3) = x(n)e 4
n=0

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,September


5] 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]

 1 1 1 1 1 1 1 1
X (0) x(0)
    
 X (1)   1 W81 W82 W83 W84 W85 W86 W87   x(1) 
X (2)   1 W82 W84 W86 W88 W810 W812 W814 x(2)
     
   
X (3)   1 W83 W86 W89 W812 W815 W818 W821 x(3)
     
= =
   
X (4)   1 W84 W88 W812 W816 W820 W824 W828 x(4)
 
   
X (5)   1 W85 W810 W815 W820 W825 W830 W835 x(5)
     
   
 X (6)   1 W86 W812 W818 W824 W830 W836 W842   x(6) 
X (7) 1 W87 W814 W821 W828 W835 W842 W849 x(7)

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 55 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

W80 = W88 = W816 = W824 = W840 ... = 1


W81 = W89 = W817 = W825 = W833 ... = √1 − j √1
2 2
W82 = W810 = W818 = W826 = W834 ... = −j
W83 = 11 19 27 35
W8 = W8 = W8 = W8 ... = − √ − j √1 1
2 2
W84 = W812 = W820 = W828 = W836 ... = −1
W85 = 13 21 29 37
W8 = W8 = W8 = W8 ... = − √ + j √ 1 1
2 2
W86 = W814 = W822 = W830 = W838 ... = j
W87 = 15 23 31
W8 = W8 = W8 = W8 ... =39 √1 +j √1
2 2

1 1 1 1 1 1 1 1
 
X (0) 1
   
 1 √1 − j √1 −j − √1 − j √1 −1 − √1 + j √1 j 1
√ + j √1 
 X (1)   2 2 2 2 2 2 2 2   1 

X (2)
 
 1 −j −1 j 1 −j −1 j 
  1 
 
− √1 − j √1 1 − j √1 1 + j √1 − √1 + j √1
 

X (3)
  1 j √ 1 √ −j  
1 

2 2 2 2 2 2 2 2
 
= =
 
X (4) 1 −1 1 −1 1 −1 1 −1  0 
    
 
− √1 + j √1 1 + j √1 1 − j √1 − √1 − j √1
 

 X (5) 
  1 −j √ −1 √ j   0 
 
 2 2 2 2 2 2 2 2 
 X (6)  
 1 j −1 −j 1 j −1 −j


 0 
X (7) 1 0
1 √ + j √1 j − √1 + j √1 −1 − √1 − j √1 −j √1 − j √1
2 2 2 2 2 2 2 2

 4  0
XR (0) 4 XI (0)
     
√ √
 1 − j(1 + 2)   XR (1)  1   XI (1)   −(1 + 2) 
 0  0
 XR (2) 0 XI (2)
     
 √      √ 
 1 + j(1 − 2)  XR (3) 1 XI (3)   (1 − 2)
       
=  and
    
 0  XR (4) 0 XI (4)  0
    
√ 
 X (5)
   √ 
 1 − j(1 − 2)
 
  R

 1 


 XI (5)   −(1 − 2)
 

 X (6) 0 XI (6)
0 0
      
√ R √
1 + j(1 + 2) XR (7) 1 XI (7) (1 + 2)

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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) 1 1 1 1 2
 X (1)   1
= W W2 W 3  3 
  =  
 X (2)   1 W2 W4 W6   4 
X (3) 1 W3 W6 W9 4

2π 2π π
WN = e − N = e− 4 = e − 2 = −j
W 2 = −j 2 = −1, W 3 = −j 3 = 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) 1 1 1 1 2 13
 X (1)   1 −j −1 j 
 3
   −2 + j 
 X (2)  = 
   = 
1 −1 1 −1   4   −1 
X (3) 1 j −1 −j 4 −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,September


5] 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) 1 1 1 1 1
 X (1)   1
= W W2 W 3  2 
  =  
 X (2)   1 W2 W4 W6   3 
X (3) 1 W3 W6 W9 4

2π 2π π
WN = e − N = e− 4 = e − 2 = −j
W 2 = −j 2 = −1, W 3 = −j 3 = 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) 1 1 1 1 1 10
 X (1)   1 −j −1 j 
 2
   −2 + 2j 
 X (2)  = 
   = 
1 −1 1 −1   3   −2 
X (3) 1 j −1 −j 4 −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,September


5] 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]

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

N−1
1 X 2π
x(n) = X (k)W ∗kn for n = 0, 1.., N − 1 where W∗ = e N
N k=0

N−1
1 X
x(0) = X (k)e j0 = X (0)e j0 + X (1)e j0 + X (2)e j0 + X (3)e j0
4 k=0
1
= (10 + (−2 + j2) − 2 + (−2 − j2)) = 1
4

N−1
1 X kπ π 3π
x(1) = X (k)e j 2 = X (0)e j0 + X (1)e j 2 + X (2)e jπ + X (3)e j 2
4 k=0
1
= (X (0) + jX (1) − X (2) − jX (3)
4
1
= (10 + j(−2 + j2) − (−2) − j(−2 − j2)) = 2
4

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 59 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

N−1
1 X kπ
x(2) = X (k)e j 2 = X (0)e j0 + X (1)e jπ + X (2)e j2π + X (3)e j3π
4 k=0
1
= (X (0) − X (1) + X (2) − X (3)
4
1
= (10 − (−2 + j2) + (−2) − (−2 − j2)) = 3
4

N−1
1 X kπ3 3π 9π
x(1) = X (k)e j 2 = X (0)e j0 + X (1)e j 2 + X (2)e j3π + X (3)e j 2
4 k=0
1
= (X (0) − jX (1) − X (2) + jX (3)
4
1
= (10 − j(−2 + j2) − (−2) + j(−2 − j2)) = 4
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,September


5] 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 = WNkn k, n = 0, 1.., N −1


      
X (0) 1 1 1 1 1 0
 X (1)   1 −j −1 j    2 − 2j
 1
 
 = = 
 X (2)   1 −1 1 −1   −1   0 
X (3) 1 j −1 −j −1 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,September


5] 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

N−1
1 X 2π
x(n) = X (k)WN−kn for n = 0, 1.., N − 1 where W = e− N
N k=0

N=4 The matrix notation is


   
1 1 1 1 1 1 1 1
 1 −j −1 j   1 j −1 −j 
[WN ] =  1 −1
 [WN∗ ] =  
1 −1   1 −1 1 −1 
1 j −1 −j 1 −j −1 j
      
x(0) 1 1 1 1 0 1
 x(1)  1  1 j −1 −j   2 − 2j   1 
   
 x(2)  = N   =  −1 
   
1 −1 1 −1   0
x(3) 1 −j −1 j 2 + 2j −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,September


5] 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
3
x(n)e 0 = 1e 0 + 2e 0 + 2e 0 + 1e 0 = [1 + 2 + 2 + 1] = 6
P  
X (0) =
n=0
3 2πn
x(n)e −j = 1e 0 + 2e −jπ/2 + 2e −jπ + 1e −j3π/2 = [1 − j2 − 2 + j1] = [−1 − j1]
P  
X (1) = 4
n=0
3 −j4πn
= 1e 0 + 2e −jπ + 2e −j2π + 1e −j3π = [1 − 2 + 2 − 1] = [0] = 0
P  
X (2) = x(n)e 4
n=0
3 −j6πn
= 1e 0 + 2e −j3π/2 + 2e −j3π + 1e −j9π/2 = [1 + 2j − 2 − 1j][−1 + j1]
P  
X (3) = x(n)e 4
n=0

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,September


5] 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
3
X (0) = 14 x(n)e 0 = 6e 0 + (−1 − j1)e 0 + 0e 0 + (−1 + j1)e 0 = 14 [6−1−j1+0−1+j1] = 1
P  
n=0
3 2πn
1
x(n)e j = 6e 0 + (−1 − j1)e jπ/2 + 0e jπ + (−1 + j1)e j3π/2 =
P  
X (1) = 4
4
n=0
1
4
[6− j + 1 + j + 1] = [2]
3 j4πn
X (2) = 14 x(n)e 4 = 6e 0 + (−1 − j1)e jπ + 0e j2π + (−1 + j1)e j3π =
P  
n=0
1
4
[6+ (−1 − j1)(j) + 0 + (−1 + j)(−j)] = 14 [6 − j1 + 1 + 0 + 1 + j] = [2]
3 −j6πn
X (3) = 14 x(n)e 4 = 6e 0 + (−1 − j1)e j3π/2 + 0e j3π + (−1 + j1)e j9π/2 =
P  
n=0
1
4
[6 + (−1 − j1)(−j) + 0 + (−1 + j)(j)] = 14 [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,September


5] 11, 2014 64 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Continuous Time Fourier Transform (CTFT)


Z∞
X (jω) = x(t)e −jωt dt
−∞

Z∞
1
x(t) = X (jω)e jωt dω

−∞

Discrete Time Fourier Transform (DTFT)



X
X (e jω ) = x(n)e −jωn
−∞
Z
1
x(n) = X (e jω )e jωn dω

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 65 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Unit sample δ(n) 


1 for n = 0
x(n) =
0 for n 6= 0

N−1
X 2π nk
X (k) = x(n)e −j N

x=0
N−1
X
= x(0)e 0 = 1 × 1 = 1
x=0

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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

N−1
X 2π nk
X (k) = x(n)e −j N

x=0
N−1 N−1
X 2π nk X 2πk
= an e −j N = (ae −j N )n
x=0 x=0

N−1
!
1 − aN e −j2πk X aN1 − aN2 +1
X (k) = Using series expansion ak =
1 − ae −j2πk /N k=0
1−a

e −j2πk =1

1 − aN
X (k) =
1 − ae −j2πk /N

x[n] = (0.5)n u[n] 0 ≤ n ≤ 3

1 − (0.5)4 0.9375
X (k) = =
1 − 0.5e −j2πk /4 1 − 0.5e −jπ/2k

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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) 1 1 1 1 1 1
 x(1)  1  1 −j −1 j 
  0.707
   1 − j1.414 
 x(2)  = N
   = 
 1 −1 1 −1   0   1 
x(3) 1 j −1 −j −0.707 1 + j1.414

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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 samplesfrom the spectrum for the following frequencies:
ωT = 0, π4 , π2 , 3π , π 5π , 3π , 7π

4 4 2 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 (e j0 ) = Xs [0] = 5
X4 [1] = X (e jπ/2 ) = Xs [2] = 3
X4 [2] = X (e jπ ) = Xs [4] = 1
X4 [3] = X (e j3π/2 ) = Xs [6] = 3

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 69 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Find the Fourier Transform of the sequence



1 0≤n≤4
x[n] =
0 else

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

  sin (5ω/2)
X e jω = e −j2ω
sin (ω/2)
Consider a causal sequence x[n] where;

x[n] = (0.5)n u[n]

Its DTFT X e jw can be obtained as




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

∞ 
X n 1
= 0.5e jw =
n=0
1 − 0.5e −jw

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 70 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Find the N Point DFT of x(n) = 4 + cos 2 ( 2πn


N
)

Solution:
x(0) = 4 + cos 2 (0) = 5
x(1) = 4 + cos 2 ( 2π1
10
) = 4.6545
x(2) = 4 + cos 2 ( 2π2
10
) = 4.09549
x(3) = 4 + cos 2 ( 2π3
10
) = 4.09549
x(4) = 4 + cos 2 ( 2π4
10
) = 4.09549
x(5) = 4 + cos 2 ( 2π5
10
)=5
x(6) = 4 + cos 2 ( 2π6
10
) = 4.6545
x(7) = 4 + cos 2 ( 2π7
10
) = 4.09549
x(8) = 4 + cos 2 ( 2π8
10
) = 4.09549
x(9) = 4 + cos 2 ( 2π9
10
) = 4.6545
x(n) = x(N − n)
Cosine function is even function
x(n) = x(−n)
N−1  
X 2πkn
X (k) = x(n)cos 0≤k ≤N −1
n=0
N

N−1
X   
2πn 2πkn
X (k) = 4 + cos 2 ( ) cos 0≤k ≤N −1
n=0
N N

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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,September


5] 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
N−1
X
X (k) = x(n)e −j2πkn/N k = 0, 1, . . . N − 1 (1)
n=0

IDFT expression is
N−1
1 X
x(n) = X (k)e j2πkn/N n = 0, 1, · · · N − 1 (2)
N k=0

Fourier series is
N−1
X 2π nk
xp (n) = ck e j N −∞≤n ≤∞ (3)
k=0

Fourier series coefficients are expressed as:


N−1
1 X 2π
ck = xp (n)e −j N nk k = 0, 1.., N − 1 (4)
N k=0

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,September
5] 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 (ω) = x(n)−jωn −∞≤n ≤∞ (5)
n=−∞


X 2π nk
X (k) = X (ω|ω=2πk/N ) = x(n)−j N −∞≤n ≤∞ (6)
n=−∞

DFT coefficients are expressed as:


X
xp (n) = x(n − lN) (7)
n=−∞

xp (n) is determined by aliasing x(n) over the interval 0 ≤ n ≤ N − 1. The finite duration
sequence 
xp (n) 0 ≤ n ≤ N − 1
x̂(n) =
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,September


5] 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
X (z) = x(n)z −n (8)
n=−∞

Sample X(z) at N equally spaced points on the unit circle. These points will be

Zk = e j2πk/N k = 0, 1, · · · N − 1 (9)


X
X (z)|zk = e j2πk/N = x(n)e −j2πkn/N (10)
n=−∞

If x(n) is causal and has N number of samples then



X
X (z)|zk = e j2πk/N = x(n)e −j2πkn/N (11)
n=0

This is equivalent to DFT X(k)

X (k) = X (z)|zk = e j2πk/N (12)

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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)

DFT
x(n) ↔ X (k)

DFT
y (n) ↔ Y (k)
N−1 N−1
X 1 X
x(n)y ∗ (n) = X (k)Y ∗ (k) (13)
n=0
N k=0

When x(n)=y(n)
N−1 N−1
X 1 X
|x(n)|2 = |X (k)|2 (14)
n=0
N k=0

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,September


5] 11, 2014 76 / 91
Problems and Solutions on DFT Problems and Solutions on DFT

1

2
−2≤n ≤2
Determine the DFT of the sequence for N=8, h(n) =
0 otherwise
Plot the magnitude and phase response for N=8
Solution:  

1 1 1 1 1
h(n) = , , , ,
2 2 2 2 2
 

Consider a sequence x(n) and its DFT is


DFT
x(n) ↔ X (k)

DFT
xp (n) ↔ X (k)
where xp (n) is the periodic sequence of x(n) in this example x(n) is of h(n) and is of
 

1 1 1 1 1 
h(n) = , , , ,

 2 2 2 2 2 

There are 5 samples in h(n) append 3 zeros to the right side of the sequence h(n)
 

1 1 1 1 1 

h(n) = , , , , , 0, 0, 0
2 2 2 2 2
 

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 77 / 91
Problems and Solutions on DFT Problems and Solutions on DFT

DFT DFT
The DFT of h(n) and hp (n) is h(n) ↔ H(k) hp (n) ↔ H(k)

h( n )
1
2

-2 -1 0 1 2 3 4 5 n

h p (n ) These are new


sequences x(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 n

Figure 40: Plot of h(n) and hp (n)

The value of h(n) from the Figure is represented as



hp (n) 0 ≤ n ≤ N − 1
h(n) =
0 Otherwise
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September
5] 11, 2014 78 / 91
Problems and Solutions on DFT Problems and Solutions on DFT

The new sequence h(n) from hp (n) is


 

1 1 1 
1 1
h(n) = , , , 0, 0, 0, ,
2 2 2
 2 2

 1 1 1 1 1 1 1 1
X (0) x(0)
    
 X (1)   1 W81 W82 W83 W84 W85 W86 W87   x(1) 
X (2)   1 W82 W84 W86 W88 W810 W812 W814 x(2)
     
   
X (3)   1 W83 W86 W89 W812 W815 W818 W821 x(3)
     
= =
   
X (4)   1 W84 W88 W812 W816 W820 W824 W828 x(4)
 
   
X (5)   1 W85 W810 W815 W820 W825 W830 W835 x(5)
     
   
 X (6)   1 W86 W812 W818 W824 W830 W836 W842   x(6) 
X (7) 1 W87 W814 W821 W828 W835 W842 W849 x(7)

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 79 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
|H(k)|
Magnitude

2.5
W80 = W88 = W816 = W824 = W840 ... = 1

2
W81 = W89 = W817 = W825 = W833 ... = √1 − j √1

1 1.5
2 2
W82 = W810 = W818 = W826 = W834 ... = −j

.5
W83 = W811 = W819 = W827 = W835 ... = − √1 − j √1
2 2

0
W84 = W812 = W820 = W828 = W836 ... = −1 0 1 2 3 4 5 6 7 k

W85 = W813 = W821 = W829 = W837 ... = − √1 + j √1 180 Phase of H(k)


2 2
W86 = W814 = W822 = W830 = W838 ... = j 90
0 1 2 3 4 5 6 7 k
W87 = W815 = W823 = W831 = W839 ... = √1 + j √1
2 2
-90

-180

1 1 1 1 1 1 1 1
 
 1 
X (0)
 
1 √1 − j √1 −j − √1 − j √1 −1 − √1 + j √1 j 1
√ + j √1 2
 1
 
X (1)  2 2 2 2 2 2 2 2  
 
1 −j −1 j 1 −j −1 j  2
 1
  
X (2)
    
− √1 − j √1 1 − j √1 1 + j √1 − √1 + j √1  2
 

X (3)
  1 j √ 1 √ −j  
2 2 2 2 2 2 2 2 = 0
   
=
  
X (4) 1 −1 1 −1 1 −1 1 −1  0
   
 
− √1 + j √1 1 + j √1 1 − j √1 − √1 − j √1
   

 X (5) 
  1 −j √ −1 √ j   0 
 2 2 2 2 2 2 2 2  
 1

 X (6)  
1 j −1 −j 1 j −1 −j
 
  2
X (7) 1 1
1 √ + j √1 j − √1 + j √1 −1 − √1 − j √1 −j √1 − j √1 2
2 2 2 2 2 2 2 2

2.5 2.5∠0
   
 1.207   1.207∠0 
−0.5  0.5∠ − 180
   
  
−0.207  0.207∠ − 180
   
=
  
0.5  0.5∠0
 
  

 −0.207 

 0.207∠ − 180



 −0.5   0.5∠ − 180 
1.207 1.207∠0
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September
5] 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) = an u(n)
i) Determine the Fourier transform H(ω)
ii) DFT H(k) of h(n)
iii) Relationship between H(ω) and H(k)


X
H(ω) = h(n)e −jωn
n=−∞


X
= an u(n)e −jωn
n=−∞

X n
= (ae −jω) ∵ u(n) = 0 for n < 0
n=0

N−1
(
X N for a = 1
ak = 1−aN
1−a
for a 6= 1
k=0

(ae −jω )0 − (ae −jω )∞+1 1


H(ω) = =
1 − ae −jω 1 − ae −jω

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 81 / 91
Problems and Solutions on DFT Problems and Solutions on DFT

The DFT of h(n) and hp (n) is


DFT DFT
h(n) ↔ H(k) hp (n) ↔ H(k)
where hp (n) is related as

X
hp (n) = h(n − lN)
l=−∞

Consider l=-p
−∞
X ∞
X
hp (n) = h(n + pN) hp (n) = h(n + pN)
l=∞ l=−∞

N point DFT H(k) in terms of hp (n) is

N−1
X 2π kn
H(k) = h(n)e −j N

n=0

 
N−1 ∞
X X 2π kn
H(k) =  h(n + pN) e −j N

n=0 n=−∞

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 82 / 91
Problems and Solutions on DFT Problems and Solutions on DFT

 
N−1 ∞
X X 2π kn
H(k) =  a (n+pN)
u(n + pN) e −j N

n=0 n=−∞
N−1 ∞
" #
X X 2π kn
= a (n+pN)
e −j N ∵ u(n) = 0 for n < 0
n=0 n=0
N−1 ∞
" #
X X 2π kn
= an apN e −j N

n=0 n=0

Interchanging the summations

∞ N−1
X X 2π kn
H(k) = apN an e −j N

n=0 n=0

N
X 1 − aN
ak =
k=0
1−a

∞ ∞
X X p 1 − (aN )∞+1 1
apN = aN = =
p=0 p=0
1 − aN 1 − aN

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 83 / 91
Problems and Solutions on DFT Problems and Solutions on DFT

N−1 N−1
X 2π kn X 2π k)n (ae −j2πk/N )0 − (ae −j2πk/N )N
an e −j N = (ae −j N =
n=0 n=0
1 − (ae −j2πk/N )

N−1
X 2π k)n 1 − aN e −j2πk 1 − aN
(ae −j N = −j2πk/N
= ∵ e −j2πk = 1
n=0
1 − (ae ) 1 − (ae −j2πk/N )

1 1 − aN
H(k) =
1 − aN 1 − (ae −j2πk/N )
1
=
1 − (ae −j2πk/N )

1 1
H(ω) = = and H(k) =
1 − ae −jω 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,September


5] 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)
Unit step sequence u(n)

0 1 2 3 4 N-3 N-2 N-1 N N+1 N+2 … n

u(n-N)
Unit step sequence delayed by N samples

0 1 2 3 4 N-3 N-2 N-1 N N+1 N+2 … n

x(n)=u(n)-u(n-N)

Subtraction of u(n-N) from u(n)

0 1 2 3 4 N-3 N-2 N-1 N N+1 N+2 … n

Figure 41: Generation of x(n) = u(n) − u(n − N)

The value of x(n) as shown in Figure is represented as



1 0≤n ≤N −1
x(n) =
0 Otherwise
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September
5] 11, 2014 85 / 91
Problems and Solutions on DFT Problems and Solutions on DFT

DFT expression is

N−1
X
X (k) = x(n)e −j2πkn/N k = 0, 1, . . . N − 1
n=0
N−1
X
= 1e −j2πkn/N
n=0
N−1
"N−1 #
X X 1 − aN
= (e −j2πk/N )n (1) ak =
n=0 k=0
1−a

1 − e −j2πk 1−1
X (k) = = −j2πk/N = 0
e −j2πk/N e
When k=0 From the expression (1)

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


0 when k 6= 0
X (k) =
N when k = 0

X (k) = Nδ(k)

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 86 / 91
Problems and Solutions on DFT Problems and Solutions on DFT

7 7
|X (k)|2
P P
If x(n)=[1,2,0,3,-2, 4,7,5] evaluate the following i) X(0) ii) X(4) iii) X (k) iv)
k=0 k=0

X(0) is
N−1
X
X (k) = x(n)e −j2πkn/N
n=0

with k=0 and N=8

N−1
X
X (0) = x(n) = 1 + 2 + 0 + 3 − 2 + 4 + 7 + 5 = 20
n=0

X(4) is
N−1
X
X (k) = x(n)e −j2πkn/N
n=0

with k=4 and N=8

N−1
X N−1
X N−1
X
X (4) = x(n)e −j2π4n/8 = x(n)e −jπn = x(n)(−1)n
n=0 n=0 n=0

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,September


5] 11, 2014 87 / 91
Problems and Solutions on DFT Problems and Solutions on DFT

7
P
iii) X (k)
k=0
We Know the IDFT expression as
N−1
1 X
x(n) = X (k)e j2πkn/N
N n=0

With n=0 and N=8 it becomes

N−1
1 X
x(0) = X (k)
8 n=0

N−1
X
∴ X (k) = 8x(0) = 8 × 1 = 8
n=0

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 88 / 91
Problems and Solutions on DFT Problems and Solutions on DFT

7
|X (k)|2 is
P
The value of
k=0
The expression for Parseval’s theorem is

N−1 N−1
X 1 X
|x(n)|2 = |X (k)|2
n=0
N k=0

7
|X (k)|2 is related as
P
k=0
N−1 N−1
X 1 X
|x(n)|2 = |X (k)|2
n=0
N k=0

N=8 Then
7 7
X 1X
|x(n)|2 = |X (k)|2
n=0
8 k=0

7
X 7
X
|X (k)|2 = 8 |x(n)|2 = 8[1 + 4 + 0 + 9 − 4 + 4 + 49 + 25] = 864
k=0 n=0

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 11, 2014 89 / 91
Thank You

Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September


5] 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,September


5] 11, 2014 91 / 91

You might also like