82
2 Discrete-time Signals and Systems DSP2-1 สัญญาณและระบบแบบไม่ต่อเนื องทางเวลา รศ.ดร. พีระพล ยุวภูษิตานนท์ ภาควิชา วิศวกรรมอิเล็กทรอนิกส EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Assoc. Prof. Dr. P.Yuvapoositanon CESdSP

Dsp 2554 2

Embed Size (px)

Citation preview

Page 1: Dsp 2554 2

2

Discrete-time

Signals and Systems

DSP2-1

Signals and Systems

สัญญาณและระบบแบบไม่ต่อเนื�องทางเวลา รศ.ดร. พรีะพล ยวุภษูิตานนท์

ภาควชิา วศิวกรรมอเิล็กทรอนกิส์

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 2: Dsp 2554 2

เป้าหมาย

• นศ เขาใจสญัญาณและระบบแบบไมตอเนื่องทางเวลาที่เป็นเชงิเสน

• นศ เขาใจหลกัการประสาน (convolution)

• นศ รูจกัทฤษฎกีารสุมเบือ้งตน

DSP2-2

• นศ รูจกัทฤษฎกีารสุมเบือ้งตน

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 3: Dsp 2554 2

Continuous v.s. Discrete-time Signals

0

0.5

1

Amplit

ude

0

0.5

1

Amplit

ude

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-3

0 50−1

−0.5

Time

Amplit

ude

0 50−1

−0.5

TimeAm

plitud

eทฤษฎ ีDSP เหมอืนกบัทฤษฎ ีSignals and Systemsแต่ DSP เน้นการประมวลสญัญาณในแบบไมต่่อเนื1องทางเวลา ที1เหมาะแก่การประมวลผลบนคอมพวิเตอรห์รอืโดยตวัประมวลผล

Page 4: Dsp 2554 2

Discrete-Time Continuous Amplitude

• ในคอรสนี้ เราสนใจเฉพาะสญัญาณทีเ่ป็น Discrete-Time, Continuous Amplitude เทานัน้

DSP2-4

t

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 5: Dsp 2554 2

สัญญาณแบบอื�นๆ

001

010

011100101

0 T 2T 3T 4T 5T 6T 7T 8T 9T 10T 11T 12T 13T 14T 15T 16T 17T

Discrete time,

Discrete Amplitude

3( )x t

t

4( )x t

DSP2-5

001

010

011100101

0 T 2T 3T 4T 5T 6T 7T 8T 9T 10T 11T 12T 13T 14T 15T 16T 17T

0 T 2T 3T 4T 5T 6T 7T 8T 9T 10T 11T 12T 13T 14T 15T 16T 17T

Continuous time,

Continuous Amplitude,

Uniform time steps

Continuous time,

Discrete Amplitude

Uniform time steps

t

5( )x t

t

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 6: Dsp 2554 2

Discrete-Time Signal from

A/D Converter

• ในทางปฏบิตัเิราไดสญัญาณ Discrete-time จาก A/D Converter( )x t

A/D( )x n

DSP2-6

สญัญาณแอนะลอก สญัญาณดิจิตอล

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 7: Dsp 2554 2

DSP System Block Diagram

DSP Processor D/AA/D

( )x t ( )y n ( )y t

DSP2-7

DSP Processor D/AA/D

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 8: Dsp 2554 2

Sampling

• การสุมสญัญาณ x(t) เพือ่ทาํใหไดสญัญาณ x(n)สุ่มดว้ยความถี =

sf

tt

( )x t

DSP2-8

• ผลลพัทคอื x(n):

( )x t ( )x n

( ) ( )t nT

x n x t=

=

...1

s

Tf

=

tt

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 9: Dsp 2554 2

Combination of Sampling

• สญัญาณ x(n) = สญัญาณสุม “s(n)” คณู สญัญาณ “x(t)”

tt

( )x t

( )x n

DSP2-9

• S(n) ประกอบจากสวนยอย คอื อมิพลัสnnTT

tt

nn

( )x n×

( )s n

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 10: Dsp 2554 2

Elements of the Sampling Signal

• S(n) นัน้ประกอบจากสวนยอยๆ อมิพลัส

nn

s(n)s(n)++

DSP2-10

TTnn

nn

nn

nnTT 22TT 33TT

s(n)s(n)

++

++

==

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 11: Dsp 2554 2

An Impulse is Delta Function

