Top Banner
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
91

Discrete Fourier Transforms (DFT)

Sep 11, 2021

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Discrete Fourier Transforms (DFT)

UNIT - 1: Discrete Fourier Transforms(DFT)[1, 2, 3, 4, 5]

Dr. Manjunatha. [email protected]

ProfessorDept. of ECE

J.N.N. College of Engineering, Shimoga

September 11, 2014

Page 2: Discrete Fourier Transforms (DFT)

DSP Syllabus Introduction

Digital Signal Processing: Introduction [1, 2, 3, 4]

Slides are prepared to use in class room purpose, may be used as areference material

All the slides are prepared based on the reference material

Most of the figures/content used in this material are redrawn, someof the figures/pictures are downloaded from the Internet.

I will greatly acknowledge for copying the some the images from theInternet.

This material is not for commercial purpose.

This material is prepared based on Digital Signal Processing forECE/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

Page 3: Discrete Fourier Transforms (DFT)

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

Page 4: Discrete Fourier Transforms (DFT)

Introduction The concept of frequency in continuous and discrete time signals

The concept of frequency in continuous and discrete time signalsContinuous Time Sinusoidal Signals

The concept of frequency is closely related to specific type of motion called harmonicoscillation 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 thefrequency in radians per second(rad/s), and θ is the phase in radians. The Ω is related byfrequency 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 theamount 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

Page 5: Discrete Fourier Transforms (DFT)

Introduction The concept of frequency in continuous and discrete time signals

Complex exponential signalsxa(t) = Ae j(Ωt+θ)

where

e±jφ = cosφ± jsinφ

xa(t) = Acos(Ωt + θ) =A

2e j(Ωt+θ) +

A

2e−j(Ωt+θ)

As time progress the phasors rotate in opposite directions with angular ±Ω frequenciesradians per second.A positive frequency corresponds to counterclockwise uniform angular motion, a negativefrequency 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

Page 6: Discrete Fourier Transforms (DFT)

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 inradians.

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

Page 7: Discrete Fourier Transforms (DFT)

Introduction Discrete Time Sinusoidal Signals

Periodic and aperiodic (non-periodic) signals.

A periodic signal consists a continuously repeated pattern. Signal is periodic if it exhibitsperiodicity 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 repeatsover 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

Page 8: Discrete Fourier Transforms (DFT)

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

Page 9: Discrete Fourier Transforms (DFT)

Introduction Discrete Time Sinusoidal Signals

Periodic and aperiodic (non-periodic) signals.

Figure 9: Aperiodic signalsFigure 10: Aperiodic discrete timesignals

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

Page 10: Discrete Fourier Transforms (DFT)

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

Page 11: Discrete Fourier Transforms (DFT)

Fourier series

Fourier series

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

Page 12: Discrete Fourier Transforms (DFT)

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 withdifferent 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 berepresented by the Fourier transform.For example square wave pattern can be approximated with a suitable sum of afundamental 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 sumis called a Fourier series.The major difference with respect to the line spectra of periodic signals is that the spectraof aperiodic signals are defined for all real values of the frequency variable ω.

Figure 13: Square Wave fromFourier 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

Page 13: Discrete Fourier Transforms (DFT)

Fourier series Fourier series

Fourier analysis: Every composite periodic signal can be represented with a series of sineand cosine functions with different frequencies, phases, and amplitudes.

The functions are integral harmonics of the fundamental frequency f of the compositesignal.

Using the series we can decompose any periodic signal into its harmonics.

f (θ) = a0 +∞∑

n=1

ancos(nθ) +∞∑

n=1

bnsin(nθ)

where

a0 =1

2π∫0

f (θ)dθ

an =1

π

2π∫0

f (θ)cos(nθ)dθ

bn =1

π

2π∫0

f (θ)sin(nθ)dθ

Line spectra, harmonics

The fundamental frequency f0 = 1/T . The Fourier series coefficients plotted as a functionof 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

Page 14: Discrete Fourier Transforms (DFT)

Fourier series Fourier series

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

Page 15: Discrete Fourier Transforms (DFT)

Fourier series Fourier series

Figure 15: Square Wave

f (θ) =

A when 0 < θ < π−A when π < θ < 2π

f (θ + 2π) = f (θ)

a0 =1

∫ 2π

0f (θ)dθ

=1

[∫ π

0f (θ)dθ +

∫ 2π

πf (θ)dθ

]=

1

[∫ π

0Adθ +

∫ 2π

π(−A)dθ

]= 0

an =1

π

∫ 2π

0f (θ) cos nθdθ

=1

π

