digital signal processing - wordpress.com...digital signal processing chapter 5 1. frequency...

49
Digital Signal Processing Chapter 5 : The Analysis of Signals and Systems in Frequency Domain Vinh Pham-Xuan Ho Chi Minh city University of Technology Department of Telecommunications

Upload: others

Post on 21-Feb-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital Signal Processing

Chapter 5: The Analysis of Signals and Systems in Frequency Domain

Vinh Pham-Xuan

Ho Chi Minh city University of Technology

Department of Telecommunications

Page 2: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

- If not overlapping:

๐‘‡ ๐‘‹ ๐‘“ = ๐‘‹ ๐‘“ where โˆ’๐‘“๐‘ 

2โ‰ค ๐‘“ โ‰ค

๐‘“๐‘ 

2.

- If overlapping:

๐‘‡ ๐‘‹ ๐‘“ = ๐‘‹ ๐‘“ + ๐‘‹ ๐‘“ + ๐‘“๐‘  + ๐‘‹ ๐‘“ โˆ’ ๐‘“๐‘  + โ‹ฏ where โˆ’๐‘“๐‘ 

2โ‰ค ๐‘“ โ‰ค

๐‘“๐‘ 

2.

In terms of the time samples ๐‘ฅ ๐‘›๐‘‡ , the original sampled spectrum ๐‘‹ ๐‘“are given by:

๐‘‹ ๐‘“ =

๐’=โˆ’โˆž

โˆž

๐‘ฅ ๐‘›๐‘‡ ๐‘’โˆ’2๐œ‹๐‘—๐‘“๐‘›๐‘‡

2

sampler and quantizer

analog lowpass filter

๐‘ฅ๐‘–๐‘› ๐‘กanalog signal

๐‘ฅ ๐‘กbandlimited

signal

๐‘ฅ ๐‘›๐‘‡sampled

signal

๐‘‹ ๐‘“ ๐‘‹ ๐‘“

Page 3: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

However, in practice only a finite number of samples are retained, say๐‘ฅ ๐‘›๐‘‡ , 0 โ‰ค ๐‘› โ‰ค ๐ฟ โˆ’ 1.

The duration of the data record to be:๐‘‡๐ฟ = ๐ฟ๐‘‡

What is the difference between the frequency spectrum of the infinitesignal and the truncated signal?

3

Page 4: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

The spectrum of time-windowed signal ๐‘‹๐ฟ ๐‘“ are given by:

๐‘‹๐ฟ ๐‘“ =

๐‘›=0

๐ฟ

๐‘ฅ ๐‘›๐‘‡ ๐‘’โˆ’2๐œ‹๐‘—๐‘“๐‘›๐‘‡

๐‘‹ ๐‘“ =

๐‘›=โˆ’โˆž

โˆž

๐‘ฅ ๐‘›๐‘‡ ๐‘’โˆ’2๐œ‹๐‘—๐‘“๐‘›๐‘‡

๐‘‹๐ฟ ๐‘“ =

๐‘›=0

๐ฟ

๐‘ฅ ๐‘›๐‘‡ ๐‘’โˆ’2๐œ‹๐‘—๐‘“๐‘›๐‘‡

๐‘‹๐ฟ ๐‘“ is an approximation of ๐‘‹ ๐‘“ . The accuracy increases with thenumber of samples retained.

4

Page 5: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

We can express ๐‘‹๐ฟ ๐‘“ as follows:

๐‘‹๐ฟ ๐‘“ =

๐‘›=โˆ’โˆž

โˆž

๐‘ฅ๐ฟ ๐‘› ๐‘’โˆ’2๐œ‹๐‘—๐‘“๐‘›๐‘‡

where๐‘ฅ๐ฟ ๐‘› = ๐‘ฅ ๐‘› ๐‘ค ๐‘›

where

๐‘ค ๐‘› = 1, if 0 โ‰ค ๐‘› โ‰ค ๐ฟ โˆ’ 10, otherwise

Therefore, the discrete-time Fourier transform of the windowed signal is:

๐‘‹๐ฟ ๐œ” =

๐‘›=โˆ’โˆž

โˆž

๐‘ฅ๐ฟ ๐‘› ๐‘’โˆ’๐‘—๐œ”๐‘›

5

Page 6: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

Using the property that the Fourier transform of the product of two timefunctions is the convolution of their Fourier transforms, we obtain thefrequency-domain version of ๐‘ฅ๐ฟ ๐‘› = ๐‘ฅ ๐‘› ๐‘ค ๐‘› .

๐‘‹๐ฟ ๐œ” =

โˆ’๐œ‹

๐œ‹

๐‘‹ ๐œ”โ€ฒ ๐‘Š ๐œ” โˆ’ ๐œ”โ€ฒ ๐‘‘๐œ”2๐œ‹