• อมิพลัส คอื เดลตาฟงักชนั ใหคา “1” เมือ่ n=0

• และ ใหคา “0” เมือ่ n เป็นคาอืน่ๆ 11

( ) ( )t nT

n tδ δ=

=

อิมพัลสอิมพัลส

DSP2-11

• เขยีนเป็น

nn00

1, 0( )

0, 0

nn

==

อิมพัลสอิมพัลส

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 12: Dsp 2554 2

Shifted Delta Function

• อมิพลัสนํามารวมกนัไดเป็น s(n) ไดจากการเลือ่นคา

11อิมพัลสที่ไมมีการเลื่อนคา อิมพัลสที่ไมมีการเลื่อนคา

( )nδ

DSP2-12

nn00

nn11

11อิมพัลสที่ถูกเลื่อนไปชวงเวลา อิมพัลสที่ถูกเลื่อนไปชวงเวลา 11 ลําดบั ลําดบั

( 1)nδ −

( )nδ

00EEET0485 Digital Signal Processing

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

CESdSP

Page 13: Dsp 2554 2

Summing of Shifted Delta Function

( )nδ

( )n Tδ −

( 2 )n Tδ −

++

++

nn

nn

nn

++

++==

DSP2-13

( 2 )n Tδ −

( 3 )n Tδ −++

nn

nnTT 22TT 33TT

++

==

00

nn

( ) ( ) ( 2 ) ( 3 )n n T n T n Tδ δ δ δ+ − + − + −

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 14: Dsp 2554 2

Sampling Signals=

Summing of Delta function

• สญัญาณทีเ่ป็นสญัญาณสุมนัน้ประกอบดวย เดลตาฟงักชนัทีม่คีาการเลือ่นแตกตางกนั

( ) ( ) ( ) ( 2 ) ( 3 )s n n n T n T n Tδ δ δ δ= + − + − + −

DSP2-14

• หรือ เขยีนใหมเป็น 3

0

( ) ( )k

s n n kTδ=

= −∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 15: Dsp 2554 2

Discrete-time Signal x(n)

• x(n) สรางจาก ผลคณูของ x(t) และ s(n) เมือ่ t=nT

tt

( )x t ( )x n

nn==……×

( )s n

DSP2-15

( ) ( ) ( )k

x t t kT x nδ∞

=−∞− =∑

tt nnnn==

……×

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 16: Dsp 2554 2

DSP System Block Diagram

• ระบบ DSP ทีง่ายทีส่ดุ แสดงดงัขางลาง

DSP Processor D/AA/D

( )x t ( )y n ( )y t

DSP2-16

DSP Processor D/AA/D

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 17: Dsp 2554 2

A/D Part in DSP

• สวน A/D

DSP Processor D/AA/D

( )x t ( )y n ( )y t

DSP2-17

DSP Processor D/AA/D

Holdt nT= Quantizer

A/D ConverterA/D Converter

Sample and HoldSample and Hold

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 18: Dsp 2554 2

A/D Converter

DSP Processor D/AHoldt nT=

Quantizer

• ระบบ DSP มสีวนประกอบ A/D Converter

DSP2-18

DSP Processor D/AHold Quantizer

A/D ConverterA/D Converter

Sample and HoldSample and Hold

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 19: Dsp 2554 2

ระบบประมวลผลสัญญาณดจิติอล

( )x nA/D DSP D/A

( )x t ( )y n ( )y t

Digital Signal Processor

DSP2-19

สญัญาณดจิติอล ถูกดดัแปลงดว้ย DSP

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 20: Dsp 2554 2

Discrete-Time Systems

• ระบบไมตอเนื่องทางเวลา เขยีนแทนดวย

[ ]T i( )x n ( )y n

[ ]T i

DSP2-20

• ระบบไมตอเนื่องทางเวลา เขยีนแทนดวย• X(n) คอื สญัญาณ อนิพุท• Y(n) คอื สญัญาณ เอาทพุท• T[.] คอื ระบบ (System) หรือ ตวัจดัการสญัญาณ (processor)• ผลลพัท y(n) ของการกระทาํของ x(n) และ T[.] ไดจาก

กระบวนการประสาน (Convolution)

[ ]T i

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 21: Dsp 2554 2

( )x n ระบบปรบัมมุดาวเทยีม

( )y nตวัขบั

องศาการหมุน

ตวัอย่างระบบทรงตวัดาวเทยีม