[∫ π

0A cos nθdθ +

∫ 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

Page 16: Discrete Fourier Transforms (DFT)

Fourier series Fourier series

bn =1

π

∫ 2π

0f (θ) sin nθdθ

=1

π

[∫ π

0A sin nθdθ +

∫ 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

3sin 3θ +

1

5sin 5θ +

1

7sin 7θ + · · ·

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

Page 17: Discrete Fourier Transforms (DFT)

Fourier series Fourier series

4A

π

(sin θ +

1

3sin 3θ +

1

5sin 5θ +

1

7sin 7θ + · · ·

)

Figure 16: Square Wave from FourierSeries

Figure 17: Square Wave from FourierSeries

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

Page 18: Discrete Fourier Transforms (DFT)

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

Page 19: Discrete Fourier Transforms (DFT)

Fourier series Fourier series

Figure 19: Triangular Wave

bn =2

T

∫ T

0f (t) sin

(2πnT

t)dt

=4

T

∫ T/2

0f (t) sin

(2πnT

t)dt

=4

T

∫ T/4

0t sin

(2πnT

t)dt +

4

T

∫ T/4

0

(−t +

T

2

)sin(

2πnT

t)dt

=4

T

[2

(T

2πn

)2

sin(πn2

)]

=2T

2π2n2sin(πn2

)= 0 when n is even

2T

π2

[sin

(2π

Tt

)−

1

32sin

(6π

Tt

)+

1

52sin

(10π

Tt

)− · · ·

]

f (t) =

t when − T

4≤ t ≤ T

4−t + T

2when 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

Page 20: Discrete Fourier Transforms (DFT)

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

Page 21: Discrete Fourier Transforms (DFT)

Fourier series Fourier series

The Exponential (Complex) Form of Fourier Series

f (θ) = a0 +∞∑

n=1

an cos nθ +∞∑

n=1

bn sin nθ

cosθ =e jθ + e−jθ

2sinθ =

e jθ − e−jθ

2j

an cos nθ + bn sin nθ =

= ane jnθ + e−jnθ

2+ bn

e jnθ − e−jnθ

2j

= ane jnθ + e−jnθ

2− jbn

e jnθ − e−jnθ

2

=

(an − jbn

2

)e jnθ +

(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

Page 22: Discrete Fourier Transforms (DFT)

Fourier series Fourier series

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

f (θ) = c0 +∞∑

n=1

(cne jnθ + c−ne−jnθ

)=

∞∑n=−∞

cne jnθ

where

cn =

(an − jbn

2

)The coefficient cn can be evaluated as.

cn =1

∫ π

−πf (θ) cos nθdθ −

j

∫ π

−πf (θ) sin nθdθ

=1

∫ π

−πf (θ) (cos nθ − j sin nθ)dθ

=1

∫ π

−πf (θ)e−jnθdθ

In exponential Fourier series only oneintegral has to be calculated and it issimpler integration.

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

Page 23: Discrete Fourier Transforms (DFT)

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

ExampleFind 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 the1000 Hzwith ran

e frequencyz. Form a sdom noise.

y componenignal consis

nts of a sigsting of 50

gnal buriedHz and 120

d in noise. 0 Hz sinuso

Consider doids and co

data sampleorrupt 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

Page 24: Discrete Fourier Transforms (DFT)

Fourier series Fourier series

-5

-4

-3

-2

-1

0

1

2

3

4

5

0 200 4400 600

0 800 1000 1200 14400

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

Page 25: Discrete Fourier Transforms (DFT)

Fourier Transform

Fourier Transform

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

Page 26: Discrete Fourier Transforms (DFT)

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 usedfor 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 withdifferent 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 berepresented by the Fourier transform.

For example square wave pattern can be approximated with a suitable sum of afundamental 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 sumis called a Fourier series.

The major difference with respect to the line spectra of periodic signals is that the spectraof 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

Page 27: Discrete Fourier Transforms (DFT)

Fourier Transform Fourier Transform

f (θ) =∞∑

n=−∞cne jnθ

where

cn =1

∫ π

−πf (θ)e−jnθdθ

θ = ωt

ω is the angular velocity in radians persecond.

ω = 2πf and θ = 2πft

θ =2π

Tt and dθ =

Tdt

when θ = −π

−π =2πt

T⇒ t = −

T

2

when θ = π

π =2πt

T⇒ t =

T

2

f (t) =∞∑

n=−∞cne jnωt

cn =1

T

∫ T/2

−T/2f (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

Page 28: Discrete Fourier Transforms (DFT)

Fourier Transform Fourier Transform

Relationship from Fourier series to Fourier Transform

f (t) =∞∑

n=−∞cne jnωt

cn =1

T

∫ T/2

−T/2f (t)e−jnωt dt

As T approaches infinityω approaches zeroand n becomes meaninglessnω ⇒ ω ω ⇒ ∆ωT ⇒ 2π

∆ω

f (t) =ω∑

n=−ωcωe jωt

cω =∆ω

∫ T/2

−T/2f (t)e−jωt dt

f (t) =1

∞∑ω=−∞

∫ T/2

−T/2f (t)e−jωt dt

e jωt ∆ω

T ⇒∞ ∆ω ⇒ dω and∑⇒∫

f (t) =1

2

∫ ∞−∞

[∫ ∞−∞

f (t)e(−jωt)dt

]e(jωt)dω

f (t) =1

2

∫ ∞−∞

F (ω)e(jωt)dω

F (ω) =

∫ ∞−∞

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

Page 29: Discrete Fourier Transforms (DFT)

Fourier Transform Fourier Transform

Figure 28: Rectangular Pulse

Figure 29: Sinc Function

F (ω) =

1/2∫−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 issinx

xform

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

Page 30: Discrete Fourier Transforms (DFT)

Fourier Transform Fourier Transform

Figure 30: Exponential

Figure 31: Gaussian

F (ω) =

∞∫0

exp(− at) exp(−jωt)dt

=

∞∫0

exp(−at − jωt)dt =

∞∫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

Page 31: Discrete Fourier Transforms (DFT)

Fourier Transform Fourier Transform

∞∫−∞

δ(t) exp(−iω t) dt = exp(−iω [0]) = 1

∞∫−∞

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

Page 32: Discrete Fourier Transforms (DFT)

Fourier Transform Fourier Transform

F exp(iω0 t) =

∞∫−∞

exp(iω0 t) exp(−i ω t) dt

=

∞∫−∞

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

Page 33: Discrete Fourier Transforms (DFT)

Fourier Transform Fourier Transform

F cos(ω0t) =

∞∫−∞

cos(ω0t) exp(−j ω t) dt

=1

2

∞∫−∞

[exp(j ω0 t) + exp(−j ω0 t)] exp(−j ω t) dt

=1

2

∞∫−∞

exp(−j [ω − ω0] t) dt +1

2

∞∫−∞

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

Page 34: Discrete Fourier Transforms (DFT)

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

Page 35: Discrete Fourier Transforms (DFT)

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

Page 36: Discrete Fourier Transforms (DFT)

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

Page 37: Discrete Fourier Transforms (DFT)

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 analyzedin frequency domain.

Frequency analysis of discrete time signals is usually and most conveniently performed ona 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

Page 38: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Summary of FS and FT

Fourier Series is

x(θ) = a0 +∞∑

n=1

ancos(nθ) +∞∑

n=1

bnsin(nθ)

where a0 = 12π

2π∫0

x(θ)dθ

an =1

π

2π∫0

x(θ)cos(nθ)dθ bn =1

π

2π∫0

x(θ)sin(nθ)dθ

The Exponential (Complex) Form

x (θ) =∞∑

n=−∞cne jnθ where cn =

1

∫ π

−πx(θ)e−jnθdθ

x(t) =∞∑

n=−∞cne jnωt where cn =

1

T

∫ T/2

−T/2x(t)e−jnωt dt

Fourier Transform pair is

X (ω) =

∫ ∞−∞

f (t)e(−ωt)dt and x(t) =1

2

∫ ∞−∞

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

Page 39: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Summary of FS and FT

Time Domain Frequency Domain Transform

Continuous Periodic Discrete nonperiodic Fourier seriesContinuous nonperiodic Continuous nonperiodic Fourier TransformDiscrete nonperiodic Continuous nonperiodic Sequences Fourier TransformDiscrete 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

Page 40: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Summary of FS and FT

The Fourier Series for Continuous time Periodic Signals

Synthesis Equation x(t) =∞∑

k=−∞ck e j2πnft

Analysis Equation cn = 1T

∞∫−∞

x(t)e−j2πnft dt

The Fourier Transform for Continuous Time Aperiodic Signals

Synthesis Equation (Inverse transform) x(t) =∞∫−∞

X (F )e j2πFt dF

Analysis Equation (Direct transform) X (F ) =∞∫−∞

x(t)e−j2πFt dt

The Fourier Series for Discrete time Periodic Signals

Synthesis Equation x(n) =N−1∑k=0

ck e j2πkn/N

Analysis Equation ck = 1N

N−1∑n=0

x(n)e−j2πkn/N

The Fourier Transform of Discrete Time Aperiodic Signals

Synthesis Equation (Inverse transform) x(n) = 12π

∞∫−∞

X (F )e j2πF1t dF

Analysis Equation (Direct transform) X (ω) =∞∑

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

Page 41: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Summary of FS and FT

DFT transforms the time domain signal samples to the frequency domain components.

Time

Am

plitu

de

Signal

Frequency

Am

plitu

de SignalSpectrum

Figure 35: Discrete Fourier Transform

Signal Types of Transforms Example WaveformContinuous and periodic Fourier Series sine waveContinuous and aperiodic Fourier SeriesDiscrete and periodic Fourier SeriesDiscrete and aperiodic Fourier Series

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

Page 42: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Need For Frequency Domain Sampling

In practical application, signal processed by computer has two main characteristics: Itshould be Discrete and Finite length

But nonperiodic sequences Fourier Transform is a continuous function of ω, and it is aperiodic 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 domainsequence to an equivalent frequency domain representation, which is represented by theFourier transform X (ω) of the sequence x(n).

Consider an aperiodic discrete time signal x(n) and its Fourier transform is

X (ω) =∞∑

n=−∞x(n)e−jωn

The Fourier transform X (ω) is a continuous function of frequency and it is not acomputationally convenient representation of the sequence.

To overcome the processing, the spectrum of the signal X (ω) is sampled periodically infrequency at a spacing of δω radians between successive samples.

The signal X (ω) is periodic with period 2π and take N equidistant samples in the interval0 ≤ ω ≤ 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

Page 43: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Figure 36: Frequency domainsampling

Figure 37: Frequency domainsampling

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

Page 44: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Now consider ω = 2πk/N

X

(2π

Nk

)=

∞∑n=−∞

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

X

(2π

Nk

)= · · ·+

−1∑n=−N

x(n)e−j2πkn/N +

N−1∑n=0

x(n)e−j2πkn/N

+

2N−1∑n=N

x(n)e−j2πkn/N + · · ·

=∞∑

n=−∞

lN+N−1∑n=lN

x(n)e−j2πkn/N

By changing the index in the inner summation from n to n − lN and interchanging theorder of summation

X

(2π

Nk

)=

N−1∑n=0

∞∑n=−∞

x(n − lN)

e−j 2πN

k(n−lN)

=

N−1∑n=0

∞∑n=−∞

x(n − lN)

e−j 2πN

kne−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

Page 45: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

X

(2π

Nk

)=

N−1∑n=0

∞∑n=−∞

x(n − lN)

e−j2πkn/N k = 0, 1, 2, . . .N − 1

Let xp(n) =∞∑

n=−∞x(n − lN)

The term xp(n) is obtained by the periodic repetition of x(n) every N samples hence it isa periodic signal. This can be expanded by Fourier series as

xp(n) =

N−1∑k=0

ck e j2πkn/N n = 0, 1, · · ·N − 1

where ck is the fourier coefficients expressed as

ck =1

N

N−1∑n=0

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

Upon comparing

ck =1

NX

(2π

Nk

)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

Page 46: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

xp(n) =1

N

N−1∑k=0

X

(2π

Nk

)e j2π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 finiteduration 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− 10 L ≤ n ≤ N − 1

For the finite duration sequence of length L the Fourier transform is:

X (ω) =

L−1∑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∑n=0

x(n)e−j2πkn/N =

N−1∑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

Page 47: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

DFT and IDFT expressions are

DFT expressions is

X (k) =

N−1∑n=0

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

IDFT expressions is

xp(n) =1

N

N−1∑k=0

X

(2π

Nk

)e j2π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∑k=0

X (k) e j2π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

Page 48: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

DFT as a Linear Transformation

X (k) =

N−1∑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=0

x(n)W nkN for k = 0, 1..,N − 1

X (0)X (1)X (2)...X (3)

=

1 1 1 1 . . . 11 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

Page 49: Discrete Fourier Transforms (DFT)

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 kn8 = e−

π4

kn Result

0 W 08 = e0 Magnitude 1 Phase 0

1 W 18 = e−j π

41 = e−j π

4 Magnitude 1 Phase −π/4

2 W 28 = e−j π

42 = e−j π

2 Magnitude 1 Phase −π/2

3 W 38 = e−j π

43 = e−j3 π

4 Magnitude 1 Phase −3π4

4 W 48 = e−j π

44 = e−jπ Magnitude 1 Phase −π

5 W 58 = e−j π

45 = e−j3 π

5 Magnitude 1 Phase −5π/4

6 W 68 = e−j π

46 = e−j3 π

2 Magnitude 1 Phase −3π/2

7 W 78 = e−j π

47 = e−j7 π

4 Magnitude 1 Phase −7π/4

8 W 88 = e−j π

48 = e−j2π Magnitude 1 Phase −2π W 8

8 = W 08

9 W 98 = e−j π

49 = e−j(2π+ π

4) Magnitude 1 Phase (−2π+π/4) W 9

8 = W 18

10 W 108 = e−j π

410 = e−j(2π π

2) Magnitude 1 Phase (−2π+π/2) W 10

8 = W 28

11 W 118 = e−j π

411 = e−j2π+ 3π

4 W 118 = W 3

8

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

Page 50: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Real partof WN0 8

8 8 .. 1W W= = =

Imaginarypart of WN

4 128 8 ..

1W W= == −

2 108 8 ..W W j= = = −

1 98 8 ..1 12 2

W W

j

= =

= −

3 118 8 ..

1 12 2

W W

j

= =

= − −

5 138 8 ..

1 12 2

W W

j

= =

= − +

6 148 8 ..W W j= = =

7 158 8 ..1 12 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

Page 51: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Real partof WN

0 44 4

84

1W W

W

= =

=

2 64 4

104

1W W

W

= − =

=

3 7 114 4 4W j W W= = =

1 5 94 4 4W j W W= − = =

Imaginarypart 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

Page 52: Discrete Fourier Transforms (DFT)

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∑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

2− jsin

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

for k=0,1,2,3

X (0) =3∑

n=0x(n)e0 =

[2e0 + 3e0 + 4e0 + 4e0

]= [2 + 3 + 4 + 4] = 13

X (1) =3∑

n=0x(n)e−j 2πn

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

]= [2− 3j − 4 + 4j] = [−2 + j]

X (2) =3∑

n=0x(n)e

−j4πn4 =

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

]= [2− 3 + 4− 4] = [−1− 0j] = −1

X (3) =3∑

n=0x(n)e

−j6πn4 =

[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

Page 53: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

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

X (k) =

N−1∑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

Page 54: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Find DFT for a given a sequence x(n) for 0 ≤ n ≤ 3 wherex(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∑

n=0x(n)e0 =

[4e0 + 2e0 + 3e0 + 4e0

]= [1 + 2 + 3 + 4] = 10

X (1) =3∑

n=0x(n)e−j 2πn

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

]= [1− j2− 3 + j4] = [−2 + j2]

X (2) =3∑

n=0x(n)e

−j4πn4 =

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

]= [1− 2 + 3− 4] = [−1− 0j] = −2

X (3) =3∑

n=0x(n)e

−j6πn4 =

[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

Page 55: Discrete Fourier Transforms (DFT)

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. Alsocalculate 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 00]

X (0)X (1)X (2)X (3)X (4)X (5)X (6)X (7)

=

1 1 1 1 1 1 1 11 W 1

8 W 28 W 3

8 W 48 W 5

8 W 68 W 7

81 W 2

8 W 48 W 6

8 W 88 W 10

8 W 128 W 14

81 W 3

8 W 68 W 9

8 W 128 W 15

8 W 188 W 21

81 W 4

8 W 88 W 12

8 W 168 W 20

8 W 248 W 28

81 W 5

8 W 108 W 15

8 W 208 W 25

8 W 308 W 35

81 W 6

8 W 128 W 18

8 W 248 W 30

8 W 368 W 42

81 W 7

8 W 148 W 21

8 W 288 W 35

8 W 428 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

Page 56: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

W 08 = W 8

8 = W 168 = W 24

8 = W 408 ... = 1

W 18 = W 9

8 = W 178 = W 25

8 = W 338 ... = 1√

2− j 1√

2

W 28 = W 10

8 = W 188 = W 26

8 = W 348 ... = −j

W 38 = W 11

8 = W 198 = W 27

8 = W 358 ... = − 1√

2− j 1√

2

W 48 = W 12

8 = W 208 = W 28

8 = W 368 ... = −1

W 58 = W 13

8 = W 218 = W 29

8 = W 378 ... = − 1√

2+ j 1√

2

W 68 = W 14

8 = W 228 = W 30

8 = W 388 ... = j

W 78 = W 15

8 = W 238 = W 31

8 = W 398 ... = 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√

2j 1√

2+ j 1√

21 −j −1 j 1 −j −1 j

1 − 1√2− j 1√

2j 1√

2− j 1√

21 1√

2+ j 1√

2−j − 1√

2+ j 1√

21 −1 1 −1 1 −1 1 −1

1 − 1√2

+ j 1√2

−j 1√2

+ j 1√2

−1 1√2− j 1√

2j − 1√

2− j 1√

21 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

=

11110000

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)

41010101

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

Page 57: Discrete Fourier Transforms (DFT)

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 11 W W 2 W 3

1 W 2 W 4 W 6

1 W 3 W 6 W 9

=

2344

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 = −jX (0)X (1)X (2)X (3)

=

1 1 1 11 −j −1 j1 −1 1 −11 j −1 −j

2344

=

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

Page 58: Discrete Fourier Transforms (DFT)

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 11 W W 2 W 3

1 W 2 W 4 W 6

1 W 3 W 6 W 9

=

1234

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 = −jX (0)X (1)X (2)X (3)

=

1 1 1 11 −j −1 j1 −1 1 −11 j −1 −j

1234

=

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

Page 59: Discrete Fourier Transforms (DFT)

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∑k=0

X (k)e2πN

kn for n = 0, 1..,N − 1

x(n) =1

N

N−1∑k=0

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

x(0) =1

4

N−1∑k=0

X (k)e j0 = X (0)e j0 + X (1)e j0 + X (2)e j0 + X (3)e j0

=1

4(10 + (−2 + j2)− 2 + (−2− j2)) = 1

x(1) =1

4

N−1∑k=0

X (k)e j kπ2 = X (0)e j0 + X (1)e j π

2 + X (2)e jπ + X (3)e j 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

Page 60: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

x(2) =1

4

N−1∑k=0

X (k)e j kπ2 = X (0)e j0 + X (1)e jπ + X (2)e j2π + X (3)e j3π

=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∑k=0

X (k)e j kπ32 = X (0)e j0 + X (1)e j 3π

2 + X (2)e j3π + X (3)e j 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

Page 61: Discrete Fourier Transforms (DFT)

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

X (0)X (1)X (2)X (3)

=

1 1 1 11 −j −1 j1 −1 1 −11 j −1 −j

11−1−1

=

02− 2j02 + 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

Page 62: Discrete Fourier Transforms (DFT)

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∑k=0

X (k)W−knN for n = 0, 1..,N − 1 where W = e−

2πN

N=4 The matrix notation is

[WN ] =

1 1 1 11 −j −1 j1 −1 1 −11 j −1 −j

[W ∗N ] =

1 1 1 11 j −1 −j1 −1 1 −11 −j −1 j

x(0)x(1)x(2)x(3)

=1

N

1 1 1 11 j −1 −j1 −1 1 −11 −j −1 j

02− 2j02 + 2j

=

11−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

Page 63: Discrete Fourier Transforms (DFT)

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∑

n=0x(n)e0 =

[1e0 + 2e0 + 2e0 + 1e0

]= [1 + 2 + 2 + 1] = 6

X (1) =3∑

n=0x(n)e−j 2πn

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

]= [1− j2− 2 + j1] = [−1− j1]