where ๐‘Š ๐œ” is the DTFT of the rectangular window ๐‘ค ๐‘› , that is

๐‘Š ๐œ” =

๐‘›=0

๐ฟโˆ’1

๐‘ค ๐‘› ๐‘’โˆ’๐‘—๐œ”๐‘›

6

Page 7: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

It can be thought of as the evaluation of the z-transform on the unit circleat ๐‘ง = ๐‘’๐‘—๐œ”. Setting ๐‘ค ๐‘› = 1 in the sum, we find:

๐‘Š ๐‘ง =

๐‘›=0

๐ฟโˆ’1

๐‘ค ๐‘› ๐‘งโˆ’๐‘› =1 โˆ’ ๐‘งโˆ’๐ฟ

1 โˆ’ ๐‘งโˆ’1

Setting ๐‘ง = ๐‘’๐‘—๐œ”, we find for ๐‘Š ๐œ” :

๐‘Š ๐œ” =1 โˆ’ ๐‘’โˆ’๐‘—๐ฟ๐œ”

1 โˆ’ ๐‘’โˆ’๐‘—๐œ”=

sin ๐œ”๐ฟ/2

sin ๐œ”/2๐‘’โˆ’๐‘—๐œ” ๐ฟโˆ’1 /2

7

Page 8: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

The magnitude spectrum ๐‘Š ๐œ” is

It consists of a mainlobe of height ๐ฟ and base width 4๐œ‹/๐ฟ centered at ๐œ” =0, and several smaller sidelobes.

8

Page 9: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

Consider the case of a single analog complex sinusoid of frequency ๐‘“1 andits sample version:

๐‘ฅ ๐‘ก = ๐‘’2๐œ‹๐‘—๐‘“1๐‘ก, โˆ’โˆž โ‰ค ๐‘ก โ‰ค โˆž

๐‘ฅ ๐‘› = ๐‘’2๐œ‹๐‘—๐‘“1๐‘›๐‘‡ = ๐‘’๐‘—๐œ”1๐‘›, โˆ’โˆž โ‰ค ๐‘› โ‰ค โˆž

๐‘ฅ๐ฟ ๐‘› = ๐‘’2๐œ‹๐‘—๐‘“1๐‘›๐‘‡ = ๐‘’๐‘—๐œ”1๐‘›, 0 โ‰ค ๐‘› โ‰ค ๐ฟ โˆ’ 1

Fourier transform of the cosine (continuous function):๐‘ฅ ๐‘ก = ๐‘’2๐œ‹๐‘—๐‘“1๐‘ก โ†’ ๐›ฟ ๐‘“ โˆ’ ๐‘“1

Assuming that ๐‘“1 lies within the Nyquist interval:

๐‘‹ ๐œ” = ๐‘‹ ๐‘“ =1

๐‘‡๐‘‹ ๐‘“ =

1

๐‘‡๐›ฟ ๐‘“ โˆ’ ๐‘“1

We can express the spectrum in terms of the digital frequency as follows:

๐‘‹ ๐œ” = 2๐œ‹๐›ฟ ๐œ” โˆ’ ๐œ”1 =1

๐‘‡2๐œ‹๐‘‡๐›ฟ 2๐œ‹๐‘‡๐‘“ โˆ’ 2๐œ‹๐‘‡๐‘“1 =

1

๐‘‡๐›ฟ ๐‘“ โˆ’ ๐‘“1

9

Page 10: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

The spectrum of the truncated signal:

๐‘‹๐ฟ ๐œ” =

โˆ’๐œ‹

๐œ‹

๐‘‹ ๐œ”โ€ฒ ๐‘Š ๐œ” โˆ’ ๐œ”โ€ฒ๐‘‘๐œ”

2๐œ‹=

โˆ’๐œ‹

๐œ‹

2๐œ‹๐›ฟ ๐œ” โˆ’ ๐œ”1 ๐‘Š ๐œ” โˆ’ ๐œ”โ€ฒ๐‘‘๐œ”

2๐œ‹

๐‘‹๐ฟ ๐œ” = ๐‘Š ๐œ” โˆ’ ๐œ”1

10

Page 11: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

When ๐‘ฅ ๐‘ก is a linear combination of two complex sinusoids, withfrequency ๐‘“1 and ๐‘“2 and amplitudes ๐ด1 and ๐ด2

11

Page 12: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

Two sharp spectral lines are replaced by their smeared versions.

The frequency separation โˆ†๐‘“ = ๐‘“1 โˆ’ ๐‘“2 of the two sinusoids to be largeenough so the main lobes are distinct and do not overlap.

12

Page 13: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

However, if โˆ†๐‘“ is decreased, the main lobes will begin merging with eachother and will not appear as distinct. This will start to happen when โˆ†๐‘“ isapproximately equal to the mainlobe width โˆ†๐‘“๐‘ค