SUN

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-21

Solar Cell Panel

Page 22: Dsp 2554 2

Example: System 1

• Example 2.2.1 from Proakis’s Text

• จงหา y(n) ในกรณี

, 3 3( )

0, otherwise

n nx n

− ≤ ≤=

) ( ) ( )A y n x n=

DSP2-22

[ ]

{ }

) ( ) ( )

) ( ) ( 1)

) ( ) ( 1)

1) ( ) ( 1) ( ) ( 1)

3) ( ) max ( 1), ( ), ( 1)

) ( ) ( )n

k

A y n x n

B y n x n

C y n x n

D y n x n x n x n

E y n x n x n x n

F y n x k=−∞

=

= −

= +

= + + + −

= + −

= ∑EEET0485 Digital Signal Processing

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

CESdSP

Page 23: Dsp 2554 2

Example: System 2

) ( ) ( )A y n x n=

{ }( ) ( ) , 3, 2,1, 0,1, 2,3,y n x n↑

= = … …

สงัเกต เครื1องหมาย แสดงถงึ n=0 อยู ่ณ ตาํแหน่งนั Sน↑

DSP2-23

) ( ) ( 1)B y n x n= −

{ }( ) , 3, 2,1, 0,1, 2,3,y n↑

= … …

) ( ) ( 1)C y n x n= +

{ }( ) , 3, 2,1, 0,1, 2,3,y n↑

= … …

สงัเกต เครื1องหมาย แสดงถงึ n=0 อยู ่ณ ตาํแหน่งนั Sน↑

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 24: Dsp 2554 2

Example: System 3

[ ]1) ( ) ( 1) ( ) ( 1)

3D y n x n x n x n= + + + −

[ ] [ ]1 1 20, (0) ( 1) (0) (1) 1 0 1

3 3 3n y x x x= = − + + = + + =

5 2 5

DSP2-24

5 2 5( ) ..., 0,1, , 2,1, ,1, 2,1, ,1, 0, ...

3 3 3y n

=

{ }) ( ) max ( 1), ( ), ( 1)E y n x n x n x n= + −

1( ) 0,3,3,3, 2,1, 2,3,3,3, 0

3y n

↑ =

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 25: Dsp 2554 2

Example: System 4

• Accumulator

) ( ) ( )n

k

F y n x k=−∞

= ∑

DSP2-25

{ }( ) , 3,5, 6, 6, 7,9,12, 0,...y n↑

= …

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 26: Dsp 2554 2

ระบบเชิงเส้นไม่แปรตามการเลื�อน (Linear Shift-invariant (LSI) Systems)

• เชงิเสน (Linear) หมายถงึ ถา ระบบ T[ ] ใหผลลพัธเป็น

[ ]T i( )x n( ) [ ( )]y n T x n=

DSP2-26

• เมือ่เปลีย่นอนิพุทเป็นดงัรูป

1 1 2 2 1 1 2 2[ ( ) ( )] [ ( )] [ ( )]T a x n a x n a T x n a T x n+ = +

[ ]T i1 1 2 2( ) ( ) ( )x n a x n a x n= + 1 1 2 2( ) [ ( )] [ ( )]y n a T x n a T x n= +

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 27: Dsp 2554 2

Example: Linear I

• Example 2.2.5 จงหาวาระบบขางลางนี้ ระบบใดเป็นหรือไมเป็นเชงิเสน

2

) ( ) ( )

) ( ) ( )

A y n nx n

B y n x n

=

=

DSP2-27

2

( )

) ( ) ( )

) ( ) ( )

) ( ) ( )

) ( ) x n

B y n x n

C y n x n

D y n Ax n B

E y n e

=

=

= +

=

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 28: Dsp 2554 2

Example: Linear 2

1 1

2 2

( ) ( )

( ) ( )

y n nx n

y n nx n

=

=

) ( ) ( )A y n nx n=

DSP2-28

3 1 1 2 2

1 1 2 2

1 1 2 2

1 1 2 2

( ) [ ( ) ( )]

[ ( ) ( )]

( ) ( )

( ) ( )

y n T a x n a x n

n a x n a x n

na x n na x n

a y n a y n

= +

= +

= +

= + เชงิเสน้

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 29: Dsp 2554 2

Example: Linear 3

2) ( ) ( )B y n x n=

21 1

22 2

( ) ( )

( ) ( )

y n x n

y n x n

=

=