X (2) =3∑

n=0x(n)e

−j4πn4 =

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

]= [1− 2 + 2− 1] = [0] = 0

X (3) =3∑

n=0x(n)e

−j6πn4 =

[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

Page 64: Discrete Fourier Transforms (DFT)

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) = 14

3∑n=0

x(n)e0 =[6e0 + (−1− j1)e0 + 0e0 + (−1 + j1)e0

]= 1

4[6−1− j1+0−1+ j1] = 1

X (1) = 14

3∑n=0

x(n)e j 2πn4 =

[6e0 + (−1− j1)e jπ/2 + 0e jπ + (−1 + j1)e j3π/2

]=

14

[6− j + 1 + j + 1] = [2]

X (2) = 14

3∑n=0

x(n)ej4πn

4 =[6e0 + (−1− j1)e jπ + 0e j2π + (−1 + j1)e j3π

]=

14

[6 + (−1− j1)(j) + 0 + (−1 + j)(−j)] = 14

[6− j1 + 1 + 0 + 1 + j] = [2]

X (3) = 14

3∑n=0

x(n)e−j6πn

4 =[6e0 + (−1− j1)e j3π/2 + 0e j3π + (−1 + j1)e j9π/2

]=

14

[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, 5]September 11, 2014 64 / 91

Page 65: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Continuous Time Fourier Transform (CTFT)

