Chapter 4 Discrete Fourier Transform (DFT) And Signal Spectrum

Similar documents
In this Lecture. Frequency domain analysis

Lecture 5. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

Fundamentals of the DFT (fft) Algorithms

EDISP (NWL3) (English) Digital Signal Processing DFT Windowing, FFT. October 19, 2016

Multimedia Signals and Systems - Audio and Video. Signal, Image, Video Processing Review-Introduction, MP3 and MPEG2

Music 270a: Complex Exponentials and Spectrum Representation

The Fourier Transform (and more )

DISCRETE FOURIER TRANSFORM

Discrete-Time Signals: Time-Domain Representation

Discrete Fourier Transform

Discrete-Time Signals: Time-Domain Representation

Topic 3: Fourier Series (FS)

Chapter 2: The Fourier Transform

1. Calculation of the DFT

The Discrete Fourier Transform

EE482: Digital Signal Processing Applications

Frequency-domain representation of discrete-time signals

Digital Signal Processing

Discrete Fourier Transform

EDISP (NWL2) (English) Digital Signal Processing Transform, FT, DFT. March 11, 2015

Continuous-time Fourier Methods

Representing a Signal

CMPT 318: Lecture 5 Complex Exponentials, Spectrum Representation

Contents. Digital Signal Processing, Part II: Power Spectrum Estimation

Fall 2011, EE123 Digital Signal Processing

L29: Fourier analysis

7.16 Discrete Fourier Transform

ELEG 305: Digital Signal Processing

Lecture 10. Digital Signal Processing. Chapter 7. Discrete Fourier transform DFT. Mikael Swartling Nedelko Grbic Bengt Mandersson. rev.

Transforms and Orthogonal Bases

Chirp Transform for FFT

! Circular Convolution. " Linear convolution with circular convolution. ! Discrete Fourier Transform. " Linear convolution through circular

6.003: Signal Processing

Lecture 27 Frequency Response 2

Lecture 4 - Spectral Estimation

LAB 2: DTFT, DFT, and DFT Spectral Analysis Summer 2011

ECSE 512 Digital Signal Processing I Fall 2010 FINAL EXAMINATION

EEL3135: Homework #3 Solutions

3.2 Complex Sinusoids and Frequency Response of LTI Systems

SEISMIC WAVE PROPAGATION. Lecture 2: Fourier Analysis

2.161 Signal Processing: Continuous and Discrete Fall 2008

Fourier Analysis of Signals Using the DFT

Lecture Notes on Fundamentals of Audio-Video Signal Processing

16.362: Signals and Systems: 1.0

Fourier analysis of discrete-time signals. (Lathi Chapt. 10 and these slides)

DFT and Matlab with some examples.

The Discrete Fourier Transform. Signal Processing PSYCH 711/712 Lecture 3

Communication Signals (Haykin Sec. 2.4 and Ziemer Sec Sec. 2.4) KECE321 Communication Systems I

Scientific Computing: An Introductory Survey

Digital Signal Processing

Filter Analysis and Design

L6: Short-time Fourier analysis and synthesis

Fourier Series and Fourier Transforms

E : Lecture 1 Introduction

Signals and Systems Lecture (S2) Orthogonal Functions and Fourier Series March 17, 2008

Lecture # 06. Image Processing in Frequency Domain

Part 3d: Spectra of Discrete-Time Signals

8/19/16. Fourier Analysis. Fourier analysis: the dial tone phone. Fourier analysis: the dial tone phone

I. Signals & Sinusoids

1 1.27z z 2. 1 z H 2

Lectures on Spectra of Discrete-Time Signals

INTRODUCTION TO THE DFS AND THE DFT

Signals and Systems: Introduction

3 What You Should Know About Complex Numbers

6.003 Signal Processing

CS711008Z Algorithm Design and Analysis

Information and Communications Security: Encryption and Information Hiding

FOURIER TRANSFORM AND

Digital Signal Processing. Lecture Notes and Exam Questions DRAFT

Today s lecture. The Fourier transform. Sampling, aliasing, interpolation The Fast Fourier Transform (FFT) algorithm

Module 3. Convolution. Aim

