dsp 5 the discrete fourier transform ( dft )...

31
DSP 5 The Discrete Fourier Transform (DFT) กกกกกกกกกกกกกกกกกกกกกกกก กกกกกก ผผ.ผผ. ผผผผผผ ผผผผผผผผผผผผผ ผผผผผผผ ผผผผผผผผ ผผผผผผผผผผผผผผ DSP5-1 CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon

Upload: mateo

Post on 21-Mar-2016

140 views

Category:

Documents


7 download

DESCRIPTION

DSP 5 The Discrete Fourier Transform ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง. ผศ.ดร. พีระพล ยุวภูษิตานนท์ ภาควิชา วิศวกรรมอิเล็กทรอนิกส์. เป้าหมาย. นศ รู้จักความหมายของ อนุกรมฟูริเยร์แบบไม่ต่อเนื่อง (Discrete Fourier Series :DFS) และผลการแปลงจากสัญญาณในโดเมนเวลา - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP 5 The Discrete

Fourier Transform (DFT)การแปลงฟูรเิยรแ์บบไมต่่อเน่ือง

ผศ.ดร . พรีะพล ยุวภษิูตานนท์ภาควชิา วศิวกรรมอิเล็กทรอนิกส์

DSP5-1CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 2: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

เป้าหมาย

• นศ รูจ้กัความหมายของ อนุกรมฟูรเิยรแ์บบไมต่่อเนื่อง (Discrete Fourier Series :DFS) และผลการแปลงจากสญัญาณในโดเมนเวลา

• นศ เขา้ใจความสมัพนัธข์อง การแปลงฟูรเิยรแ์บบไม่ต่อเนื่อง (Discrete Fourier Transform: DFT) และ DFS

• นศ สามารถทำาการแปลง DFT กับสญัญาณเชงิเวลาใดๆได้

DSP5-2CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 3: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-3

ทำาไมต้อง DFT ?

( ) ( )j j n

nX e x n e

แต่ หากจะคำานวณ DTFT ด้วย โปรเซสเซอร ์หรอื คอมพวิเตอร ์จะต้องจดัการให้ลำาดับ n มค่ีาท่ีจำากัด

แต่จากเรื่องของ DTFT สงัเกตวา่ n มค่ีาไมจ่ำากัด

หากต้องการใชค้อมพวิเตอรห์รอืตัวประมวลผลมาชว่ยคำานวณผลเราต้องการจำานวนลำาดับท่ีจำากัด

ดังนัน้จงึต้องใช ้การแปลงฟูรเิยรแ์บบไมต่่อเน่ือง Discrete Fourier Transform (DFT)

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 4: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-4

อนุกรมฟูรเิยรแ์บบไมต่่อเน่ืองThe Discrete Fourier Series

(DFS) ( ) ( ), ,x n x n kN n N ใหส้ญัญาณท่ีเป็นรายคาบ

2Nความถ่ีมูลฐาน เป็น เรเดียน2 , 0,1,..., 1k k NN

ความถี่ฮารม์อนิก เป็น21

0

1( ) ( ) , 0, 1,...N j kn

N

kx n X k e n

N

21

0( ) ( ) , 0, 1,...

N j nkN

kX k x k e k

( )X kคือ ค่าสมัประสทิธิ ์ฟูรเิยรไ์มต่่อเน่ือง โดยท่ี

แสดง ได้เป็น( )x n

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 5: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-5

( ) ( )X k N X k

2jN

NW e

1

0

1

0

( ) DFS[ ( )] ( )

1( ) IDFS[ ( )] ( )

NnkN

k

Nnk

Nk

X k x k x k W

x k X k X k WN

Analysis (DFS) equation:

Synthesis (IDFS) equation:

เราแทน

( )X k ก็เป็นสญัญาณรายคาบ

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 6: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-6

( ) ...,0,1,2,3,0,1,2,3,0,...x k

ตัวอยา่ง

วธิทีำา

หา DFS ของสญัญาณรายคาบ