X (jω) =

∞∫−∞

x(t)e−jωt dt

x(t) =1

∞∫−∞

X (jω)e jωt dω

Discrete Time Fourier Transform (DTFT)

X (e jω) =∞∑−∞

x(n)e−jωn

x(n) =1

∫2π

X (e jω)e jωndω

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

Page 66: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Unit sample δ(n)

x(n) =

1 for n = 00 for n 6= 0

X (k) =

N−1∑x=0

x(n)e−j 2πN

nk

=

N−1∑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

Page 67: Discrete Fourier Transforms (DFT)

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=0

x(n)e−j 2πN

nk

=

N−1∑x=0

ane−j 2πN

nk =

N−1∑x=0

(ae−j 2πkN )n

X (k) =1− aN e−j2πk

1− ae−j2πk/N

(Using series expansion

N−1∑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

Page 68: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

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

)

Solution:x(0) = cos(0) = 1x(1) = cos( 1π

4) = 0.707

x(2) = cos( 2π4

) = 0

x(3) = cos( 3π4

) = −0.707x(0)x(1)x(2)x(3)

=1

N

1 1 1 11 −j −1 j1 −1 1 −11 j −1 −j

10.7070−0.707

=

11− j1.41411 + j1.414

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

Page 69: Discrete Fourier Transforms (DFT)

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

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