DSP2-29

3 1 1 2 2

2 21 1 2 2

1 1 2 2

( ) [ ( ) ( )]

( ) ( )

( ) ( )

y n T a x n a x n

a x n a x n

a y n a y n

= +

= +

= +เชงิเสน้

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 30: Dsp 2554 2

Example: Linear 4

21 1

22 2

( ) ( )

( ) ( )

y n x n

y n x n

=

=

2) ( ) ( )C y n x n=

DSP2-30

[ ]3 1 1 2 2

2

1 1 2 2

2 2 2 21 1 1 2 1 2 2 2

2 2 21 1 2 2 1 1 2 2

( ) [ ( ) ( )]

( ) ( )

( ) 2 ( ) ( ) ( )

( ) ( ) ( ) ( )

y n T a x n a x n

a x n a x n

a x n a a x n x n a x n

a y n a y n a x n a x n

= +

= +

= + +

≠ + = +ไมเ่ชงิเสน้

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 31: Dsp 2554 2

Example: Linear 5

) ( ) ( )D y n Ax n B= +

1 1

2 2

( ) ( )

( ) ( )

y n Ax n B

y n Ax n B

= +

= +

DSP2-31

[ ]3 1 1 2 2

1 1 2 2

1 1 2 2 1 1 1 2 2 2

( ) [ ( ) ( )]

( ) ( )

( ) ( ) ( ) ( )

y n T a x n a x n

A a x n a x n B

a y n a y n Aa x n a B Aa x n a B

= +

= + +

≠ + = + + +

ไมเ่ชงิเสน้EEET0485 Digital Signal Processing

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

CESdSP

Page 32: Dsp 2554 2

Example: Linear 6

( )) ( ) x nE y n e=

1

2

( )1

( )2

( )

( )

x n

x n

y n e

y n e

=

=

DSP2-32

1 1 2 2

1 2

3 1 1 2 2

( ) ( )

( ) ( )1 1 2 2 1 2

( ) [ ( ) ( )]

( ) ( )

a x n a x n

x n x n

y n T a x n a x n

e

a y n a y n a e a e

+

= +

=

≠ + = +ไมเ่ชงิเสน้

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 33: Dsp 2554 2

Shift-invariant 1

• ไมแปรตามการเลือ่น (Shift-invariant) หมายถงึ หาก y(n) เป็นผลตอบจาก x(n)

[ ]T i( )x n ( )y n

DSP2-33

[ ]T i( )x n k−( , )y n k

ถา้ x(n) ถูกเลื1อนไป k ด ูy(n) เป็น y(n,k)

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 34: Dsp 2554 2

Shift-invariant 2

• ลองเลือ่น y(n) ไป k จะได y(n-k) และหาก

( , ) ( )y n k y n k= −

•ระบบจะเป็นแบบไมแ่ปรตามการเลื1อน (Shift-invariant)

DSP2-34

( , ) ( )y n k y n k≠ −

•ระบบจะเป็นแบบไมแ่ปรตามการเลื1อน (Shift-invariant)

•ระบบจะเป็นแบบแปรตามการเลื1อน (Shift-varying)

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 35: Dsp 2554 2

Example: Shift-Invariant 1

• Example 2.2.4 จงหาวาระบบใดเป็น Shift-invariant

) ( ) ( ) ( 1)

) ( ) ( )

A y n x n x n

B y n nx n

= − −

=

DSP2-35

0

) ( ) ( )

) ( ) ( )

) ( ) ( ) cos

B y n nx n

C y n x n

D y n x n nω

=

= −

=

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 36: Dsp 2554 2

Example: Shift-Invariant 2

) ( ) ( ) ( 1)A y n x n x n= − −

( , ) [ ( )]

( ) ( 1)

y n k T x n k

x n k x n k

= −

= − − − −

DSP2-36

( ) ( ) ( 1)y n k x n k x n k− = − − − −

•เมื1อเลื1อน y(n) ที1ไดจ้าก x(n) ไป k แซมเปิSล

( , ) ( )y n k y n k= − Shift-invariantEEET0485 Digital Signal Processing

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

CESdSP

Page 37: Dsp 2554 2

Example: Shift-Invariant 3

) ( ) ( )B y n nx n=

( , ) [ ( )]

( )

y n k T x n k

nx n k

= −

= −

สงัเกตวา่เฉพาะคา่ n ใน x(n) ถูกเปลี1ยนเป็น n-k