ดจูากลักษณะสญัญาณ จะได้ คาบเวลา = 4 (N=4 ) 2 24

j jN

NW e e j

3

40

( ) ( ) , 0, 1,...nk

nX k x n W k

3 30

40 0

(0) ( ) ( ) (0) (1) (2) (3) 6n

n nX x n W x n x x x x

k=0

k=1 3 31

40 0

3 32 2

40 0

3 33 3

40 0

(1) ( ) ( )( ) ( 2 2 )

(2) ( ) ( )( ) 2

(3) ( ) ( )( ) 2 2

n n

n n

n n

n n

n n

n n

X x n W x n j j

X x n W x n j

X x n W x n j j

k=2k=3

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 7: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-7

ตัวอยา่ง

วธิทีำา

dsp_5_1.eps

L

N

มสีญัญาณพลัส ์(pulse) เป็น รายคาบดังรูป จงหาอนุกรม DFS

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 8: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-8

2 21 1

0 0( ) ( )

N Lj nk j nkN N

n nX k x n e e

แปลง DFT

หรอืใชตั้วชว่ยจาก ผลรวมเรขาคณิตแบบจำากัด จะดีกวา่ไหม?เราจะนัง่คำานวณด้วยมอืก็ได้…

1

0

1 , 11

LLn

n

aa aa

221

20

1( ) ( )1

Lj kNL j k nNkjn N

eX k ee

ทำาใหไ้ด้

( ) , 0, , 2 ...X k L k N N แต่เฉพาะท่ี 0, , 2 ..k N N

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 9: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-9

ชว่งพลัสบ์วก L=5 และคาบเป็น N=20

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 10: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-10

ชว่งพลัสบ์วก L=5 และคาบเป็น N=40

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 11: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-11

ชว่งพลัสบ์วก L=5 และคาบเป็น N=60

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 12: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-12

ชว่งพลัสบ์วก L=7 และคาบเป็น N=60

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 13: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-13

ขอ้สงัเกตุ

• ชว่งระยะพลัสบ์วก สมัพนัธก์ับ คาบเวลาและขนาดของผลการแปลง DFS ดังนี้

L

L

L

L

( )x n

( )X k

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 14: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-14

DFS กับ z-transform และ DTFTสำาหรบัสญัญาณจำานวนจำากัดใดๆ

, 0 1( )

0,nonzero n N

x notherwise

จดัใหเ้ป็น สญัญาณท่ีเป็นคาบได้โดยใชส้ญัญาณเฉพาะ n = 0 ถึง N-1( ), 0 1

( )0,x n n N

x notherwise

0 5

N=6

0 5

( )x n

( )x n

และบวกรวม ( ) ( )

rx n x n rN

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 15: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-15

DFS กับ z-transform และ DTFT (ต่อ)

21

0

21

0

( ) ( )

( )

N j nkN

n

nN j k

N

n

X k x n e

x n e

2( ) ( ) j kNz e

X k X z

ความสมัพนัธ ์DFS และ z-transform

2( ) ( )jk

N

X k X e

ความสมัพนัธ ์DFS และ DTFT

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 16: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-16

DFT กับ DFS• DFS เป็นการแปลงสญัญาณเชงิเวลาไมต่่อเนื่องและเป็นคาบ

ใหเ้ป็นสญัญาณเชงิความถ่ีแบบไมต่่อเนื่องและเป็นคาบ • แต่สญัญาณบางอยา่งทัว่ๆไป อาจจะไมเ่ป็นคาบก็ได้• ในการวเิคราะหจ์งึต้องตัดสญัญาณนัน้มาหน่ึงชว่งและหา

DFS ของชว่งสญัญาณนัน้ ซึ่งเราสมมติใหเ้ป็นชว่งหน่ึงคาบ • และเราเรยีกการแปลง DFS กับสญัญาณเพยีงหนึ่งคาบนัน้

วา่การแปลง DFTDFT เป็นการแปลงท่ี ใชก้ารหา DFS ของสญัญาณเพยีงหนึ่งคาบ

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 17: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.YuvapoositanonDSP5-17

