EE482: Digital Signal Processing Applications

Similar documents
WEEK10 Fast Fourier Transform (FFT) (Theory and Implementation)

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

1. Calculation of the DFT

EE482: Digital Signal Processing Applications

ELEG 305: Digital Signal Processing

ELEG 305: Digital Signal Processing

Fall 2011, EE123 Digital Signal Processing

Summary of lecture 1. E x = E x =T. X T (e i!t ) which motivates us to define the energy spectrum Φ xx (!) = jx (i!)j 2 Z 1 Z =T. 2 d!

Chapter 4 Discrete Fourier Transform (DFT) And Signal Spectrum

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

EE123 Digital Signal Processing

Fourier Analysis of Signals Using the DFT

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

Lecture 20: Discrete Fourier Transform and FFT

Digital Signal Processing ECE-307. Tarun Gulati Assoc. Prof., ECE Deptt. MMEC, MMU, Mullana

Discrete Fourier Transform

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

Digital Signal Processing. Midterm 2 Solutions

E : Lecture 1 Introduction

DHANALAKSHMI COLLEGE OF ENGINEERING DEPARTMENT OF ELECTRICAL AND ELECTRONICS ENGINEERING EC2314- DIGITAL SIGNAL PROCESSING UNIT I INTRODUCTION PART A

/ (2π) X(e jω ) dω. 4. An 8 point sequence is given by x(n) = {2,2,2,2,1,1,1,1}. Compute 8 point DFT of x(n) by

DISCRETE FOURIER TRANSFORM

ECG782: Multidimensional Digital Signal Processing

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

Module 3. Convolution. Aim

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

In this Lecture. Frequency domain analysis

EE123 Digital Signal Processing

EE482: Digital Signal Processing Applications

Digital Signal Processing Chapter 10. Fourier Analysis of Discrete- Time Signals and Systems CHI. CES Engineering. Prof. Yasser Mostafa Kadah

Topic 7. Convolution, Filters, Correlation, Representation. Bryan Pardo, 2008, Northwestern University EECS 352: Machine Perception of Music and Audio

Transforms and Orthogonal Bases

SNR Calculation and Spectral Estimation [S&T Appendix A]

ESE 531: Digital Signal Processing

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

CE 513: STATISTICAL METHODS

EE123 Digital Signal Processing

EEO 401 Digital Signal Processing Prof. Mark Fowler

Fundamentals of the DFT (fft) Algorithms

Information and Communications Security: Encryption and Information Hiding

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

DFT-Based FIR Filtering. See Porat s Book: 4.7, 5.6

Massachusetts Institute of Technology Department of Electrical Engineering and Computer Science : Discrete-Time Signal Processing

ECG782: Multidimensional Digital Signal Processing

MAHALAKSHMI ENGINEERING COLLEGE-TRICHY

Chapter 2: The Fourier Transform

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

Frequency-domain representation of discrete-time signals

L29: Fourier analysis

Digital Signal Processing, Lecture 2 Frequency description continued, DFT

Correlation, discrete Fourier transforms and the power spectral density

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

DSP Algorithm Original PowerPoint slides prepared by S. K. Mitra

Definition. A signal is a sequence of numbers. sequence is also referred to as being in l 1 (Z), or just in l 1. A sequence {x(n)} satisfying

EE-210. Signals and Systems Homework 7 Solutions

EEO 401 Digital Signal Processing Prof. Mark Fowler

EE482: Digital Signal Processing Applications

Digital Signal Processing

Elec4621 Advanced Digital Signal Processing Chapter 11: Time-Frequency Analysis

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

Chapter 6: Applications of Fourier Representation Houshou Chen

INTRODUCTION TO THE DFS AND THE DFT

Z - Transform. It offers the techniques for digital filter design and frequency analysis of digital signals.

The Fourier Transform (and more )

DFT & Fast Fourier Transform PART-A. 7. Calculate the number of multiplications needed in the calculation of DFT and FFT with 64 point sequence.