VU Signal and Image Processing. Torsten Möller + Hrvoje Bogunović + Raphael Sahann

ECG782: Multidimensional Digital Signal Processing

SOLUTIONS to ECE 2026 Summer 2017 Problem Set #2

Chapter 6: Applications of Fourier Representation Houshou Chen

Discrete Fourier transform (DFT)

UNIVERSITY OF OSLO. Faculty of mathematics and natural sciences. Forslag til fasit, versjon-01: Problem 1 Signals and systems.

BEE604 Digital Signal Processing

15 n=0. zz = re jθ re jθ = r 2. (b) For division and multiplication, it is handy to use the polar representation: z = rejθ. = z 1z 2.

Fourier Analysis and Spectral Representation of Signals

EE 435. Lecture 30. Data Converters. Spectral Performance

CHAPTER 4 FOURIER SERIES S A B A R I N A I S M A I L

ANALOG AND DIGITAL SIGNAL PROCESSING ADSP - Chapter 8

EE123 Digital Signal Processing

Chapter 4 The Fourier Series and Fourier Transform

VALLIAMMAI ENGINEERING COLLEGE. SRM Nagar, Kattankulathur DEPARTMENT OF INFORMATION TECHNOLOGY. Academic Year

ω 0 = 2π/T 0 is called the fundamental angular frequency and ω 2 = 2ω 0 is called the

VII. Discrete Fourier Transform (DFT) Chapter-8. A. Modulo Arithmetic. (n) N is n modulo N, n is an integer variable.

Lecture 20: Discrete Fourier Transform and FFT

Radar Systems Engineering Lecture 3 Review of Signals, Systems and Digital Signal Processing

ENT 315 Medical Signal Processing CHAPTER 2 DISCRETE FOURIER TRANSFORM. Dr. Lim Chee Chin

Discrete Fourier transform

Down-Sampling (4B) Young Won Lim 10/25/12

Reference Text: The evolution of Applied harmonics analysis by Elena Prestini

PS403 - Digital Signal processing

Date: 31 March (1) The only reference material you may use is one 8½x11 crib sheet and a calculator.

PSET 0 Due Today by 11:59pm Any issues with submissions, post on Piazza. Fall 2018: T-R: Lopata 101. Median Filter / Order Statistics

Introduction to Biomedical Engineering

Each of these functions represents a signal in terms of its spectral components in the frequency domain.

Contents. Signals as functions (1D, 2D)

Transcription:

Chapter 4 Discrete Fourier Transform (DFT) And Signal Spectrum CEN352, DR. Nassim Ammour, King Saud University 1

Fourier Transform History Born 21 March 1768 ( Auxerre ). Died 16 May 1830 ( Paris ) French mathematician and physicist. Best known for initiating the investigation of Fourier series. Fourier series applications to problems of heat transfer and vibrations. The Fourier series is used to represent a periodic function by a discrete sum of complex exponentials. Fourier transform is then used to represent a general, non-periodic function by a continuous superposition or integral of complex exponentials (the period approaches to infinity). Jean-Baptiste Joseph Fourier CEN352, DR. Nassim Ammour, King Saud University 2

Discrete Fourier Transform In this chapter we introduce the concept of Fourier or frequency-domain representation of signals. Discrete Fourier Transform (DFT) transforms (break up the signal into summations of sinusoidal components) the time domain signal samples to the frequency domain components (frequency analysis ). In the time domain, representation of digital signals describes the signal amplitude versus the sample number (time). The representation of the digital signal in terms of its frequency component in a frequency domain, displays the frequency information of a digital signal (signal spectrum). Fourier analysis is like a glass prism, which splits a beam of light into frequency components corresponding to different colors. CEN352, DR. Nassim Ammour, King Saud University 3

Continuous-time sinusoids A continuous-time sinusoidal signal may be represented as a function of time t by the equation Amplitude frequency phase in radians The angular or radian frequency (radians per second.) A discrete-time sinusoidal signal is conveniently obtained by sampling the continuous-time sinusoid at equally spaced points t = nt normalized frequency Using Euler s identity we can express every sinusoidal signal in terms of two complex exponentials with the same frequency normalized angular frequency Frequency (positive quantity.), viewed as the number of cycles completed per unit of time. Negative frequencies is a convenient way to describe signals in terms of complex exponentials. CEN352, DR. Nassim Ammour, King Saud University 4