CTFT

( )x n

( )jX e t

( )X j

2 2n

( )X k

DTFT

0 N-10 N-1

DFS

DFT0 N-10 N-1

( )X k

k

k

1 คาบ

( )x t

( )x n

( )x n

Page 18: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-18

การเพิม่จำานวนศูนย ์(zero padding)

1, 0 3( )

0,n

x notherwise

ตัวอยา่ง เป็นสญัญาณท่ีมค่ีาเป็นหนึ่งเฉพาะยา่น

( ) [1,1,1,1]x n

4

'( ) [1,1,1,1,0,0,0,0]zeros

x n

นัน่คือตัวอยา่งเมื่อเพิม่ศูนย ์ 4 ตัว

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 19: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-19

ผลการแปลง DTFT ของ x(n)

dsp_5_6.epsCESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 20: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-20

หา DFT ของ x(n)2 2

4j jN

NW e e j

3

40

( ) ( ) , 0, 1,...nk

nX k x n W k

3 30

40 0

(0) ( ) ( ) (0) (1) (2) (3) 4n

n nX x n W x n x x x x

k=0

k=13 3

14

0 0

3 32 2

40 0

3 33 3

40 0

(1) ( ) ( )( ) 0

(2) ( ) ( )( ) 0

(3) ( ) ( )( ) 0

n n

n n

n n

n n

n n

n n

X x n W x n j

X x n W x n j

X x n W x n j

k=2k=3CESdSP EEET0485 Digital Signal Processing

http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon

Page 21: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-21

N=4

dsp_5_7.epsCESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 22: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-22

N=8

dsp_5_8.epsCESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 23: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-23dsp_5_9.eps

N=16

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 24: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-24dsp_5_10.eps

N=32

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 25: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-25

ความละเอียด (Resolution) ของการคำานวณสเปคตรมั

• การเพิม่ศูนย ์Zero padding เป็นการเติมจุดคำานวณใหม้ากขึ้น เพื่อชว่ยในการเพิม่ ความหนาแน่น (density) ของการแสดงสเปคตรมั

• แต่ไมไ่ด้เป็นการเพิม่ความละเอียด (resolution) ในการวเิคราะหส์เปคตรมั ต้องเพิม่จำานวนจุด (point) ในการคำานวณ DFT

( ) cos(0.48 ) sin(0.52 )x n n n

ตัวอยา่ง ลำาดับ x(n) มอีงค์ประกอบความถี่ อยูส่องความถ่ี

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 26: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-26

สำาหรบัสญัญาณ x(n) n=0 ถึง 9

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 27: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-27

เพิม่ศูนยอี์ก 40 ตัว

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 28: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-28

แมเ้พิม่ศูนยอี์ก 90 ตัว ก็ไมเ่พิม่ความละเอียด

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 29: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-29

ใชส้ญัญาณ x(n) จำานวน 100 ลำาดับ จะเห็นรายละเอียดของสองความถ่ี

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 30: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-30

ขนาด และ เฟสของ x(n)=[ … 0 1 0 … ]

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon

Page 31: DSP 5 The Discrete  Fourier Transform  ( DFT ) การแปลงฟูริเยร์แบบไม่ต่อเนื่อง

DSP5-31

สรุป

• DFT ใชใ้นการคำานวณการแปลงฟูรเิยร ์ด้วยตัวประมวลผล (คอมพวิเตอร ์หรอื โปรเซสเซอร์ )

• DFT ก็คือ DFS สำาหรบัสญัญาณเพยีงหน่ึงคาบ• DFT (DFS) มคีวามเชื่อมโยงกับการแปลงแซด และ

DTFT• การเพิม่ศูนย ์Zero padding เป็นการเติมจุด

คำานวณใหห้นาแน่นมากขึ้นแต่ไมช่ว่ยเรื่องความละเอียดของสเปคตรมั

CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Asst. Prof. Dr. P.Yuvapoositanon