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
เป้าหมาย
• นศ เขาใจสญัญาณและระบบแบบไมตอเนื่องทางเวลาที่เป็นเชงิเสน
• นศ เขาใจหลกัการประสาน (convolution)
• นศ รูจกัทฤษฎกีารสุมเบือ้งตน
DSP2-2
• นศ รูจกัทฤษฎกีารสุมเบือ้งตน
EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
CESdSP
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เหมาะแก่การประมวลผลบนคอมพวิเตอรห์รอืโดยตวัประมวลผล
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
สัญญาณแบบอื�นๆ
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
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
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
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
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
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
An Impulse is Delta Function
• อมิพลัส คอื เดลตาฟงักชนั ใหคา “1” เมือ่ n=0
• และ ใหคา “0” เมือ่ n เป็นคาอืน่ๆ 11
( ) ( )t nT
n tδ δ=
=
อิมพัลสอิมพัลส
DSP2-11
• เขยีนเป็น
nn00
1, 0( )
0, 0
nn
nδ
==
≠
อิมพัลสอิมพัลส
EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
CESdSP
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
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
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
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
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
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
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
ระบบประมวลผลสัญญาณดจิติอล
( )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
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
( )x n ระบบปรบัมมุดาวเทยีม
( )y nตวัขบั
องศาการหมุน
ตวัอย่างระบบทรงตวัดาวเทยีม
SUN
CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
DSP2-21
Solar Cell Panel
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
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
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
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
ระบบเชิงเส้นไม่แปรตามการเลื�อน (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
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
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
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
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
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
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
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
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
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
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
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
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
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
สมการผลต่าง 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= =
− − = −∑ ∑
สมการอันดบัที�หนึ�ง
( ) ( 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− − =
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
= +
= − + +
= − + +
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
= − + + +
= − + + +
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
= − + +
= − + + +
= − + + + +
• ให 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
= +
= + +
= + + +
• แทนคา
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
=
=
=
(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
= +
= + +
= + + +
การประสาน (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−
== −∑
(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
+
= + + + + + +
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=
= −
= + − + + −
∑
⋯
การประสาน (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∞
=−∞= −∑
การประสาน 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
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
สมการการประสาน (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
ระบบระบบ
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
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
nδ
==
≠
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
nδ
==
≠
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=
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
ระบบระบบ
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
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δ δ δ δ δ=−
= − + + − + + − + − + −
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
nδ
==
≠
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= −
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
การประสาน (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
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
เปรียบเทยีบ “สัญญาณไม่ต่อเนื�อง” กับ “ผลของการประสาน”
( )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
ตวัอย่างการประสาน
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
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
• จุดเริม่ตนที ่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
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
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
การหา 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
การทาํ convolution แบบ กราฟฟิก N=0
CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
DSP2-74
CESdSP EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
DSP2-75
คุณสมบตัขิองการประสาน
• 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
แบบฝึกหดั Ch.2 (Proakis)
DSP2-77EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
CESdSP
แบบฝึกหดั Ch.2 (Proakis)
DSP2-78EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
CESdSP
แบบฝึกหดั Ch.2 (Proakis)
DSP2-79EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
CESdSP
แบบฝึกหดั Ch.2 (Proakis)
DSP2-80EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
CESdSP
แบบฝึกหดั Ch.2 (Proakis)
DSP2-81EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
CESdSP
แบบฝึกหดั Ch.2 (Proakis)
DSP2-82EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com
Assoc. Prof. Dr. P.Yuvapoositanon
CESdSP