DFT: Graphical Example Time domain representation Time domain 1000-Hz sinusoid with 32 samples at a sampling rate of 8000 Hz in DFT Frequency domain representation Amplitude peak is located at the frequency of 1 KHz Sampling Rate 8000 samples = 1 second -> sampling period T s = 1 = 125μs 8000 Duration of 32 samples = 32*0.125 ms = 4 ms Signal Frequency 1000-Hz sinusoid -> T = 1ms 32 samples = 4 ms -> 4 cycles. CEN352, DR. Nassim Ammour, King Saud University 5

DFT Coefficients of Periodic Signals Given a set of N harmonically related complex exponentials e j2π N kn, We can synthesize a signal x n x n is sampled at a rate of f s Hz (period T 0 = NT = N 1 f s ) Equation of DFT coefficients: We determine the coefficients c k from the values of the periodic signal x n Sum over one period Periodic Digital Signal x n DTFS Discrete-Time Fourier Series We have: e jθ = cos θ + jsin θ and e j(θ+2π) = e jθ period of 2π For θ t = ωt e jωt = cos ωt + jsin ωt Rotation of a point on a circle CEN352, DR. Nassim Ammour, King Saud University 6

DFT Coefficients of Periodic Signals Fourier series coefficient C k is periodic of N Remarks 1. spectral portion between the frequency f s and f s (folding frequency) represents frequency information of the periodic signal. Since e j2πn = cos 2πn jsin 2πn = 1 C K+N = C K Amplitude spectrum of the periodic digital signal The spectrum C k has two sides. 2. For the k th harmonic, the frequency is f = kf 0 Hz (f 0 is the frequency resolution =The frequency spacing between the consecutive spectral lines) 3. the spectral portion from f s 2 to f s is a copy of the spectrum in the negative frequency range from f s /2 to 0 Hz due to the spectrum being periodic for every f s = Nf 0 Hz. CEN352, DR. Nassim Ammour, King Saud University 7

Example 1 The periodic signal x t is sampled at f s = 4Hz x t = sin(2πt) a. Compute the spectrum C k using the samples in one period. b. Plot the two-sided amplitude spectrum C k over the range from -2 to 2 Hz. Solution: Fundamental frequency a. We match x t = sin(2πt) with x t = sin(2πft) and get f = 1Hz Therefore the signal has 1 cycle or 1 period in 1 second Sampling rate f s = 4 Hz 1 second has 4 samples. Hence, there are 4 samples in 1 period for this particular signal. T = 1 Sampled signal = 0.25 sec f s x n = x nt = sin 2πnT = sin(0.5πn). CEN352, DR. Nassim Ammour, King Saud University 8

Example 1 contd. (1) x n = x nt = sin 2πnT = sin(0.5πn). x 0 = 0; x 1 = 1; x 2 = 0; x 3 = 1; b. spectrum CEN352, DR. Nassim Ammour, King Saud University 9

Example 1 contd. (2) Using periodicity, it follows that The spectrum in the range of -2 to 2 Hz presents the information of the sinusoid with a frequency of 1 Hz and a peak value of 2 C 1 = 1. The amplitude spectrum for the digital signal CEN352, DR. Nassim Ammour, King Saud University 10

Discrete Fourier Transform DFT Formulas acquired N data samples with duration of T 0 Imagine periodicity of N samples. Take first N samples (index 0 to N-1) as the input periodic signal x n to DFT. CEN352, DR. Nassim Ammour, King Saud University 11

DFT Formulas Given N data samples of x n, the N-point discrete Fourier transform (DFT) X k is defined by: DFT Coefficients Formula. Fourier series coefficients k is the discrete frequency index (frequency bin number) indicating each calculated DFT coefficient. Where the factor W N is called the twiddle factor CEN352, DR. Nassim Ammour, King Saud University 12

Inverse DFT Given N DFT coefficients X[k], The inverse of the DFT x[n] is given by W N H is the conjugate transpose of W N CEN352, DR. Nassim Ammour, King Saud University 13