13

Page 14: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

The resolvability condition that the two sinusoids appear as two distinctones is that their frequency separation โˆ†๐‘“ be greater than the mainlobewidth: โˆ†๐‘“ โ‰ฅ โˆ†๐‘“๐‘ค = ๐‘“๐‘ 

๐ฟ

14

Page 15: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

a. Mathematical approach

The windowing process has two major effects:

- Reducing the frequency resolution of the computed spectrum, in thesense that the smallest resolvable frequency difference is limited by thelength of the data record, that is, โˆ†๐‘“ = 1 ๐‘‡๐ฟ .

- Introducing spurious high-frequency components into the spectrum,which are caused by the sharp clipping of the signal ๐‘ฅ ๐‘› at the left andright ends of the rectangular window. This effect is referred to asโ€œfrequency leakageโ€.

15

Page 16: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

b. Windowing

Requirement: suppressing the sidelobes as much as possible becausethey may be confused with the main lobes of weaker sinusoids that mightbe present.

16

Page 17: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

b. Windowing

The standard technique for suppressing the sidelobes is to use a non-rectangular window โ€“ a window that cuts off to zero less sharply andmore gradually than the rectangular one.

โ€ข Hamming window:

๐‘ค ๐‘› = 0.54 โˆ’ 0.46 cos 2๐œ‹๐‘›

๐ฟโˆ’1, if 0 โ‰ค ๐‘› โ‰ค ๐ฟ โˆ’ 1

0, otherwise

Because of the gradual transition to zero, the high frequencies that areintroduced by the windowing process are deemphasized. (The sidelobes are stillpresent, but are barely visible because they are suppressed relative to the mainlobeby 40dB).

The main tradeoff in using any type of non-rectangular window is that its mainlobebecomes wider and shorter, thus reducing the frequency resolution capability ofthe windowed spectrum.

17

Page 18: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

1. Frequency Resolution and Windowing

b. Windowing

โ€ข Hamming window:

๐‘ค ๐‘› = 0.54 โˆ’ 0.46 cos 2๐œ‹๐‘›

๐ฟโˆ’1, if 0 โ‰ค ๐‘› โ‰ค ๐ฟ โˆ’ 1

0, otherwise

For any type of window, the effective width of the mainlobe is still inverselyproportional to the window length:

โˆ†๐‘“๐‘ค = ๐‘๐‘“๐‘ ๐ฟ

= ๐‘1

๐‘‡๐ฟ

where the constant c depends on the window used and is always ๐‘ โ‰ฅ 1.

18

Page 19: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

2. DTFT Computation

a. Discrete-time Fourier Transform (DTFT)

The Fourier transform of the finite-energy discrete-time signal ๐‘ฅ ๐‘› isdefined as:

๐‘‹ ๐œ” =

๐‘›=โˆ’โˆž

โˆž

๐‘ฅ ๐‘› ๐‘’โˆ’๐‘—๐œ”๐‘›

where ๐œ” = 2๐œ‹๐‘“ ๐‘“๐‘ 

The spectrum ๐‘‹ ๐œ” is in general a complex-valued function of frequency:

๐‘‹ ๐œ” = ๐‘‹ ๐œ” ๐‘’๐‘—๐œƒ ๐œ”

where ๐œƒ ๐œ” = arg ๐‘‹ ๐œ” with โˆ’๐œ‹ โ‰ค ๐œƒ ๐œ” โ‰ค ๐œ‹

๐‘‹ ๐œ” : is the magnitude spectrum

๐œƒ ๐œ” : is the phase spectrum

19

Page 20: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

2. DTFT Computation

a. Discrete-time Fourier Transform (DTFT)

๐‘‹ ๐œ” is periodic with a period of 2๐œ‹

๐‘‹ ๐œ” + 2๐œ‹๐‘˜ =

๐‘›=โˆ’โˆž

โˆž

๐‘ฅ ๐‘› ๐‘’โˆ’๐‘— ๐œ”+2๐œ‹๐‘˜ ๐‘› =

๐‘›=โˆ’โˆž

โˆž

๐‘ฅ ๐‘› ๐‘’โˆ’๐‘—๐œ”๐‘› = ๐‘‹ ๐œ”

The frequency range for discrete-time signal is unique over the frequencyinterval โˆ’๐œ‹, ๐œ‹ or equivalently 0,2๐œ‹ .

Remarks: Spectrum of discrete-time signals is continuous and periodic.

20

Page 21: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

2. DTFT Computation

b. Inverse discrete-time Fourier transform (IDTFT)

Given the frequency spectrum ๐‘‹ ๐œ” , we can find the ๐‘ฅ ๐‘› in time-domainas:

