Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
1
3Power Spectrum
Asst. Prof. Dr. Peerapol Yuvapoositanon, PhD, DIC
Department of Electronic Engineering
and
Graduate School of Electrical Engineering
Mahanakorn University of Technology
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
2
Power Spectrum
• ใชการแปลงของฟูริเยรแบบไมตอเนื่องทางเวลา (Discrete-time Fourier Transform) หรือ DTFT
• แต x(n) เปนสัญญาณสุมที่ไมอยูในรูปที่จะสามารถทําอินทีเกรทกําลังสองได
2( ) ( ) j fn
n
X f x n e
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
3
Z-transform
• โดยทั่วไปเรามักจะพบกับระบบ z-transform มากกวา DTFT เพราะใชงานหลากหลายกวา
( ) ( ) n
n
X z x n z
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
4
Z-transform v.s. DTFT
• เราจะเปลี่ยนการแปลงแซดใหเปนการแปลงฟูริเยรแบบไมตอเนื่องทางเวลาไดอยางสะดวกโดย
2j f
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
5
Z-plane
• โดยทั่วไปเราพิจารณา z-transform
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
6
ความถี่ไนควิสต
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
7
Power Spectrum และ Auto-Correlation
• สเปคตรัมกําลัง คือการแปลงฟูริเยรแบบไมตอเนื่องทางเวลาของสหสัมพันธตัวเองของสัญญาณ x(n)
2( ) ( ) j fm
m
S f r m e
xx xx
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
8
กราฟ Power Spectrum
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
9
การซ้ําคาของสเปคตรัมกําลัง
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
10
• การหาคากําลังในชวงระหวาง f1 และ f2
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
11
สเปคตรัมกําลังและระบบเชิงเสน (Power Spectrum and Linear Systems)• ระบบเชิงเสน (Linear system) แบบไมแปรเปลี่ยนตามการเลื่อน ซึ่งมีคาผลตอบสนองอิมพัลสเปน hk
( ) ( ) ( )k kk
y n h x n h x n k
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
12
• a) คาเฉลี่ยกลาง
• คา DC
2( ) j fkk
k
H f h e
(0) kk
H h
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
13
{ ( )} ( )
( )
(0)
kk
kk
kk
E y n E h x n k
h E x n k
h
H
x
x
X(n) เปน
WSS
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
14
• คาเฉลี่ยกลางของเอาทพุท = คาเฉลี่ยกลางของอินพุท * DC Gain ของระบบ
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
15
• b) สหสัมพันธตัวเอง
( ) ( ) ( )
( ) ( )
( ) ( )
( )
kk
kk
kk
r n E y m x m n
E h x m k x m n
h E x m k x m n
h r n k
yx
xx
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
16
( ) ( )
( )
kk
k
r n h r n k
h r n
yx xx
xx
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
17
• ดวยความเปนสมมาตรของฟงกชันสหสัมพันธตัวเอง ดังนั้นเราแทน n ไดดวย -n
( ) ( )
( )
( )
kk
k
r n r n
h r n k
h r n
yy yy
yx
yx
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
18
( ) ( )
( )
( ) ( )
k
k k
r n h r n k
h h r n
r k r n
yy yx
xx
hh xx
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
19
2
( ) ( ) ( ) ( )
( ) ( )
S f H f H f S f
H f S f
yy xx
xx
( ) ( ) ( )r n r k r n yy hh xx
DTFT
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
20
สเปคตรัมกําลังกับตัวเขารหัสเสียงพูด (Power Spectrum and Speech Coder)
• เปนสัญญาณรบกวนสีขาว (White Noise) ซึ่งมีสเปคตรัมกําลังเปนคาคงที่หรือ k
2( ) ( )S f k H fyy
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
21
• หรือหมายความวา สเปคตรัมกําลังของสัญญาณ เปนรูปแบบใดๆ ก็ขึ้นกับรูปรางของ โดยมีเงื่อนไขก็คือตองให x(n) เปนสัญญาณรบกวนสีขาว
2( )H f
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
22
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
23
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
24
Randn(.)
• สราง x(n) ที่มี mean =0 และ ความแปรปรวน=1
0 10 20 30 40 50 60 70 80 90 100-2.5
-2
-1.5
-1
-0.5
0
0.5
1
1.5
2
2.5
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
25
IID
• x(n) นั้นเปน เปนอิสระตอกัน และกระจายอยางเทาเทียมกัน (Independent and IdenticallyDistributed) หรือ เรียกยอๆ วา IID
( ) { ( ) ( )}
( )
r n m E x m x n
n m
xx
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
26
เมตริกซสหสัมพันธตัวเอง
• ของ IID จะเปนไดแอกอนัล (Diagonal matrix)2
2
2
2
0 0
0 0
0 0
xxR
I
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
27
ไดแอกอนัล กับ เมตริกซผกผัน
• จาก เรื่องการหาการผกผันของเมตริกซ (Inverse Matrix) เราจึงไดโดยงายวา
12
xx
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
28
• และจากเรื่อง System identification เราจึงได
1
2
xx dx
dx
h R r
r
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
29
สัญญาณสุมแบบเกาส
• สัญญาณสุมแบบเกาส
2
2
1 ( ) ( )( ( )) exp
2 2i i
x i if x i
( ) ~ ( ( ), )ix i iN
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
30
1 1 0 0
1 1 0 0
1 0 1 0 0 1 1 0
1 0 1 0
( ) ( ) ( ) ( )
( ) ( ) } { ( ) ( )
{ ( )} { ( )} ( ) { ( )} ( ) { ( )} ( ) ( )
( ) ( ) ( ) ( )
0
E x n n x n n
E x n n E x n n
E x n E x n n E x n n E x n n n
n n n n
x(n) เปน IID
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
31
การสรางแบบจําลองของสัญญาณสุมModelling of Random Signals
• Transfer function
10 1
11
( )( )
( )1
NN
MN
b b z b z B zH z
A za z a z
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
32
ระบบแบบเฟสนอยสุดMinimum Phase Systems
• ตําแหนงของซีโรที่อยูภายในวงกลมหนึ่งหนวยจะเปนตัวกําหนดความเปนระบบเฟสนอยสุด
• ซีโรของระบบจะตองอยูภายในวงกลมหนึ่งหนวย
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
33
• ตัวอยาง
• ซีโรเพียงตัวเดียวซึ่งอยู ณ ตําแหนง z=-1
1( ) 1H z z
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
34
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
35
ผลตอบสนองความถี่
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
36
• ตัวอยาง 1
1( ) 1 0.5H z z
-1 -0.5 0 0.5 1
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
Real Part
Imag
inar
y P
art
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
37
• ตัวอยาง
-2 -1.5 -1 -0.5 0 0.5 1
-1
-0.5
0
0.5
1
Real Part
Imag
inar
y P
art
12( ) 1 2H z z
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
38
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-30
-20
-10
0
Normalized Frequency ( rad/sample)
Pha
se (
degr
ees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
-5
0
5
Normalized Frequency ( rad/sample)
Mag
nitu
de (
dB)
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
39
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1-200
-150
-100
-50
0
Normalized Frequency ( rad/sample)
Pha
se (
degr
ees)
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 10
5
10
Normalized Frequency ( rad/sample)
Mag
nitu
de (
dB)
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
40
ซีโรอยูในวงกลมหนึ่งหนวย
• ตําแหนงซีโรที่อยูในวงกลมหนึ่งหนวย ถูกแปลงเปนโพลในวงกลมหนึ่งหนวยและมีสเถียรภาพ
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
41
ซีโรอยูนอกวงกลมหนึ่งหนวย
• ตําแหนงซีโรที่อยูนอกวงกลมหนึ่งหนวยนี้จะกอใหเกิดความไมมีเสถียรภาพ (Instability)
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
42
ตัวอยางการใชงานสเปคตรัมกําลัง
• ตองการสงสัญญาณเสียงพูดผานสายโทรศัพทที่ม ีแบนดวิทต่ํา ๆ ( 4 kHz)
• เพื่อลดปริมาณการสงขอมูล เราใชการเขารหัสที่เรียกวา Linear Prediction Coding (LPC)
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
43
สเปคตรัมกําลังของเสียงพูด
• เราใชการสงขอมูลสําคัญคือ ความถี่ฟอรแมนท (Formant frequencies)
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
44
การเขารหัสทํานายคาเชิงเสน (Linear Predictive Coding LPC)
• ประมาณคา a ของระบบ MA แลวสงเฉพาะ a
2 3 1(̂ ) ( 1) ( 2) .... ( )px n a x n a x n a x n p
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
45
การสรางคืนสัญญาณเสียงพูด
• สรางสัญญาณพูดจากระบบ AR โดยใชเฉพาะ a
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
46
ตัวอยาง
• ตัวอยาง
1( ) 1 0.8MAH z z
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
47
สหสัมพันธตัวเองของ x(n)
• ให x(n) เปนสัญญาณรบกวนสีขาว ( IID )
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
48
2(0) { ( )}yyr E y n
1
0 10
( ) ( ) ( ) ( 1)kk
y n h x n k h x n h x n
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
49
• เพราะ x(n) เปนสัญญาณรบกวนสีขาว
212 2 2 20 0 1 1
0
2 2 2 20 0 1 1
0
2 2 2 20 1
( ) ( ) 2 ( ) ( 1) ( 1)
( ) 2 { ( ) ( 1)} ( 1)
kk
x x
E h x n k E h x n h x n h x n h x n
h E x n h h E x n x n h E x n
h h
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
50
• ที ่n =0
12 2 2 2
0
(0) 1 0.8yy k xk
r h
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
51
• ที ่n =-1, +1
0 1(1) ( 1) 1 0.8yy yyr r h h
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
52
Advanced Digital Signal Processinghttp://embedsigproc.wordpress.com
Asst. Prof. Dr. P.Yuvapoositanon
53