DSP2-37

• เมือ่เลือ่น y(n) ทีไ่ดจาก x(n) ไป k แซมเปิ้ล

( )nx n k= −

( ) ( ) ( )y n k n k x n k− = − −

ถูกเปลี1ยนเป็น n-k

( , ) ( )y n k y n k≠ − Shift-varyingEEET0485 Digital Signal Processing

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

CESdSP

Page 38: Dsp 2554 2

Example: Shift-Invariant 4

( , ) [ ( )]

( )

y n k T x n k

x n k

= − −

= − −

) ( ) ( )B y n x n= −

DSP2-38

• เมือ่เลือ่น y(n) ทีไ่ดจาก x(n) ไป k แซมเปิ้ล

( )x n k= − −

( ) ( ( ))

( )

y n k x n k

x n k

− = − −

= − +

( , ) ( )y n k y n k≠ − Shift-varyingEEET0485 Digital Signal Processing

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

CESdSP

Page 39: Dsp 2554 2

Example: Shift-Invariant 5

0

0

( , ) [ ( ) cos ]

( ) cos ( )

y n k T x n n

x n k n

ω

ω

=

= −

0) ( ) ( ) cosD y n x n nω=

DSP2-39

• เมือ่เลือ่น y(n) ทีไ่ดจาก x(n) ไป k แซมเปิ้ล

0( ) cos ( )x n k nω= −

0( ) ( ) cos ( )y n k x n k n kω− = − −

( , ) ( )y n k y n k≠ − Shift-varyingEEET0485 Digital Signal Processing

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

CESdSP

Page 40: Dsp 2554 2

สมการผลต่าง Difference Equation

• สมการของระบบจะเขยีนในรูปท ั่วไปของสมการผลตาง

N M

− − = −∑ ∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-40

1 0

( ) ( ) ( )N M

l ml m

y n a y n l b x n m= =

− − = −∑ ∑

Page 41: Dsp 2554 2

สมการอันดบัที�หนึ�ง

( ) ( 1) ( )y n a y n b x n− − =

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-41

1 0( ) ( 1) ( )y n a y n b x n− − =

Page 42: Dsp 2554 2

n=0, n=1

• n=0

• n=1

1 0(0) ( 1) (0)y a y b x= − +

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-42

1 0

1 1 0 0

21 1 0 0

(1) (0) (1)

(1) [ ( 1) (0)] (1)

(1) ( 1) (0) (1)

y a y b x

y a a y b x b x

y a y a b x b x

= +

= − + +

= − + +

Page 43: Dsp 2554 2

n=2

1 0(2) (1) (2)y a y b x= +

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-43

21 1 1 0 0 0

3 21 1 0 1 0 0

(2) [ ( 1) (1) (1)] (2)

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

y a a y a b x b x b x

y a y a b x a b x b x

= − + + +

= − + + +

Page 44: Dsp 2554 2

1 0

21 1 0 0

(0) ( 1) (0)

(1) ( 1) (0) (1)

y a y b x

y a y a b x b x

= − +

= − + +

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-44

1 1 0 0

3 21 1 0 1 0 0

4 3 21 1 0 1 0 1 0 0

(1) ( 1) (0) (1)

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

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

y a y a b x b x

y a y a b x a b x b x

y a y a b x a b x a b x b x

= − + +

= − + + +

= − + + + +

Page 45: Dsp 2554 2

• ให y(-1) =0

0(0) (0)

(1) (0) (1)

y b x

y a b x b x

=

= +

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-45

1 0 0

21 0 1 0 0

3 21 0 1 0 1 0 0

(1) (0) (1)

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

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

y a b x b x

y a b x a b x b x

y a b x a b x a b x b x

= +

= + +

= + + +

Page 46: Dsp 2554 2

• แทนคา

0 (0)

(1)

b h

a b h

=

=

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-46

1 0

21 0

31 0

(1)

(2)

(3)

a b h

a b h

a b h

=

=

=

Page 47: Dsp 2554 2

(0) (0) (0)

(1) (1) (0) (0) (1)

y h x

y h x h x

=

= +

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-47

(1) (1) (0) (0) (1)

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

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

y h x h x

y h x h x h x

y h x h x h x h x

= +

= + +

= + + +

Page 48: Dsp 2554 2

การประสาน (Convolution)

( ) (3) ( ) (2) ( 1) (1) ( 1) (0) ( )y n h x n h x n h x n h x n= + − + − +

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-48