๐‘ฅ ๐‘› =1

2๐œ‹ โˆ’๐œ‹

๐œ‹

๐‘‹ ๐œ” ๐‘’๐‘—๐œ”๐‘›๐‘‘๐œ”

which is known as inverse discrete-time Fourier transform (IDFT).

21

Page 22: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

2. DTFT Computation

c. Properties of DTFT

Symmetry: if the signal ๐‘ฅ ๐‘› is real, it easily follows that: ๐‘‹ ๐œ” = ๐‘‹ โˆ’๐œ”

or equivalently: ๐‘‹ โˆ’๐œ” = ๐‘‹ ๐œ” (even symmetry)

arg ๐‘‹ โˆ’๐œ” = โˆ’arg ๐‘‹ ๐œ” (odd symmetry)

We conclude that the frequency range of real discrete-time signalscan be limited further to the range 0 โ‰ค ๐œ” โ‰ค ๐œ‹ or 0 โ‰ค ๐‘“ โ‰ค ๐‘“๐‘  2.

Energy density of spectrum: the energy relation between ๐‘ฅ ๐‘› and ๐‘‹ ๐œ”is given by Parsevalโ€™s relation

๐ธ๐‘ฅ =

๐‘›=โˆ’โˆž

โˆž

๐‘ฅ ๐‘› 2 =1

2๐œ‹ โˆ’๐œ‹

๐œ‹

๐‘‹ ๐œ” 2๐‘‘๐œ”

๐‘†๐‘ฅ๐‘ฅ ๐œ” = ๐‘‹ ๐œ” 2 is called the energy density spectrum of ๐‘ฅ ๐‘› .

22

Page 23: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

2. DTFT Computation

c. Properties of DTFT

The relationship of DTFT and z-transform: if ๐‘‹ ๐‘ง converges for ๐‘ง = 1,then

๐‘‹ ๐‘ง๐‘ง=๐‘’๐‘—๐œ”

=

๐‘›=โˆ’โˆž

โˆž

๐‘ฅ ๐‘› ๐‘’โˆ’๐‘—๐œ”๐‘› = ๐‘‹ ๐œ”

Linearity:

if ๐‘ฅ1 ๐‘› ๐น

๐‘‹1 ๐œ”

๐‘ฅ2 ๐‘› ๐น

๐‘‹2 ๐œ”

then ๐‘ฅ1 ๐‘› + ๐‘ฅ2 ๐‘› ๐น

๐‘‹1 ๐œ” + ๐‘‹2 ๐œ”

Time-shifting:

if ๐‘ฅ ๐‘› ๐น

๐‘‹ ๐œ”

then ๐‘ฅ ๐‘› โˆ’ ๐‘˜ ๐น

๐‘‹ ๐œ” ๐‘’โˆ’๐‘—๐œ”๐‘˜

23

Page 24: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

2. DTFT Computation

c. Properties of DTFT

Time reversal:

if ๐‘ฅ ๐‘› ๐น

๐‘‹ ๐œ”

then ๐‘ฅ โˆ’๐‘› ๐น

๐‘‹ โˆ’๐œ”

Convolution theory:

if ๐‘ฅ1 ๐‘› ๐น

๐‘‹1 ๐œ”

๐‘ฅ2 ๐‘› ๐น

๐‘‹2 ๐œ”

then ๐‘ฅ1 ๐‘› โˆ— ๐‘ฅ2 ๐‘› ๐น

๐‘‹1 ๐œ” ๐‘‹2 ๐œ”

24

Page 25: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

โ€ข ๐‘‹ ๐œ” is a continuous function of frequency and therefore, it is not acomputationally convenient representation of the sequence ๐‘ฅ ๐‘› .

โ€ข DFT will present ๐‘ฅ ๐‘› in a frequency-domain by samples of its spectrum๐‘‹ ๐œ” .

โ€ข A finite-duration sequence ๐‘ฅ ๐‘› of length ๐ฟ has a Fourier transform:

๐‘‹ ๐œ” =

๐‘›=0

๐ฟโˆ’1

๐‘ฅ ๐‘› ๐‘’โˆ’๐‘—๐œ”๐‘›

where 0 โ‰ค ๐œ” โ‰ค 2๐œ‹.

Sampling ๐‘‹ ๐œ” at equally spaced frequency ๐œ”๐‘˜ = 2๐œ‹๐‘˜๐‘, ๐‘˜ = 0,1, โ€ฆ , ๐‘ โˆ’

1 where ๐‘ โ‰ฅ ๐ฟ, we obtain N-point DFT of length L-signal:

๐‘‹ ๐‘˜ = ๐‘‹2๐œ‹๐‘˜

๐‘=

๐‘›=0

๐ฟโˆ’1