MATLAB Functions We can use MATLAB functions fft() and ifft() to compute the DFT coefficients and the inverse DFT with the syntax listed in Table: CEN352, DR. Nassim Ammour, King Saud University 14

Example 2 Given a sequence x(n) for 0 n 3 where x 0 = 1, x 1 = 2, x 2 = 3, and x 3 = 4. evaluate DFT X(k). Solution: Since N = 4 and W 4 = e jπ 2 X k = 3 n=0 x(n)w 4 kn = 3 n=0 x(n)e jπkn 2 CEN352, DR. Nassim Ammour, King Saud University 15

Example 2 contd. CEN352, DR. Nassim Ammour, King Saud University 16

Example 2 contd. Using the DFT complex matrix We first compute the entries of the matrix W 4 using the property: The result is a complex matrix given by: The DFT coefficients are evaluated by the matrix-by-vector multiplication 1 2 3 4 = 10 2 + 2j 2 2 2j In MATLAB these computations are done using the commands: The DFT The inverse DFT CEN352, DR. Nassim Ammour, King Saud University 17

Example 3 Using DFT coefficients X(k) for 0 n 3 of previous example, evaluate the inverse DFT (IDFT) to determine the time domain sequence x(n). Solution: CEN352, DR. Nassim Ammour, King Saud University 18

Example 3 contd. CEN352, DR. Nassim Ammour, King Saud University 19

Frequency of bin k The calculated N DFT coefficients X (k) represent the frequency components ranging from 0 Hz to f s Hz. The relationship between the frequency bin k and its associated frequency is computed using: f = k f s N = k f (Hz) The frequency resolution (frequency step between two consecutive DFT coefficients) CEN352, DR. Nassim Ammour, King Saud University 20

Example 4 In the previous example, if the sampling rate is 10 Hz, a. Determine the sampling period, time index, and sampling time instant for a digital sample x(3) in the time domain; b. Determine the frequency resolution, frequency bin, and mapped frequencies for the DFT coefficients X(1)and X(3) in the frequency domain. Solution: a. Sampling period: For x(3), the time index is n = 3 and the sampling time instant is determined by b. Frequency resolution: Frequency bin number for X(1) is k = 1, and its corresponding frequency is Similarly, for X(3) is k = 3, and its corresponding frequency is CEN352, DR. Nassim Ammour, King Saud University 21

Amplitude and Power Spectrum Since each calculated DFT coefficient is a complex number, it is not convenient to plot it versus its frequency index. Hence, after evaluating the N DFT coefficients, the magnitude and phase of each DFT coefficient can be determined and plotted versus its frequency index. Amplitude Spectrum: To find one-sided amplitude spectrum, we double the amplitude keeping the original DC term at k =0. CEN352, DR. Nassim Ammour, King Saud University 22

Amplitude and Power Spectrum contd. Power Spectrum: For, one-sided power spectrum: Phase Spectrum: CEN352, DR. Nassim Ammour, King Saud University 23

Example 5 Consider the sequence in the Figure, assuming that f s = 100 Hz, compute the amplitude spectrum, phase spectrum, and power spectrum. Solution: CEN352, DR. Nassim Ammour, King Saud University 24

Example 5 contd. (1) CEN352, DR. Nassim Ammour, King Saud University 25

Example 5 contd. (2) CEN352, DR. Nassim Ammour, King Saud University 26

Example 6 Consider a digital sequence sampled at the rate of 10 khz. If we use 1,024 data points and apply the 1,024-point DFT to compute the spectrum, a. Determine the frequency resolution; b. Determine the highest frequency in the spectrum. Solution: CEN352, DR. Nassim Ammour, King Saud University 27

FFT: Fast Fourier Transform. Zero Padding for FFT A fast version of DFT; It requires signal length to be power of 2 (N = 2, 4, 8, 16, ). Therefore, we need to pad zero at the end of the signal. However, it does not add any new information. The frequency spacing is reduced due to more DFT points CEN352, DR. Nassim Ammour, King Saud University 28