Digital Signal Processing. Lecture Notes and Exam Questions DRAFT

Discrete-Time Fourier Transform

1 1.27z z 2. 1 z H 2

6.003: Signal Processing

LAB 6: FIR Filter Design Summer 2011

APPENDIX A. The Fourier integral theorem

Representing a Signal

The Discrete Fourier transform

!Sketch f(t) over one period. Show that the Fourier Series for f(t) is as given below. What is θ 1?

HST.582J / 6.555J / J Biomedical Signal and Image Processing Spring 2007

Linear Convolution Using FFT

Fourier Series Representation of

! Review: Discrete Fourier Transform (DFT) ! DFT Properties. " Duality. " Circular Shift. ! Circular Convolution. ! Fast Convolution Methods

BME 50500: Image and Signal Processing in Biomedicine. Lecture 2: Discrete Fourier Transform CCNY

EE 225D LECTURE ON DIGITAL FILTERS. University of California Berkeley

EE538 Digital Signal Processing I Session 13 Exam 1 Live: Wed., Sept. 18, Cover Sheet

ECSE 512 Digital Signal Processing I Fall 2010 FINAL EXAMINATION

Final Exam January 31, Solutions

Scientific Computing: An Introductory Survey

! Introduction. ! Discrete Time Signals & Systems. ! Z-Transform. ! Inverse Z-Transform. ! Sampling of Continuous Time Signals

Digital Signal Processing: Signal Transforms

L6: Short-time Fourier analysis and synthesis

Chapter 8 The Discrete Fourier Transform

EE482: Digital Signal Processing Applications

Chirp Transform for FFT

Discrete Time Fourier Transform (DTFT) Digital Signal Processing, 2011 Robi Polikar, Rowan University

Department of Electrical and Telecommunications Engineering Technology TEL (718) FAX: (718) Courses Description:

BEE604 Digital Signal Processing

Lab 3: The FFT and Digital Filtering. Slides prepared by: Chun-Te (Randy) Chu

Topic 3: Fourier Series (FS)

x[n] = x a (nt ) x a (t)e jωt dt while the discrete time signal x[n] has the discrete-time Fourier transform x[n]e jωn

3.2 Complex Sinusoids and Frequency Response of LTI Systems

Lecture 19: Discrete Fourier Series

SIDDHARTH GROUP OF INSTITUTIONS:: PUTTUR Siddharth Nagar, Narayanavanam Road QUESTION BANK (DESCRIPTIVE)

IT DIGITAL SIGNAL PROCESSING (2013 regulation) UNIT-1 SIGNALS AND SYSTEMS PART-A

Transcription:

Professor Brendan Morris, SEB 3216, brendan.morris@unlv.edu EE482: Digital Signal Processing Applications Spring 2014 TTh 14:305:45 CBC C222 Lecture 8 Frequency Analysis 14/02/18 http://www.ee.unlv.edu/~b1morris/ee482/

2 Outline Fast Fourier Transform Butterfly Structure Implementation Issues

DFT Algorithm The Fourier transform of an analogue signal x(t) is given by: The Discrete Fourier Transform (DFT) of a discrete-time signal x(nt) is given by: Where: Chapter 19, Slide 3

DFT Algorithm If we let: then: Chapter 19, Slide 4

DFT Algorithm x[n] = input X[k] = frequency bins W = twiddle factors X(0) X(1) X(k) X(N) = x[0]w N0 + x[1]w 0*1 N + + x[n]w 0*(N) N = x[0]w N0 + x[1]w 1*1 N + + x[n]w 1*(N) N : = x[0]w N0 + x[1]w k*1 N + + x[n]w k*(n) N : = x[0]w N0 + x[1]w (N)*1 N + + x[n]w (N)(N) N Note: For N samples of x we have N frequencies representing the signal. Chapter 19, Slide 5