Page 70: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

Find the Fourier Transform of the sequence

x[n] =

1 0 ≤ n ≤ 40 else

X(

e jw)

=∞∑

n=−∞x [n] e−jwn

X(

e jω)

= e−j2ω sin (5ω/2)

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(

e jw)

=∞∑

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

∞∑n=0

(0.5)n (1)e−jwn

=∞∑

n=0

(0.5e jw

)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

Page 71: Discrete Fourier Transforms (DFT)

Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)

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

)

Solution:x(0) = 4 + cos2(0) = 5x(1) = 4 + cos2( 2π1

10) = 4.6545

x(2) = 4 + cos2( 2π210

) = 4.09549

x(3) = 4 + cos2( 2π310

) = 4.09549

x(4) = 4 + cos2( 2π410

) = 4.09549

x(5) = 4 + cos2( 2π510

) = 5

x(6) = 4 + cos2( 2π610

) = 4.6545

x(7) = 4 + cos2( 2π710

) = 4.09549

x(8) = 4 + cos2( 2π810

) = 4.09549

x(9) = 4 + cos2( 2π910

) = 4.6545x(n) = x(N − n)Cosine function is even functionx(n) = x(−n)

X (k) =

N−1∑n=0

x(n)cos

(2πkn

N

)0 ≤ k ≤ N − 1