1

0

( ) ( ) ( )K

k

y n h k x n k−

== −∑

Page 49: Dsp 2554 2

(0) (0) (0)

(1) (1) (0) (0) (1)

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

y h x

y h x h x

y h x h x h x

=

= +

= + +

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-49

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

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

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

(5) (3) (2) (2) ((5) (0) (4) (1) 3) (1)

y h x h x h x

y h x h x h x h x

y h x h x h x h x

y h x h x h

h x

h x h x

= + +

= + + +

= + + + +

= + + + +

(6) (0) (5) (1

(4) (0) (5)

(6) (3) (3) (2) (4) (1) (5) (0) () (4) ( 62) )h x h x h x

x h x

y h x h x h x h x

+

= + + + + + +

Page 50: Dsp 2554 2

FIR

• โดยท ั่วไปเราเขยีนระบบ FIR ในรูปของผลตอบสนองอมิพลัส (Impulse Response ) ขางลาง

M

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-50

0

0 1

( ) ( )

( ) ( 1) ( )

M

mm

M

y n b x n m

b x n b x n b x n M=

= −

= + − + + −

Page 51: Dsp 2554 2

การประสาน (Convolution)

( ) mh m b=

0

( ) ( )M

mm

y n b x n m=

= −∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-51

0

0

( ) ( )

m

M

m

h m x n m

=

=

= −∑

( ) ( ) ( )k

y n h k x n k∞

=−∞= −∑

Page 52: Dsp 2554 2

การประสาน Convolution (revisited)

• จาก

• สงัเกตวา ดชันี k เป็นคาลบ ซึง่หมายถงึการกลบัดาน

1

0

( ) ( ) ( )K

k

h n h k n kδ−

== −∑

DSP2-52

• สงัเกตวา ดชันี k เป็นคาลบ ซึง่หมายถงึการกลบัดาน

1

0

( ) ( ) ( )K

k

h n h k n kδ−

=−= ∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 53: Dsp 2554 2

0 1 2

0 1 2

+

3

3

n ( )y n

ผลลพัทไ์ดเ้ป็น การรวมกนัของ คา่สญัญาณที1เป็นคา่ x(n) ที1ดเีลย=์0 และ 1 และ มกีารสเกลคา่ดว้ยขนาดของ h(0)และ h(1) ตามลาํดบั

(1) ( 1)h x n −

(0) ( )h x n

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-53

0 1 2 3

0 (0) (0)x h

(1) (0) (0) (1)x h x h+1

(2) (0) (1) (1)x h x h+2(3) (0) (2) (1)x h x h+3

Page 54: Dsp 2554 2

สมการการประสาน (Convolution)

1

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

( ) ( )

y n h x n h x n k k

h k x n k=

= + − =

= −∑ สมการเฉพาะกรณตีวัอยา่งนีS

DSP2-54

0

( ) ( )

k

k

h k x n k

=

=−∞= −

∑ สมการทั 1วไปของการประสาน

สมการเฉพาะกรณตีวัอยา่งนีS

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 55: Dsp 2554 2

ระบบระบบ

System with Delta function

• สาํหรบัระบบทเีป็น เดลตา ฟงักชนั สุ่มดว้ยความถี =

sf

DSP2-55

ระบบระบบ

( ) ( )y n x n=( ) ( )h n nδ=

( ) ( )h n nδ=

( )x n

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 56: Dsp 2554 2

2

2

( ) ( ) ( )k

y n k x n kδ=−

= −∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-56

2

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

k

x n x n x n x n xδ δ δ δ δ=−

= − + + − + + + − + −

1, 0( )

0, 0

nn

==

Page 57: Dsp 2554 2

2

2

( ) ( ) ( )

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

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

k

n y n k x n k

x x x x x

x x x x x

δ

δ δ δ δ δ

δ δ δ δ δ

=−

= −

− + − + + − + −

− + − + + +

2

2

( ) ( ) ( )k

y n k x n kδ=−

= −∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-57

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

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

3 ( 2) (5) ( 1) (4) (0) (3) (1)

x x x x x

x x x x x

x x x x

δ δ δ δ δ

δ δ δ δ δ

δ δ δ δ

− + − + + +

− + − + + +

− + − + + (2) (2) (1)xδ+

1, 0( )

0, 0

nn

==

Page 58: Dsp 2554 2