๐‘ฅ ๐‘› ๐‘’โˆ’๐‘—2๐œ‹๐‘˜๐‘›

๐‘

โ€ข DFT presents the discrete-frequency samples of spectra of discrete-timesignals.

25

Page 26: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

In principles, the two lengths L and N can be specified independently ofeach other:

โ€ข ๐ฟ is the number of time samples in the data record and can even beinfinite.

โ€ข ๐‘ is the number of frequencies at which we choose to evaluate the DFT.

Most discussions of the DFT assume that ๐‘ณ = ๐‘ต.

โ€ข If ๐ฟ < ๐‘, we can pad ๐‘ โˆ’ ๐ฟ zeros at the end of the data record the makeit of length ๐‘.

โ€ข If ๐ฟ > ๐‘, we may reduce the data record to length ๐‘ by wrapping itmodulo-N.

26

Page 27: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

a. Zero padding

Padding any number of zeros at the end of a signal has no effect on it DFT.For example, padding ๐ท zeros will result into a length of (๐ฟ + ๐ท) signal:

๐‘ฅ = ๐‘ฅ0, ๐‘ฅ1, ๐‘ฅ2, โ€ฆ , ๐‘ฅ๐ฟโˆ’1

๐‘ฅ๐ท = ๐‘ฅ0, ๐‘ฅ1, ๐‘ฅ2, โ€ฆ , ๐‘ฅ๐ฟโˆ’1, 0,0, โ€ฆ , 0

Because ๐‘ฅ๐ท ๐‘› = ๐‘ฅ ๐‘› for 0 โ‰ค ๐‘› โ‰ค ๐ฟ โˆ’ 1 and ๐‘ฅ๐ท ๐‘› = 0 for ๐ฟ โ‰ค ๐‘› โ‰ค ๐ฟ +๐ท โˆ’ 1, the corresponding DTFTs will remain the same:

๐‘‹๐ท ๐œ” =

๐‘›=0

๐ฟ+๐ทโˆ’1

๐‘ฅ๐ท ๐‘› ๐‘’โˆ’๐‘—๐œ”๐‘› =

๐‘›=0

๐ฟโˆ’1

๐‘ฅ๐ท ๐‘› ๐‘’โˆ’๐‘—๐œ”๐‘› +

๐‘›=๐ฟ

๐ฟ+๐ทโˆ’1

๐‘ฅ๐ท ๐‘› ๐‘’โˆ’๐‘—๐œ”๐‘›

=

๐‘›=0

๐ฟโˆ’1

๐‘ฅ ๐‘› ๐‘’โˆ’๐‘—๐œ”๐‘› = ๐‘‹ ๐œ”

27

Page 28: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

a. Zero padding

โ€ข With the assumption ๐‘ฅ ๐‘› = 0 for ๐‘› โ‰ฅ ๐ฟ, we can write the DFT asfollows:

๐‘‹ ๐‘˜ =

๐‘›=0

๐‘โˆ’1

๐‘ฅ ๐‘› ๐‘’โˆ’๐‘—2๐œ‹๐‘˜๐‘›/๐‘ ; ๐‘˜ = 0,1, โ€ฆ , ๐‘ โˆ’ 1

โ€ข The sequence ๐‘ฅ ๐‘› can recover from the frequency samples by inverseDFT (IDFT)

๐‘ฅ ๐‘› =1

๐‘

๐‘˜=0

๐‘โˆ’1

๐‘‹ ๐‘˜ ๐‘’๐‘—2๐œ‹๐‘˜๐‘›/๐‘ ; ๐‘› = 0,1, โ€ฆ , ๐‘ โˆ’ 1

28

Page 29: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

b. Matrix form of DFT

โ€ข By defining an ๐‘๐‘กโ„Ž root of unity ๐‘Š๐‘ = ๐‘’โˆ’๐‘—2๐œ‹/๐‘, we can write DFT andIDFT as follows:

๐‘‹ ๐‘˜ =

๐‘›=0

๐‘โˆ’1

๐‘ฅ ๐‘› ๐‘Š๐‘๐‘˜๐‘› ; ๐‘˜ = 0,1, โ€ฆ , ๐‘ โˆ’ 1

๐‘ฅ ๐‘› =1

๐‘

๐‘›=0

๐‘โˆ’1

๐‘‹ ๐‘˜ ๐‘Š๐‘โˆ’๐‘˜๐‘› ; ๐‘› = 0,1, โ€ฆ , ๐‘ โˆ’ 1

29

Page 30: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

b. Matrix form of DFT

โ€ข Let us define:

๐ฑ๐‘ =

๐‘ฅ 0๐‘ฅ 1

โ‹ฎ๐‘ฅ ๐‘ โˆ’ 1

and ๐—๐‘ =

๐‘‹ 0๐‘‹ 1