X (k) =

N−1∑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

Page 72: Discrete Fourier Transforms (DFT)

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

Page 73: Discrete Fourier Transforms (DFT)

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∑n=0

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

IDFT expression is

x(n) =1

N

N−1∑k=0

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

Fourier series is

xp(n) =

N−1∑k=0

ck e j 2πN

nk −∞ ≤ n ≤ ∞ (3)

Fourier series coefficients are expressed as:

ck =1

N

N−1∑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

Page 74: Discrete Fourier Transforms (DFT)

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 (ω) =∞∑

n=−∞x(n)−jωn −∞ ≤ n ≤ ∞ (5)

X (k) = X (ω|ω=2πk/N ) =∞∑

n=−∞x(n)−j 2π

Nnk −∞ ≤ n ≤ ∞ (6)

DFT coefficients are expressed as:

xp(n) =∞∑

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

xp(n) is determined by aliasing x(n) over the interval 0 ≤ n ≤ N − 1. The finite durationsequence

x(n) =

xp(n) 0 ≤ n ≤ N − 10 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

Page 75: Discrete Fourier Transforms (DFT)

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) =∞∑

n=−∞x(n)z−n (8)

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 (z)|zk = e j2πk/N =∞∑

n=−∞x(n)e−j2πkn/N (10)

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

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