Example 7 Consider a digital signal has sampling rate = 10 khz. For amplitude spectrum we need frequency resolution of less than 0.5 Hz. For FFT how many data points are needed? Solution: CEN352, DR. Nassim Ammour, King Saud University 29

MATLAB Example -1 2π 1000 nt s f = 1Khz Consider the sinusoid with a sampling rate of f s = 8,000 Hz. Use the MATLAB DFT to compute the signal spectrum with the frequency resolution to be equal to or less than 8 Hz. Solution: The number of data points is %Compute the amplitude spectrum CEN352, DR. Nassim Ammour, King Saud University 30

MATLAB Example contd. (1) CEN352, DR. Nassim Ammour, King Saud University 31

MATLAB Example contd. (2) CEN352, DR. Nassim Ammour, King Saud University 32

MATLAB Example contd. (3) CEN352, DR. Nassim Ammour, King Saud University 33

Effect of Window Size When applying DFT, we assume the following: 1. Sampled data are periodic to themselves (repeat). 2. Sampled data are continuous to themselves and band limited to the folding frequency. CEN352, DR. Nassim Ammour, King Saud University 34

Effect of Window Size contd. (1) If the window size is not multiple of waveform cycles, the discontinuity produces undesired harmonic frequencies: CEN352, DR. Nassim Ammour, King Saud University 35

Effect of Window Size contd. (2) single frequency Signal samples and spectra without spectral leakage and with spectral leakage. expected frequency component plus many harmonics CEN352, DR. Nassim Ammour, King Saud University 36

Reducing Leakage Using Window To reduce the effect of spectral leakage, a window function w n can be used whose amplitude tapers smoothly and gradually toward zero at both ends CEN352, DR. Nassim Ammour, King Saud University 37

Given, Example 8 Calculate, x w 2 and x w 5 windowed sequence data Applying the window function operation leads to Using the window function the spectral leakage is greatly reduced. CEN352, DR. Nassim Ammour, King Saud University 38

Different Types of Windows CEN352, DR. Nassim Ammour, King Saud University 39

Different Types of Windows contd. Window size of 20 samples CEN352, DR. Nassim Ammour, King Saud University 40

Example 9 Considering the sequence x 0 = 1, x 1 = 2, x 2 = 3, x 3 = 4 and given f s = 100 Hz, T = 0.01 seconds, compute the amplitude spectrum, phase spectrum, and power spectrum using the Hamming window function. Solution: Since N = 4, Hamming window function can be found as: CEN352, DR. Nassim Ammour, King Saud University 41

The windowed sequence is computed as: Example 9 contd. (1) DFT Sequence: We obtain: CEN352, DR. Nassim Ammour, King Saud University 42

Example 9 contd. (2) Amplitude spectrum Power spectrum Phase spectrum CEN352, DR. Nassim Ammour, King Saud University 43

MATLAB Example -2 Given the sinusoid obtained using a sampling rate of f s = 8,000 Hz Use the DFT to compute the spectrum of a Hamming window function with window size = 100. Solution: CEN352, DR. Nassim Ammour, King Saud University 44

MATLAB Example 2 contd. CEN352, DR. Nassim Ammour, King Saud University 45

DFT Matrix The N equations for the DFT coefficients can be expressed in matrix form as: Let, w N = e 2jπ/N then, Frequency Spectrum DFT Matrix Time-Domain Samples DFT coefficient vector X N DFT matrix W N signal vector x N Compact form : X N = W N x N DFT Equation: DFT requires N 2 complex multiplications CEN352, DR. Nassim Ammour, King Saud University 46

DFT Matrix Example Determine the DFT coefficients of the four point segment x 0 = 0, x 1 = 1, x 2 = 2, x 3 = 3 of a sequence x n Solution We first compute the entries of the matrix W 4 using the property W k+n N = W k N = e j2π N k = cos 2π k jsin 2π k N N The result is a complex matrix given by The DFT coefficients are evaluated by the matrix-by-vector multiplication In MATLAB these computations are done using the commands: CEN352, DR. Nassim Ammour, King Saud University 47