โ‹ฎ๐‘‹ ๐‘ โˆ’ 1

The N-point DFT can be expressed in matrix form as: ๐—๐‘ = ๐‘พ๐‘๐ฑ๐‘ where

๐‘Š๐‘ =

1 1 1 โ‹ฏ 11 ๐‘Š๐‘ ๐‘Š๐‘

2 โ‹ฏ ๐‘Š๐‘๐‘โˆ’1

1 ๐‘Š๐‘2 ๐‘Š๐‘

4 โ‹ฏ ๐‘Š๐‘2 ๐‘โˆ’1

โ‹ฎ โ‹ฎ โ‹ฎ โ‹ฑ โ‹ฎ

1 ๐‘Š๐‘๐‘โˆ’1 ๐‘Š๐‘

2 ๐‘โˆ’1โ‹ฏ ๐‘Š๐‘

๐‘โˆ’1 ๐‘โˆ’1

30

Page 31: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

c. Modulo-N reduction

The modulo-N reduction or wrapping of a signal is defined by

โ€ข dividing the signal ๐ฑ into contiguous non-overlapping blocks of length ๐‘

โ€ข wrapping the blocks around to be time-aligned with the first block

โ€ข adding them up

31

Page 32: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

c. Modulo-N reduction

Ex: Determine the mod-4 and mod-3 reductions of the length-8 signalvector

๐ฑ = [1,2, โˆ’2,3,4, โˆ’2, โˆ’1,1]

32

Page 33: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

c. Modulo-N reduction

We may express the sub-block components in terms of the time samples ofthe signal ๐‘ฅ ๐‘› as follows:

๐‘ฅ๐‘š ๐‘› = ๐‘ฅ ๐‘š๐‘ + ๐‘› , ๐‘› = 0,1, โ€ฆ , ๐‘ โˆ’ 1

The wrapped vector ๐ฑ will be in this notation: ๐‘ฅ ๐‘› = ๐‘ฅ0 ๐‘› + ๐‘ฅ1 ๐‘› + ๐‘ฅ2 ๐‘› + ๐‘ฅ3 ๐‘› + โ‹ฏ

= ๐‘ฅ ๐‘› + ๐‘ฅ ๐‘ + ๐‘› + ๐‘ฅ 2๐‘ + ๐‘› + ๐‘ฅ 3๐‘ + ๐‘› + โ‹ฏ

or, more compactly,

๐‘ฅ ๐‘› =

๐‘š=0

โˆž

๐‘ฅ ๐‘š๐‘ + ๐‘›

๐‘› = 0,1, โ€ฆ , ๐‘ โˆ’ 1

33

Page 34: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

c. Modulo-N reduction

The connection of the mod-N reduction to the DFT is the theorem that thelength-N wrapped signal ๐ฑ has the same N-point DFT as the originalunwrapped signal ๐ฑ.

We define the DFT matrices ๐€ and ๐€ as follows: ๐— = ๐€ ๐ฑ๐— = ๐€๐ฑ

The size of ๐‘จ is ๐‘ ร— ๐‘.

The size of ๐€ is ๐‘ ร— ๐ฟ.

In matrix form, it follows from the property that the ๐‘ ร— ๐‘ submatrices ofthe full ๐‘ ร— ๐ฟ DFT matrix ๐€ are all equal to the DFT matrix ๐€.

34

Page 35: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

c. Modulo-N reduction

These submatrices are formed by grouping the first N columns of A into thefirst submatrix, the next N columns into the second submatrix, and so on.The matrix elements of the mth submatrix will be:

๐ด๐‘˜,๐‘š๐‘+๐‘› = ๐‘Š๐‘๐‘˜(๐‘š๐‘+๐‘›)

= ๐‘Š๐‘๐‘˜๐‘š๐‘๐‘Š๐‘

๐‘˜๐‘›

Using the property ๐‘Š๐‘๐‘ = 1, it follows that ๐‘Š๐‘

๐‘˜๐‘š๐‘ = 1, and therefore:

๐ด๐‘˜,๐‘š๐‘+๐‘› = ๐‘Š๐‘๐‘˜๐‘› = ๐ด๐‘˜๐‘› = ๐ด๐‘˜๐‘›

Thus, in general, ๐€ is partitioned in the form:

๐€ = ๐€, ๐€, ๐€, โ€ฆ

35

Page 36: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

c. Modulo-N reduction

36

Page 37: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

d. Properties of DFT

37

Properties Time-domain Frequency domain

Notation ๐‘ฅ ๐‘› ๐‘‹ ๐‘˜

Periodicity ๐‘ฅ ๐‘› + ๐‘ = ๐‘ฅ ๐‘› ๐‘‹ ๐‘˜ = ๐‘‹ ๐‘˜ + ๐‘