Performance of the DFT Algorithm The DFT requires N 2 (NxN) complex multiplications: Each X(k) requires N complex multiplications. Therefore to evaluate all the values of the DFT ( X(0) to X(N) ) N 2 multiplications are required. The DFT also requires (N)*N complex additions: Each X(k) requires N additions. Therefore to evaluate all the values of the DFT (N)*N additions are required. Chapter 19, Slide 6

Performance of the DFT Algorithm Can the number of computations required be reduced? Chapter 19, Slide 7

DFT FFT A large amount of work has been devoted to reducing the computation time of a DFT. This has led to efficient algorithms which are known as the Fast Fourier Transform (FFT) algorithms. Chapter 19, Slide 8

DFT FFT [1] x[n] = x[0], x[1],, x[n] Lets divide the sequence x[n] into even and odd sequences: x[2n] = x[0], x[2],, x[n-2] x[2n+1] = x[1], x[3],, x[n] Chapter 19, Slide 9

DFT FFT Equation 1 can be rewritten as: [2] Since: Then: Chapter 19, Slide 10

DFT FFT The result is that an N-point DFT can be divided into two N/2 point DFT s: N-point DFT Where Y(k) and Z(k) are the two N/2 point DFTs operating on even and odd samples respectively: Two N/2- point DFTs Chapter 19, Slide 11

DFT FFT Periodicity and symmetry of W can be exploited to simplify the DFT further: [3] Or: : Symmetry And: Chapter 19, Slide 12 : Periodicity

DFT FFT Symmetry and periodicity: W 8 4 W 8 5 W 8 3 W 8 6 W 8 2 W 8 7 W 8 0 =W 8 8 W 8 1 = W 8 9 W k+n/2 N = - W k N W k+n/2 N/2 =W k N/2 W k+4 8 = - W k 8 W k+8 8 =W k 8 Chapter 19, Slide 13

DFT FFT Finally by exploiting the symmetry and periodicity, Equation 3 can be written as: [4] Chapter 19, Slide 14

DFT FFT Y(k) and W N k Z(k) only need to be calculated once and used for both equations. Note: the calculation is reduced from 0 to N to 0 to (N/2-1). Chapter 19, Slide 15

DFT FFT Y(k) and Z(k) can also be divided into N/4 point DFTs using the same process shown above: Chapter 19, Slide 16 The process continues until we reach 2 point DFTs.

DFT FFT x[0] x[2] x[4] N/2 point DFT y[0] y[1] y[2] X[0] = y[0]+ z[0] X[1] = y[1]+w 1 z[1] x[n-2] y[n-2] x[1] x[3] x[5] N/2 point DFT z[0] z[1] z[2] W 1 X[N/2] = y[0]- z[0] X[N/2+1] = y[1]-w 1 z[1] x[n] z[n/2] Illustration of the first decimation in time FFT. Chapter 19, Slide 17

FFT Implementation To efficiently implement the FFT algorithm a few observations are made: Each stage has the same number of butterflies (number of butterflies = N/2, N is number of points). The number of DFT groups per stage is equal to (N/2 stage ). The difference between the upper and lower leg is equal to 2 stage. The number of butterflies in the group is equal to 2 stage. Chapter 19, Slide 18

FFT Implementation Example: 8 point FFT W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Chapter 19, Slide 19 Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