2

2

( ) ( ) ( )

0 (0)

1 (1)

k

n y n k x n k

x

x

δ=−

= −∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-58

1 (1)

2 (2)

3 (3)

x

x

x

( ) ( )y n x n=

Page 59: Dsp 2554 2

Sampled Signal

nn11 2200 33

( ) ( )y n x n=

DSP2-59

11 2200 33

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

nn

Page 60: Dsp 2554 2

ระบบระบบ

System with Delayed Delta function

• สาํหรบัระบบทเีป็น เดลตา ฟงักชนั ทีม่กีารหนวงเวลา ( ) ( 1)y n x n= −สุ่มดว้ยความถี =

sf

DSP2-60

ระบบระบบ

( ) ( 1)h n nδ= −

( ) ( 1)h n nδ= −

( )x n

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 61: Dsp 2554 2

2

2

( ) ( 1) ( )k

y n k x n kδ=−

= − −∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-61

2

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

k

x n x n x n x n xδ δ δ δ δ=−

= − + + − + + − + − + −

Page 62: Dsp 2554 2

2

2

( ) ( 1) ( )

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

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

k

n y n k x n k

x x x x x

x x x x x

δ

δ δ δ δ δ

δ δ δ δ δ

=−

= − −

− + − + − + − + −

− + − + − + + −

2

2

( ) ( 1) ( )k

y n k x n kδ=−

= − −∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-62

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

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

3 ( 3) (5) ( 2) (4) ( 1) (3

x x x x x

x x x x x

x x x

δ δ δ δ δ

δ δ δ δ δ

δ δ δ

− + − + − + + −

− + − + − + +

− + − + − ) (0) (2) (1) (1)x xδ δ+ +

1, 0( )

0, 0

nn

==

Page 63: Dsp 2554 2

2

2

( ) ( ) ( )

0 ( 1)

1 (0)

k

n y n k x n k

x

x

δ=−

= −

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-63

1 (0)

2 (1)

3 (2)

x

x

x

( ) ( 1)y n x n= −

Page 64: Dsp 2554 2

Delayed Signal

nn

( ) ( 1)y n x n= −

11 2200 33

DSP2-64EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

nn11 2200 33

Page 65: Dsp 2554 2

การประสาน (Convolution)

• หากระบบไมใช เดลตาฟงักชนั เราจะคาํนวณอยางไร?

• เราเรียกการคาํนวณระบบเชนนี้วา Convolution หรือ การการการการประสานประสานประสานประสาน

ระบบระบบ

DSP2-65

( )x n ( )y n

1

0

( ) ( ) ( )K

k

h n h k n kδ−

== −∑

ระบบระบบ

(0)h (1)h

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 66: Dsp 2554 2

Convolved Signal

++11 2200 33(0)h (1)h

DSP2-66

++

11 2200 33

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

11 2200 33

Page 67: Dsp 2554 2

เปรียบเทยีบ “สัญญาณไม่ต่อเนื�อง” กับ “ผลของการประสาน”

( )x n( )y n

( )( ) ( )k

x n xk knδ∞

=−∞

= −∑ ( )( ) ( )k

y n xh n k k∞

=−∞

= −∑

DSP2-67

ผลของการประสาน กค็ือผลที)ได้จากการดดัสญัญาณหนึ)ง (อินพทุ) ด้วยสญัญาณหนึ)ง ( หรือ กค็ือ ผลตอบสนองอิมพลัสข์องระบบ)

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 68: Dsp 2554 2

ตวัอย่างการประสาน

1

2Input Sequence

x(n)

6

8Output Sequence

( ) ( ) ( 10)x n u n u n= − −

DSP2-68

0 10 20 30 40 500

n

0 10 20 30 40 500

1

2Impulse Response

n

h(n)

0 10 20 30 40 500

2

4

n

y(n)=

( ) 0.9 ( )nh n u n=

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 69: Dsp 2554 2

Example Convolution

• ตวัอยางการประสาน

( ) [1, 2,3]x n↑

=

( ) [1,1,1]h n =

DSP2-69

• คาํนวณผลการประสานเมือ่ n=-1 ถงึ 3

( ) [1,1,1]h n↑

=

( ) ( ) ( )k

y n h k x n k∞

=−∞= −∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 70: Dsp 2554 2

• จุดเริม่ตนที ่n= -1 ดจูาก x(n)

• คาํนวณ y(n)