Linearity ๐‘Ž1๐‘ฅ1 ๐‘› + ๐‘Ž2๐‘ฅ2 ๐‘› ๐‘Ž1๐‘‹1 ๐‘› + ๐‘Ž2๐‘‹2 ๐‘›

Circular time-shift ๐‘ฅ ๐‘› โˆ’ ๐‘™๐‘

๐‘’โˆ’๐‘—2๐œ‹๐‘˜๐‘™/๐‘๐‘‹ ๐‘˜

Circular convolution ๐‘ฅ1 ๐‘› โŠ› ๐‘ฅ2 ๐‘› ๐‘‹1 ๐‘ ๐‘‹2 ๐‘

Multiplication of two sequences

๐‘ฅ1 ๐‘› ๐‘ฅ2 ๐‘1

๐‘๐‘‹1 ๐‘› โˆ— ๐‘‹2 ๐‘›

Parvesalโ€™s theorem ๐ธ๐‘ฅ =

๐‘›=0

๐‘

๐‘ฅ ๐‘› 2 =1

๐‘

๐‘˜=0

๐‘โˆ’1

๐‘‹ ๐‘˜ 2

Page 38: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

e. Circular shift

The circular shift of the sequence can be represented as the index moduloN:

๐‘ฅโ€ฒ ๐‘› = ๐‘ฅ ๐‘› โˆ’ ๐‘˜, modulo N โ‰ก ๐‘ฅ ๐‘› โˆ’ ๐‘˜๐‘

38

Page 39: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

e. Circular convolution

The circular convolution of two sequences of length N is defined as:๐‘ฅ3 ๐‘š = ๐‘ฅ1 ๐‘› โŠ› ๐‘ฅ2 ๐‘›

๐‘ฅ3 ๐‘š =

๐‘›=0

๐‘โˆ’1

๐‘ฅ1 ๐‘› ๐‘ฅ2 ๐‘š โˆ’ ๐‘›๐‘

๐‘š = 0,1, โ€ฆ , ๐‘ โˆ’ 1

Ex: perform the circular convolution of the following two sequences๐‘ฅ1 ๐‘› = 2,1,2,1๐‘ฅ2 ๐‘› = 1,2,3,4

It can be shown from the below figure:

39

Page 40: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

e. Circular convolution

40

Page 41: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

e. Circular convolution

41

Page 42: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

3. Discrete Fourier transform (DFT)

f. Use of the DFT in linear filtering

Suppose that we have a finite duration sequence ๐‘ฅ = ๐‘ฅ0, ๐‘ฅ1, ๐‘ฅ2, โ€ฆ , ๐‘ฅ๐ฟโˆ’1

which excites the FIR filter of order M.

The sequence output is of length ๐ฟ๐‘ฆ = ๐ฟ + ๐‘€ samples.

If ๐‘ โ‰ฅ ๐ฟ + ๐‘€, N-point DFT is sufficient to present ๐‘ฆ ๐‘› in the frequencydomain, i.e,

Computation of the N-point IDFT must yield ๐‘ฆ ๐‘› .

Thus, with zero padding, the DFT can be used to perform linear filtering.

42

Page 43: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

4. Fast Fourier Transform (FFT)

โ€ข N-point DFT of the sequence of data ๐‘ฅ ๐‘› of length N is given byfollowing formula:

๐‘‹ ๐‘˜ =

๐‘›=0

๐‘โˆ’1

๐‘ฅ ๐‘› ๐‘Š๐‘๐‘˜๐‘› , ๐‘˜ = 0,1,2, โ€ฆ , ๐‘ โˆ’ 1

where ๐‘Š๐‘ = ๐‘’โˆ’๐‘—2๐œ‹/๐‘

โ€ข In general, the data sequence ๐‘ฅ ๐‘› is also assumed to be complexvalued. The calculation of all N values of DFT requires ๐‘2 complexmultiplication and ๐‘ ๐‘ โˆ’ 1 complex additions.

โ€ข FFT exploits to symmetry and periodicity properties of the phase factor๐‘Š๐‘ to reduce to computational complexity:

- Symmetry: ๐‘Š๐‘๐‘˜+๐‘/2

= โˆ’๐‘Š๐‘๐‘˜

- Periodicity: ๐‘Š๐‘๐‘˜+๐‘ = ๐‘Š๐‘

๐‘˜

43

Page 44: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

4. Fast Fourier Transform (FFT)

โ€ข Based on decimation, leads to a factorization of computations.

โ€ข Let us first look at the classical radix 2 decimation in time.

โ€ข First we split the computation between old and even samples:

๐‘‹ ๐‘˜ =

๐‘›=0

๐‘2

โˆ’1

๐‘ฅ 2๐‘› ๐‘Š๐‘๐‘˜2๐‘› +