n=0

x(n)e−j2πkn/N (11)

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

Page 76: Discrete Fourier Transforms (DFT)

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∑n=0

x(n)y∗(n) =1

N

N−1∑k=0

X (k)Y ∗(k) (13)

When x(n)=y(n)N−1∑n=0

|x(n)|2 =1

N

N−1∑k=0

|X (k)|2 (14)

This equation give the energy of finite duration sequence it terms of its frequencycomponents

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

Page 77: Discrete Fourier Transforms (DFT)

Problems and Solutions on DFT Problems and Solutions on DFT

Determine the DFT of the sequence for N=8, h(n) =

12

− 2 ≤ n ≤ 20 otherwise

Plot the magnitude and phase response for N=8Solution:

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

Page 78: Discrete Fourier Transforms (DFT)

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 newsequences x(n)

( )ph n

-2 -1 0 1 2 3 4 5 n

( )h n

12

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 − 10 Otherwise

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

Page 79: Discrete Fourier Transforms (DFT)

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 11 W 1

8 W 28 W 3

8 W 48 W 5

8 W 68 W 7

81 W 2

8 W 48 W 6

8 W 88 W 10

8 W 128 W 14

81 W 3

8 W 68 W 9

8 W 128 W 15

8 W 188 W 21

81 W 4

8 W 88 W 12

8 W 168 W 20

8 W 248 W 28

81 W 5

8 W 108 W 15

8 W 208 W 25

8 W 308 W 35

81 W 6

8 W 128 W 18

8 W 248 W 30

8 W 368 W 42

81 W 7

8 W 148 W 21

8 W 288 W 35

8 W 428 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

Page 80: Discrete Fourier Transforms (DFT)

Problems and Solutions on DFT Problems and Solutions on DFT

W 08 = W 8

8 = W 168 = W 24

8 = W 408 ... = 1

W 18 = W 9

8 = W 178 = W 25

8 = W 338 ... = 1√

2− j 1√

2

W 28 = W 10

8 = W 188 = W 26

8 = W 348 ... = −j

W 38 = W 11

8 = W 198 = W 27

8 = W 358 ... = − 1√

2− j 1√