FFT Implementation Example: 8 point FFT (1) Number of stages: W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Chapter 19, Slide 20 Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Stage 1 FFT Implementation Example: 8 point FFT (1) Number of stages: N stages = 1 W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Chapter 19, Slide 21 Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Stage 1 FFT Implementation Stage 2 Example: 8 point FFT (1) Number of stages: N stages = 2 W 1 W 3 Chapter 19, Slide 22 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Stage 1 FFT Implementation Stage 2 Stage 3 Example: 8 point FFT (1) Number of stages: N stages = 3 W 1 W 3 Chapter 19, Slide 23 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Stage 1 FFT Implementation Stage 2 Stage 3 Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: W 1 W 3 Chapter 19, Slide 24 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Block 1 Stage 1 FFT Implementation Stage 2 Stage 3 Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 1 W 1 W 3 Chapter 19, Slide 25 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Block 1 Block 2 Stage 1 FFT Implementation Stage 2 Stage 3 Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 2 W 1 W 3 Chapter 19, Slide 26 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Block 1 Block 2 Block 3 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 3 W 3 Chapter 19, Slide 27 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Block 1 Block 2 Block 3 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Block 4 W 3 Chapter 19, Slide 28 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Block 1 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 1 W 3 Chapter 19, Slide 29 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Block 1 Block 2 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 2 W 3 Chapter 19, Slide 30 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Block 1 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 2 Stage 3: N blocks = 1 W 3 Chapter 19, Slide 31 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage

Chapter 19, Slide 32 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 2 Stage 3: N blocks = 1 (3) B flies/block: Stage 1:

Chapter 19, Slide 33 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 2 Stage 3: N blocks = 1 (3) B flies/block: Stage 1: N btf = 1

Chapter 19, Slide 34 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 2 Stage 3: N blocks = 1 (3) B flies/block: Stage 1: N btf = 1 Stage 2: N btf = 1

Chapter 19, Slide 35 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 2 Stage 3: N blocks = 1 (3) B flies/block: Stage 1: N btf = 1 Stage 2: N btf = 2

Chapter 19, Slide 36 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 2 Stage 3: N blocks = 1 (3) B flies/block: Stage 1: N btf = 1 Stage 2: N btf = 2 Stage 3: N btf = 1

Chapter 19, Slide 37 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 2 Stage 3: N blocks = 1 (3) B flies/block: Stage 1: N btf = 1 Stage 2: N btf = 2 Stage 3: N btf = 2

Chapter 19, Slide 38 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 2 Stage 3: N blocks = 1 (3) B flies/block: Stage 1: N btf = 1 Stage 2: N btf = 2 Stage 3: N btf = 3

Chapter 19, Slide 39 Stage 1 FFT Implementation Stage 2 Stage 3 W 1 W 3 Decimation in time FFT: Number of stages = log 2 N Number of blocks/stage = N/2 stage Number of butterflies/block = 2 stage Example: 8 point FFT (1) Number of stages: N stages = 3 (2) Blocks/stage: Stage 1: N blocks = 4 Stage 2: N blocks = 2 Stage 3: N blocks = 1 (3) B flies/block: Stage 1: N btf = 1 Stage 2: N btf = 2 Stage 3: N btf = 4

FFT Implementation Stage 1 Stage 2 Stage 3 W 1 W 3 Start Index 0 0 0 Input Index 1 2 4 Twiddle Factor Index N/2 = 4 Chapter 19, Slide 40

FFT Implementation Stage 1 Stage 2 Stage 3 W 1 W 3 Start Index 0 0 0 Input Index 1 2 4 Twiddle Factor Index N/2 = 4 4/2 = 2 Chapter 19, Slide 41

FFT Implementation Stage 1 Stage 2 Stage 3 W 1 W 3 Start Index 0 0 0 Input Index 1 2 4 Twiddle Factor Index N/2 = 4 4/2 = 2 2/2 = 1 Chapter 19, Slide 42

FFT Implementation Stage 1 Stage 2 Stage 3 W 1 W 3 Start Index 0 Input Index 1 Twiddle Factor Index N/2 = 4 4/2 = 2 2/2 = 1 Indicies Used W 1 0 2 0 4 Chapter 19, Slide 43 W 3

44 FFT Decimation in Frequency Similar divide and conquer strategy Decimate in frequency domain / / / / Divide into first half and second half of sequence / 2 / / / / / 2 1 / /

45 FFT Decimation in Frequency Structure Stage structure Full structure Bit reversal happens at output instead of input