๐‘›=0

๐‘2

โˆ’1

๐‘ฅ 2๐‘› + 1 ๐‘Š๐‘๐‘˜ 2๐‘›+1

โ€ข Using the following property: ๐‘Š๐‘2 = ๐‘Š๐‘/2

โ€ข The N-point DFT can be rewritten:

๐‘‹ ๐‘˜ =

๐‘›=0

๐‘2โˆ’1

๐‘ฅ 2๐‘› ๐‘Š๐‘/2๐‘˜๐‘› + ๐‘Š๐‘

๐‘˜

๐‘›=0

๐‘2โˆ’1

๐‘ฅ 2๐‘› + 1 ๐‘Š๐‘/2๐‘˜๐‘›

for ๐‘˜ = 0,1, โ€ฆ , ๐‘ โˆ’ 1

44

Page 45: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

4. Fast Fourier Transform (FFT)

โ€ข Using the property that:

๐‘Š๐‘๐‘˜+๐‘/2

= โˆ’๐‘Š๐‘๐‘˜

โ€ข The entire DFT can be computed with only ๐‘˜ = 0,1, โ€ฆ ,๐‘

2โˆ’ 1.

๐‘‹ ๐‘˜ =

๐‘›=0

๐‘2

โˆ’1

๐‘ฅ 2๐‘› ๐‘Š๐‘/2๐‘˜๐‘› + ๐‘Š๐‘

๐‘˜

๐‘›=0

๐‘2

โˆ’1

๐‘ฅ 2๐‘› + 1 ๐‘Š๐‘/2๐‘˜๐‘›

๐‘‹ ๐‘˜ +๐‘

2=

๐‘›=0

๐‘2โˆ’1

๐‘ฅ 2๐‘› ๐‘Š๐‘/2๐‘˜๐‘› โˆ’ ๐‘Š๐‘

๐‘˜

๐‘›=0

๐‘2โˆ’1

๐‘ฅ 2๐‘› + 1 ๐‘Š๐‘/2๐‘˜๐‘›

45

Page 46: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

4. Fast Fourier Transform (FFT)

a. Butterfly

โ€ข This leads to basic building block of the FFT, the butterfly:

46

DFT N/2

DFT N/2

x(0)

x(2)

x(N-2)

x(1)

x(3)

x(N-1)

X(0)

X(1)

X(N/2-1)

X(N/2)

X(N/2+1)

X(N-1)

WN0

WN1

WNN/2-1

-

-

-

We need:โ€ขN/2(N/2-1) complex โ€˜+โ€™ for each N/2 DFT.โ€ข(N/2)2 complex โ€˜ร—โ€™ for each DFT.โ€ขN/2 complex โ€˜ร—โ€™ at the input of the butterflies.โ€ขN complex โ€˜+โ€™ for the butter-flies.โ€ขGrand total:N2/2 complex โ€˜+โ€™N/2(N/2+1) complex โ€˜ร—โ€™

Page 47: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

4. Fast Fourier Transform (FFT)

b. Recursion

โ€ข If ๐‘/2 is even, we can further split the computation of each DFT of size๐‘/2 into two computations of half size DFT. When ๐‘ = 2๐‘Ÿ this can bedone until DFT of size 2 (i.e. butterfly with two elements).

47

x(0)

x(4)

x(2)

x(6)

x(1)

x(5)

x(3)

x(7)

X(0)

X(1)

X(2)

X(3)

X(4)

X(5)

X(6)

X(7)

W80

W81

W82

W83

-

-

-

--

-

-

-

-

-

-

-

W80

W80

W82

W82

W80

W80

W80

W80

W80=1

1st stage2nd stage3rd stage

Page 48: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

4. Fast Fourier Transform (FFT)

c. Shuffling the data, bit reverse ordering

โ€ข At each step of the algorithm, data are split between even and oddvalues. This results in scrambling the order.

48

Page 49: Digital Signal Processing - WordPress.com...Digital signal processing Chapter 5 1. Frequency Resolution and Windowing a. Mathematical approach However, in practice only a finite number

Digital signal processing Chapter 5

4. Fast Fourier Transform (FFT)

c. Number of operations

โ€ข If ๐‘ = 2๐‘Ÿ , we have ๐‘Ÿ = log2 ๐‘ stages. For each one we have:

- ๐‘2 complex โ€˜xโ€™ (some of them are by โ€˜1โ€™).

- N complex โ€˜+โ€™.

โ€ข Thus the grand total of operations is:

- ๐‘2 log2 ๐‘ complex โ€˜xโ€™.

- ๐‘ log2 ๐‘ complex โ€˜+โ€™.

โ€ข Ex: Calculate 4-point DFT of ๐‘ฅ = 1,3,2,3 ?

49