• n = -1

( ) ( ) ( )k

y n h k x n k∞

=−∞= −∑

( ) ( ) ( 1 )1y h k x k∞

= −− −∑

( ) [1, 2,3]x n↑

=

DSP2-70

• n = -1

• n=0

• n=1

• n=2

( ) ( ) ( 1 )1k

y h k x k=−∞

= −− −∑

( ) ( ) ( )0 0k

y h k x k∞

=−∞

= −∑

( ) ( ) ( )1 1k

y h k x k∞

=−∞

= −∑

( ) ( ) ( )2 2k

y h k x k∞

=−∞

= −∑

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 71: Dsp 2554 2

n = -1

( ) ( ) ( )

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

(0) ( 0) (1) ( 1) (2) ( 2) ...

1 1

1 1

1 1 1

k

y h k x k

h x h x

h x h x h x

=−∞= −

= + − − − + − − −

+ − + − + − +

− −

− −

− − −

DSP2-71

� � �

0 0 1

... ( 2) (1) ( 1) (0)

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

... ( 2) (1) ( 1) (0) (0) ( 1) (

h x h x

h x h x h x

h xx h x hh== =

= + − + −

+ − + − + − +

+ −= − + − + +� �

0 0

1

1) ( 2) (2) ( 3) ...

1 1 1(0) ( 1)h x

x h x

=

= =

− + − +

= ×−= =

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 72: Dsp 2554 2

n = 0

( ) ( ) ( )

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

(0) ( 0) (1) ( 1) (2) ( 2) ...

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

0 0

0 0

0 00

k

y h k x k

h x h x

h x h x h x

h x h x

=−∞= −

= + − − − + − − −

+ − + − + − +

= + − + −

DSP2-72

� � � �

0 2 10

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

(0) (0) (1) ( 1) (2) ( 2) ...

... ( 2) (2) ( (0) (0) (1)1) (1 ( )1)

h x h x

h x h x h

h

x

h h x xx x h= == =

= + − + −

+ + − + − +

−= + − + − + +�

� �

0

2 1

(0) (0) (

(2) ( 2) ...

1 2 11) ( 1) 1 3h x h x

h x=

= =

+ − +

= + = × + × =−

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 73: Dsp 2554 2

การหา y(n)

dsp_2_4

n

1−(0) (0) (1) ( 1) 1 2 1 1 3h x h x+ − = × + × =0

(0) (1) (1) (0) (2) ( 1) 1 2 3 6h x h x h x+ + − = + + =1

( )y n

(0) ( 1) 1 1 1h x − = × =

DSP2-73

(0) (1) (1) (0) (2) ( 1) 1 2 3 6h x h x h x+ + − = + + =1(1) (2) (2) (1) 3 2 5h x h x+ = + =2

3 (2) (2) 3x h =

ความยาวของลาํดบั y(n) เป็น 1h xL L L= + −

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 74: Dsp 2554 2

การทาํ convolution แบบ กราฟฟิก N=0

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-74

Page 75: Dsp 2554 2

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

Assoc. Prof. Dr. P.Yuvapoositanon

DSP2-75

Page 76: Dsp 2554 2

คุณสมบตัขิองการประสาน

• Cumulative Property

• Associative property

( ) ( ) ( ) ( )x n h n h n x n∗ = ∗

DSP2-76

• Distributive property

1 2 1 2{ ( ) ( )} ( ) ( ) { ( ) ( )}x n h n h n x n h n h n∗ ∗ = ∗ ∗

1 2 1 2( ) { ( ) ( )} ( ) ( ) ( ) ( )x n h n h n x n h n x n h n∗ + = ∗ + ∗

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

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 77: Dsp 2554 2

แบบฝึกหดั Ch.2 (Proakis)

DSP2-77EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 78: Dsp 2554 2

แบบฝึกหดั Ch.2 (Proakis)

DSP2-78EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 79: Dsp 2554 2

แบบฝึกหดั Ch.2 (Proakis)

DSP2-79EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 80: Dsp 2554 2

แบบฝึกหดั Ch.2 (Proakis)

DSP2-80EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 81: Dsp 2554 2

แบบฝึกหดั Ch.2 (Proakis)

DSP2-81EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP

Page 82: Dsp 2554 2

แบบฝึกหดั Ch.2 (Proakis)

DSP2-82EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com

Assoc. Prof. Dr. P.Yuvapoositanon

CESdSP