2

W 48 = W 12

8 = W 208 = W 28

8 = W 368 ... = −1

W 58 = W 13

8 = W 218 = W 29

8 = W 378 ... = − 1√

2+ j 1√

2

W 68 = W 14

8 = W 228 = W 30

8 = W 388 ... = j

W 78 = W 15

8 = W 238 = W 31

8 = W 398 ... = 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√

2j 1√

2+ j 1√

21 −j −1 j 1 −j −1 j

1 − 1√2− j 1√

2j 1√

2− j 1√

21 1√

2+ j 1√

2−j − 1√

2+ j 1√

21 −1 1 −1 1 −1 1 −1

1 − 1√2

+ j 1√2

−j 1√2

+ j 1√2

−1 1√2− j 1√

2j − 1√

2− j 1√

21 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

=

1212120001212

2.51.207−0.5−0.2070.5−0.207−0.51.207

=

2.5∠01.207∠00.5∠− 1800.207∠− 1800.5∠00.207∠− 1800.5∠− 1801.207∠0

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

Page 81: Discrete Fourier Transforms (DFT)

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(ω) =∞∑

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

=∞∑

n=−∞anu(n)e−jωn

=∞∑

n=0

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

N−1∑k=0

ak =

N for a = 11−aN

1−afor 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

Page 82: Discrete Fourier Transforms (DFT)

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) =∞∑

l=−∞h(n − lN)

Consider l=-p

hp(n) =

−∞∑l=∞

h(n + pN) hp(n) =∞∑

l=−∞h(n + pN)

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

H(k) =

N−1∑n=0

h(n)e−j 2πN

kn

H(k) =

N−1∑n=0

∞∑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

Page 83: Discrete Fourier Transforms (DFT)

Problems and Solutions on DFT Problems and Solutions on DFT

H(k) =

N−1∑n=0

∞∑n=−∞

a(n+pN)u(n + pN)

e−j 2πN

kn

=

N−1∑n=0

[ ∞∑n=0

a(n+pN)

]e−j 2π

Nkn ∵ u(n) = 0 for n < 0

=

N−1∑n=0

[ ∞∑n=0

anapN

]e−j 2π

Nkn

Interchanging the summations

H(k) =∞∑

n=0

apNN−1∑n=0

ane−j 2πN

kn

N∑k=0

ak =1− aN

1− a

∞∑p=0

apN =∞∑

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

Page 84: Discrete Fourier Transforms (DFT)

Problems and Solutions on DFT Problems and Solutions on DFT

N−1∑n=0

ane−j 2πN

kn =

N−1∑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∑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

Page 85: Discrete Fourier Transforms (DFT)

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 − 10 Otherwise

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

Page 86: Discrete Fourier Transforms (DFT)

Problems and Solutions on DFT Problems and Solutions on DFT

DFT expression is

X (k) =

N−1∑n=0

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

=

N−1∑n=0

1e−j2πkn/N

=

N−1∑n=0

(e−j2πk/N )n (1)

[N−1∑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∑n=0

(1)n = N

X (k) =

0 when k 6= 0N 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

Page 87: Discrete Fourier Transforms (DFT)

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∑

k=0X (k) iv)

7∑k=0|X (k)|2

X(0) is

X (k) =

N−1∑n=0

x(n)e−j2πkn/N

with k=0 and N=8

X (0) =

N−1∑n=0

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

X(4) is

X (k) =

N−1∑n=0

x(n)e−j2πkn/N

with k=4 and N=8

X (4) =

N−1∑n=0

x(n)e−j2π4n/8 =

N−1∑n=0

x(n)e−jπn =

N−1∑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

Page 88: Discrete Fourier Transforms (DFT)

Problems and Solutions on DFT Problems and Solutions on DFT

iii)7∑

k=0X (k)

We Know the IDFT expression as

x(n) =1

N

N−1∑n=0

X (k)e j2πkn/N

With n=0 and N=8 it becomes

x(0) =1

8

N−1∑n=0

X (k)

∴N−1∑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

Page 89: Discrete Fourier Transforms (DFT)

Problems and Solutions on DFT Problems and Solutions on DFT

The value of7∑

k=0|X (k)|2 is

The expression for Parseval’s theorem is

N−1∑n=0

|x(n)|2 =1

N

N−1∑k=0

|X (k)|2

7∑k=0|X (k)|2is related as

N−1∑n=0

|x(n)|2 =1

N

N−1∑k=0

|X (k)|2

N=8 Then

7∑n=0

|x(n)|2 =1

8

7∑k=0

|X (k)|2

7∑k=0

|X (k)|2 = 87∑

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

Page 90: Discrete Fourier Transforms (DFT)

Thank You

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

Page 91: Discrete Fourier Transforms (DFT)

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