46 Inverse FFT Notice this is the DFT with a scale factor and change in twidle sign Can compute using the FFT with minor modifications Conjugate coefficients, compute FFT with scale factor, conjugate result For real signals, no final conjugate needed Can complex conjugate twidle factors and use in butterfly structure

47 FFT Example Example 5.10 Sine wave with 50Hz sin 0,1,, 128 256 Hz Frequency resolution of DFT? Δ / 2Hz Location of peak 50 Δ 25

48 Spectral Leakage and Resolution Notice that a DFT is like windowing a signal to finite length Longer window lengths (more samples) the closer DFT approximates DTFT Convolution relationship Corruption of spectrum due to window properties (mainlobe/sidelobe) Sidelobes result in spurious peaks in computed spectrum known as spectral leakage Obviously, want to use smoother windows to minimize these effects Spectral smearing is the loss in sharpness due to convolution which depends on mainlobe width Example 5.15 Two close sinusoids smeared together To avoid smearing: Frequency separation should be greater than freq resolution, /Δ

49 Power Spectral Density Parseval s theorem - power spectrum or periodogram Power spectral density (PSD, or power density spectrum or power spectrum) is used to measure average power over frequencies Computed for time-varying signal by using a sliding window technique Short-time Fourier transform Grab samples and compute FFT Must have overlap and use windows Spectrogram Each short FFT is arranged as a column in a matrix to give the time-varying properties of the signal Viewed as an image She had your dark suit in greasy wash water all year

50 Fast FFT Convolution Linear convolution is multiplication in frequency domain Must take FFT of signal and filter, multiply, and ifft Operations in frequency domain can be much faster for large filters Requires zero-padding because of circular convolution Typically, will do block processing Segment a signal and process each segment individually before recombining

51 Ex: FFT Effect of N Take FFT of cosine using different N values n = [0:29]; x = cos(2*pi*n/10); N1 = 64; N2 = 128; N3 = 256; X1 = abs(fft(x,n1)); X2 = abs(fft(x,n2)); X3 = abs(fft(x,n3)); F1 = [0 : N1-1]/N1; F2 = [0 : N2-1]/N2; F3 = [0 : N3-1]/N3; subplot(3,1,1) plot(f1,x1,'-x'),title('n = 64'),axis([0 1 0 20]) subplot(3,1,2) plot(f2,x2,'-x'),title('n = 128'),axis([0 1 0 20]) subplot(3,1,3) plot(f3,x3,'-x'),title('n = 256'),axis([0 1 0 20]) Transforms all have the same shape Difference is the number of samples used to approximate the shape Notice the sinusoid frequency is not always well represented Depends on frequency resolution

52 Ex: FFT Effect of Number of Samples Select a large value of N and vary the number of samples of the signal n = [0:29]; x1 = cos(2*pi*n/10); % 3 periods x2 = [x1 x1]; % 6 periods x3 = [x1 x1 x1]; % 9 periods N = 2048; X1 = abs(fft(x1,n)); X2 = abs(fft(x2,n)); X3 = abs(fft(x3,n)); F = [0:N]/N; subplot(3,1,1) plot(f,x1),title('3 periods'),axis([0 1 0 50]) subplot(3,1,2) plot(f,x2),title('6 periods'),axis([0 1 0 50]) subplot(3,1,3) plot(f,x3),title('9 periods'),axis([0 1 0 50]) Transforms all have the same shape Looks like sinc functions More samples makes the sinc look more impulse-like FFT with large N but fewer samples does zero-padding E.g. taking length N signal and windowing with box Multiplication in time is convolution in frequency

53 Spectrum Analysis with FFT and Matlab FFT does not directly give spectrum Dependent on the number of signal samples Dependent on the number of points in the FFT FFT contains info between 0, Spectrum must be below /2 Symmetric across 0axis, Use fftshift.m in Matlab n = [0:149]; x1 = cos(2*pi*n/10); N = 2048; X = abs(fft(x1,n)); X = fftshift(x); F = [-N/2:N/2]/N; plot(f,x), xlabel('frequency / f s')