FFT FFT: Fast Fourier Transform A very efficient algorithm to compute DFT; it requires less multiplication. The length of input signal, x(n) must be 2 m samples, where m is an integer. Samples N= 2, 4, 8, 16 or so. If the input length is not 2 m, append (pad) zeros to make it 2 m. CEN352, DR. Nassim Ammour, King Saud University 48

DFT to FFT: Decimation in Frequency DFT: w N = e j2 π N twiddle factor split Equation n n + N 2 to sum from zero W N n+ 2 k N N = W nk 2 N W k N = W nk N e 2π N = W nk N ( 1) k N 2 jk = W N nk e jπk for k = 2m even ( 1) k = 1 compute X(2m) for k = 2m + 1 odd ( 1) k = 1 compute X(2m + 1) CEN352, DR. Nassim Ammour, King Saud University 49

DFT to FFT: Decimation in Frequency Now decompose into even (k = 2m) and odd (k = 2m+1) sequences. W N 2m+1 n Using the fact that With: CEN352, DR. Nassim Ammour, King Saud University 50

DFT to FFT: Decimation in Frequency The computation process is Block1 (Even k) First iteration Block2 (Odd k) N 2 Point DFT ( N 2 ) 1 n=0 x n W N mn and x n is a n for even k and b n W n N for odd k 2 CEN352, DR. Nassim Ammour, King Saud University 51

Using same process j 2π N 1 W N/2 = e 2 (1) = e j 2π N (2) = W N 2 Second iteration DFT to FFT: Decimation in Frequency Block1 (Even indices) Block2 (Odd indices) Block3 (Even indices) Block4 (Odd indices) The splitting process continues to the end (until having 2 input points to the DFT block, in this case third iteration). Third iteration 12 complex multiplication CEN352, DR. Nassim Ammour, King Saud University 52

DFT to FFT: Decimation in Frequency The index (bin number) of the eight-point DFT coefficient becomes inverted, and can be fixed by applying reversal bits. For data length of N, the number of complex multiplications: For each k (N) we need N multiplications CEN352, DR. Nassim Ammour, King Saud University 53

IFFT: Inverse FFT The difference is: the twiddle factor w N is changed to w N = w N 1, and the sum is multiplied by a factor of 1/N. CEN352, DR. Nassim Ammour, King Saud University 54

FFT and IFFT Examples FFT Sequence x n Number of complex multiplication = IFFT Sequence x n CEN352, DR. Nassim Ammour, King Saud University 55

DFT to FFT: Decimation in Time Split the input sequence x n into the even indexed x 2m and x 2m + 1 each with N/2 data points. Using CEN352, DR. Nassim Ammour, King Saud University 56

DFT to FFT: Decimation in Time Define new functions as As, k+ N2 W N/2 = e j 2π N 2 (k+ N 2 ) = e j 2π N 2 k j 2π N e 2 ( N 2 ) = e j 2π N 2 k e j2π k = W N/2 W N k+ N2 = e j 2π N (k+n 2 ) = e j 2π N k e j 2π N (N 2 ) = e j 2π N k e jπ = W N k CEN352, DR. Nassim Ammour, King Saud University 57

DFT to FFT: Decimation in Time First iteration: Second iteration: CEN352, DR. Nassim Ammour, King Saud University 58

DFT to FFT: Decimation in Time Third iteration: CEN352, DR. Nassim Ammour, King Saud University 59

IFFT: Decimation in Time Similar to the decimation-in-frequency method, we change W N to W N, and the sum is multiplied by a factor of 1/N. inverse FFT (IFFT) block diagram for the eight-point inverse FFT IFFT CEN352, DR. Nassim Ammour, King Saud University 60

FFT and IFFT Examples FFT IFFT FFT Butterfly W N i 1 Stage 1 W has base N, stage 2 has base N, N, 2 4 divide by 2 as you add stages. CEN352, DR. Nassim Ammour, King Saud University 61

CEN352, DR. Nassim Ammour, King Saud University 62

Fourier Transform Properties (1) CEN352, DR. Nassim Ammour, King Saud University 63

Fourier Transform Properties (2) CEN352, DR. Nassim Ammour, King Saud University 64

Fourier Transform Pairs CEN352, DR. Nassim Ammour, King Saud University 65