Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
EEET0772/0872 Advanced Digital Signal Processing
1 Introduction to
Advanced Digital Signal Processing
Assoc. Prof. Dr. Peerapol Yuvapoositanon Dept. of Electronic Engineering
CESdSP
EEET0772/0872 Advanced Digital Signal Processing http://embedsigproc.wordpress.com/eeet0772
Assoc. Prof. Dr. P.Yuvapoositanon
1
Course Outline
• Introduction to ADSP • Random Signals / Power Spectrum • Estimation in Signal Processing • Cramer-Rao Lower Bound • Linear Models • Best Linear Unbiased Estimators • Maximum Likelihood Estimators • Least Squares Estimators CESdSP
EEET0772/0872 Advanced Digital Signal Processing http://embedsigproc.wordpress.com/eeet0772
Assoc. Prof. Dr. P.Yuvapoositanon 2
Evaluation
• การบาน 10% • กลางภาค 30% • ปลายภาค 60%
CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
3
Book
CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
“การประมวลผลสญญาณดจตอลขนสง พนฐานของทฤษฎการประมาณคา Advanced Digital Signal Processing: Fundamentals of Estimation Theory ” รศ.ดร.พระพล ยวภษตานนท (Ph.D., DIC)
4
Software
CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
5
Course website http://embedsigproc.wordpress.com/eeet0
772/
CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
6
What is DSP ?
• สญญาณ (Signals) : คอ การแปรรปของพลงงานทท งมองเหนและมองไมเหน ไดยนและไมไดยน สมผสไดและสมผสไมได ใหเปนปรมาณทางไฟฟา
สญญาณเรดาร เสยงพด เสยงเพลง เสยงปลาวาฬ
อนฟราเรด คลนสญญาณโทรศพท คลนสนาม สญญาณมอของจราจร กลนไวน แรงกระแทก และ อนๆ อกมากมาย...
7 CESdSP
EEET0772/0872 Advanced Digital Signal Processing http://embedsigproc.wordpress.com/eeet0772
Assoc. Prof. Dr. P.Yuvapoositanon
Digital Signal Processing v.s. Advanced Digital Signal Processing
• Digital Signal Processing = กระบวนการ (Process) ทางดจตอลทชวยหาความหมาย ของสญญาณ (signals) ทไมสามารถเขาใจไดดวย ตา ห จมก ลน สมผส โดยเนนไปทสญญาณเชงกาหนด (deterministic signals)
• Advanced Digital Signal Processing = กระบวนการ DSP ทเนนไปทสญญาณสม (Random Signals) 8 CESdSP
EEET0772/0872 Advanced Digital Signal Processing http://embedsigproc.wordpress.com/eeet0772
Assoc. Prof. Dr. P.Yuvapoositanon
Fundamentals of Random Signals
9 CESdSP
EEET0772/0872 Advanced Digital Signal Processing http://embedsigproc.wordpress.com/eeet0772
Assoc. Prof. Dr. P.Yuvapoositanon
Random Signals
• สญญาณโดยท วไปนนอยในรปสญญาณทไมแนนอน • เรยกสญญาณทมความไมแนนอนนนวาสญญาณสม
(Random Signal) สญญาณรบกวน
CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
10
0 500 1000 1500 2000 2500 3000 3500 4000 4500-3
-2
-1
0
1
2
3
4
เสยงพดวา Matlab
Statistics Parameters
• เราไมสามารถ ใช spectrum ในการหาความหมายของสญญาณสม ได
• เราใช คาสถต (Statistics) คาเฉลย (Mean) คา Correlation
11 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Expectation Value
• คาเฉลยของสญญาณ (mean) แสดง ปรมาณกลางของสญญาณ
n
1( )x n
0 1K
1( )x n
E{x(n)} = คาคาดหวง (expected value) ของสญญาณ
12 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Correlation
• คา correlation นนไดเปนการบอกวาสญญาณมความเหมอนกนหรอไม? ทเวลาการหนวงเทาใด?
• คานวณจากคาเฉลยเชงสถตของผลคณของสองสญญาณ • คาเฉลยเชงสถตดงกลาวเรยกวา คาคาดหวง (expectation value) • ตวอยางคา correlation ของ A และ B ม สญลกษณ
A B = E{A*B}
E{ } =Expectation operator
A A = E{A*A}
Cross-correlation
Auto-correlation
13 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Auto and Cross correlation
• Autocorrelation
• Cross-correlation
A
A C
A
B D
14 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Random Signal
• สมมตวา สญญาณสม (เชน เสยงพด) เปนดงรป
15 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
AutoCorrelation
• เราทาการหา autocorrelation ของ สญญาณสม
A
A
16 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Different Signals
• หากมสญญาณสม B ท ไมเหมอน A
17 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Different Random Signals
• ความแตกตาง
A
A
A-A
A
B
A-B
18 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Cross Correlation
• คณสมบตสญญาณสมนนไมสามารถดได (หรอดไดยาก) จาก “ตาเปลา” แตสามารถใช cross correlation ตรวจสอบได
A
B
19 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Cross Correlation
• สาหรบสญญาณทไมเหมอนกน ไมม crosscorrelation
A
C
20 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Communication Signal
• สญญาณในการสอสารดจตอล เชน โทรศพทมอถอนนจะเปนสญญาณทเปนขอมลขาวสาร (information)
• ตามทฤษฎขอมล (Information Theory) ของ C.E. Shannon นน ยงสญญาณมความเปนขอมลมาก กยงมความเปนสญญาณสมมากดวย
1 0 1 0 1 0 1 1 1 0 0 1
ขอมลขาวสาร = สญญาณสม
21 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Cross Correlation Application Code Division Multiple Access (CDMA)
• ใชการเขารหส
1 0 1 0 1 0 1 1 1 0 1 1
0 1 0 1 1
Code
1 X
“1” ….
….
Bit 1 Bit 2
Chip
Modulation
DATA 1 1 0
22 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
CDMA Receiver
0 1 0 1 1
Code
1 X Correlation
1 0 1 0 1 0 1 1 1 0 1 1 “1”
….
Bit 1 Bit 2 Chip
1 1 0
Integration
23 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Simulink Model of CDMA
Note: ในทางปฏบต เราใช +1 และ -1 แทนขอมล 1 และ 0 ตามลาดบ
24 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Decoding
Code ถกตอง
Code ไมถกตอง
สญญาณ mod สญญาณ Demod
25 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Adaptive Signal Processing
• การประมวลผลสญญาณแบบอนพทเปนแบบ สญญาณสม โดยเฉพาะ เรอง การประมวลผลสญญาณแบบปรบตวได (adaptive signal processing)
• ความตองการคอ การหกลางผลทไมตองการ เชน ผลของ channel ในเรอง Equalisation ผลของ room ในเรองของ Echo Cancellation ผลของ transfer function ของผวหนงในการวด ecg
26 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Channel Equalisation
Multipath Channel
1
1 0 1 0
2 1 0 ? ?
1
ไมม multipath
ม multipath
I)
II)
27 CESdSP
EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Transfer Function • เมอแปลงผลของ channel ดวยการทาการแปลง z
• กรณไมม multipath H(z) =1 • Multipath ทาใหเกดการผดเพยนทางโดเมนเวลา • เราแกไขงายกวาหากแก Multipath ทางโดเมนความถ
1 2 z
f t
1 z
f t
H(z)=1
H(z)=?
ไมม multipath
ม multipath
28 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Basic Equalisation I
• เราใช Equaliser ในการดดแปลง channel ให มคา H(z) เปน 1 ดวยการทา inverse
Channel Equaliser
H(z) 1/H(z)
*
29 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Basic Equalisation II
• กรณท ไมทราบ channel H(z) เราตองอาศยการปรบคาเองจาก error
Channel Adaptive Equaliser
H(z) 1/H(z)
*
+ e
d
y + - x
30 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Adaptive Algorithm
• คาผดพลาด error= d-y คาใหม = คาเดม + สเกล * คาผดพลาด*อนพท
เรยกวา Least-Mean Square (LMS) algorithm
w(n)=w(n-1) + mu*e(n)*x(n)
For n=1:N
end
e(n)= d(n)-y(n)
Algorithm
31 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
LMS Algorithm Block
• บลอก LMS
Normalization
32 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Adaptive Equalisation
• ตวอยางการใชบลอก LMS สรางระบบ Adaptive Equaliser
33 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Noise Cancellation
• สญญาณรบกวนเปนสงทเราไมตองการ
• วธการทงายทสดกคอ แกดวย หฟงแบบพเศษ
34 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Basic of Noise Cancellation • การสรางสญญาณกลบเฟสทาใหเกดบรเวณเงยบ • Active Noise Canceller สรางสญญาณกลบเฟสดวยอลกอรธม DSP
Feedback ANC
สญญาณรบกวน Pilot Mic
Loudspeaker
บรเวณเงยบ
n
n -n
35 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Active Noise Cancellation Headphones
• การใชงาน ANC ทไดผลด คอ ใน Headphones
LX-18 Active Noise Cancelling Headphones
36 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Diagram of Active Noise Cancellation Headphones
CESdSP 37
H(z)
n n
y
1. สญญาณเขา n ท Ext.Mic 2. n ถกดดแปลงเปน n จาก H(z) ท Pilot Mic. 3. ANC พยายามสราง y เปน n ทกลบเฟส (คอ –n)
1 2
3
H(z) เปนโมเดลทาง Acoustic
Ext.Mic
Pilot Mic Quiet Zone
EEET0772/0872 Advanced Digital Signal Processing http://embedsigproc.wordpress.com/eeet0772
Assoc. Prof. Dr. P.Yuvapoositanon
ANC
• แปลงโมเดล Loudspeaker
Algorithm
+
Exterior Mic
e
y n
Pilot Mic n
ANC
FIR
38 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
ANC Simulink Model
• Dspanc_win32.mdl
39 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Adaptive Time Delay Estimation
• จากเรองของการทา Adaptive Time Delay
Adaptive Equaliser
+ error
d
y + - x
Delay d
+
Noise
40 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
ADTE: Simulink Model
• lmsadte.mdl คาสมประสทธตวกรอง
แสดงตาแหนงของการ
หนวง
9
9
41 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
ECG Measurement
• สญญาณ ECG เปนสญญาณทสาคญ เพอตรวจสอบอาการผดปกตตางๆ ของ หวใจ
42 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
ECG Signal
• ใช Matlab ในการสราง ecg
43 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
ECG Measuring Circuit
• บลอกไดอะแกรมของวงจรสาหรบการวด ECG
44 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Diagram of ECG Measurement with Noise
CESdSP 45
H(z)
1 2
3
H(z) เปนTransfer Function ของผวหนง
ECG Sensor
220 Vac 50Hz
ผวหนง ขนาดและเฟส
ของ 220 V
ถกเปลยนแปลง
ดวย H(z)
ECG
4
50 Hz
50 Hz
EEET0772/0872 Advanced Digital Signal Processing http://embedsigproc.wordpress.com/eeet0772
Assoc. Prof. Dr. P.Yuvapoositanon
50Hz Notch Filtering
• เราจะทาการตดสญญาณ 50 Hz ดวย Notch filter
From ECG Sensor
Notch Filter
Filtered ECG
50 Hz f 50 Hz
46 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Cancelling 50Hz in ECG
• ออกแบบ Notch filter ดวย Fdatool บลอกใน Simulink
50Hz
50 Hz f
Fpass1 40 Hz Fstop1
45 Hz
Fpass2
55 Hz
Fstop2
60 Hz
47 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Cancelling 50Hz in ECG
• ระบบ 50Hz Canceling ดวย Notch filter
Notch
Filter
48 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Cancelling 50Hz in ECG
49 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Cancelling 50Hz in ECG
• กรณสญญาณเขามาเปนม distortion เชน สญญาณไมเปน sine แทจรง เชน มการ clipping
Nonlinear Wave
Transfer Function
ของผวหนง
50 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Cancelling 50Hz in ECG
• ฮารโมนกไมลด
51 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Cancelling 50Hz in ECG
• ทดลองสราง adaptive filter ดวยบลอก nLMS
52 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon
Cancelling 50Hz in ECG
ฮารโมนก
ลดลง
53 CESdSP EEET0772/0872 Advanced Digital Signal Processing
http://embedsigproc.wordpress.com/eeet0772 Assoc. Prof. Dr. P.Yuvapoositanon