500 likes | 915 Views
DSP 7 Digital Filter Structures โครงสร้างตัวกรองดิจิตอล. ผศ.ดร. พีระพล ยุวภูษิตานนท์ ภาควิชา วิศวกรรมอิเล็กทรอนิกส์. เป้าหมาย. นศ รู้จักความหมายของตัวกรองดิจิตอล และ โครงสร้างแบบต่างๆ
E N D
DSP 7Digital Filter Structures โครงสร้างตัวกรองดิจิตอล ผศ.ดร. พีระพล ยุวภูษิตานนท์ ภาควิชา วิศวกรรมอิเล็กทรอนิกส์ EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
เป้าหมาย • นศ รู้จักความหมายของตัวกรองดิจิตอล และ โครงสร้างแบบต่างๆ • นศ รู้จักวิธีการสร้างตัวกรองดิจิตอล ที่แสดงในรูปของกราฟการไหลสัญญาณ (signal flow graph) จากฟังก์ชันถ่ายโอน (transfer function) EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
Aircraft control motor control special effects ดนตรี เครื่องเสียง Digital Controller CD/ DAT Digital Filters โทรคมนาคม การแพทย์ Mobile Receivers X-rays Bluetooth Digital TV ECG monitoring 3-D reconstruction EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
การใช้งานตัวกรองดิจิตอลการใช้งานตัวกรองดิจิตอล • ตัวกรองดิจิตอลคือการประมวลผลสัญญาณในโดเมนเวลาเพื่อดัดแปลงผลตอบสนองทางความถี่ในทางขนาด และ/หรือ เฟส ตัวอย่าง 1: เพื่อกรองสัญญาณรบกวน ออกจาก สัญญาณที่ต้องการ เช่นสัญญาณเสียงที่มีการรบกวนจากสภาวะรอบข้าง ตัวกรองดิจิตอล Digital Filter สัญญาณเสียง + สัญญาณรบกวน สัญญาณเสียง EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
การใช้งานตัวกรองดิจิตอล (ต่อ) ตัวอย่าง 2: แยกสัญญาณที่ปะปนกัน เช่นในการวัดสัญญาณคลื่นไฟฟ้า หัวใจ (ECG) ของแม่และทารกในครรภ์ ที่จะมีการปะปนของสอง สัญญาณ สัญญาณ ECG แม่ ตัวกรองดิจิตอล Digital Filter สัญญาณ ECG แม่ + สัญญาณ ECG ทารก สัญญาณ ECG ทารก EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ECG ที่ไม่มีสัญญาณรบกวน EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ECG ที่มีสัญญาณรบกวน 50 Hz EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ECG ที่ถูกกำจัดสัญญาณ 50 Hz EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
GSM Downconverter Block Diagram EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
Spectral Mask EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
A cascaded integrated comb (CIC) decimation filter EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ชนิดของตัวกรองดิจิตอลชนิดของตัวกรองดิจิตอล ตัวกรองดิจิตอลอาจจะแสดงในรูปสมการความแตกต่าง ซึ่งเป็น สมการความแตกต่างอันดับที่หนึ่ง หรืออยู่ในรูป ฟังก์ชันถ่ายโอน (Transfer function) EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ชนิดของตัวกรองดิจิตอล (ต่อ) ตัวกรองอิมพัลส์จำกัด (Finite Impulse Response: FIR) h(n) ตัวกรองอิมพัลส์ไม่จำกัด (Infinite Impulse Response: IIR) h(n) … EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
บล็อกย่อยของตัวกรองดิจิตอลบล็อกย่อยของตัวกรองดิจิตอล • หน่วยพื้นฐาน (Basic Elements) • ตัวบวก • ตัวคูณ • ตัวหน่วงเวลา A หมายเหตุ: ลูกศรที่ไม่เขียนค่ากำกับไว้ จะเท่ากับการคูณด้วย “1” EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ตัวกรองดิจิตอลและผลตอบสนองความถี่ สมการความแตกต่างหนึ่งแสดงได้เป็น ตัวอย่าง ให้ ได้ผลตอบสนองความถี่ เมื่อใช้การแปลง z เราจะได้ฟังก์ชันถ่ายโอน หรือ ตัวกรองดิจิตอล EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ผลตอบสนองความถี่ของ MATLAB code w = [0:0.01:pi];% frequency points H = 0.5+0.5*exp(- i * w); subplot(2,1,1);plot(w, abs(H)) subplot(2,1,2);plot(w, angle(H)) เราได้ ตัวกรองดิจิตอล แบบ วงจรกรองต่ำผ่าน (Low pass filter) dsp_7_1.eps EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
IIR Direct form I and II Cascade form Parallel form โครงสร้างของตัวกรองดิจิตอล • FIR • Direct form • Cascade form • Linear-phase form • Frequency-sampling EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
FIR Direct Form เนื่องจากตัวกรอง FIR มีสมการเป็น องค์ประกอบของตัวหน่วงเวลาและตัวคูณ จึงตรงไปตรงมา ตัวอย่างกรณี q=3 EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
FIR: Cascade Form โครงสร้าง นี้จะแบ่ง ออกเป็น ตัวกรองแบบออเดอร์ที่สอง หลายๆ ตัว โดยที่ ซึ่งหมายถึงการปัด “ลง” เลขจำนวนต็ม EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
FIR: Cascade Form (ต่อ) กรณี M=5 EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
FIR: Linear-phase Form ตัวกรองที่มีเฟสเชิงเส้น นั้นสามารถมีผลตอบสนองอิมพัลส์ได้ทั้งแบบ: 1 สมมาตร (symmetric) 2.สมมาตรตรงกันข้าม (Anti-symmetric) ถ้า N เป็น เลขคู่ และ h(n) เป็นสมมาตร (1) ตัวอย่าง กรณี N=6 0 1 2 3 4 5 EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
0 1 2 3 4 5 การรวบเทอมช่วยให้ลดการคูณลงไป 50 % !! EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
FIR: Linear-phase FormTYPE I (กรณี N= เลขคู่) ... ... EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
FIR: Linear-phase FormTYPE II (กรณี N = เลขคี่) ... ... EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
FIR: Frequency Sampling (1) เป็นการสร้างตัวกรองโดยใช้ สัมประสิทธิ์ จาก DFT จาก DFT EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
FIR: Frequency Sampling (2) เทียบเท่ากับ การ cascade ของ วงจรกรอง และตัวกรองแบบหนึ่งโพล จำนวน N ตัว EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
FIR: Frequency Sampling (3) EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
IIR: Direct Forms ตัวกรองแบบ IIR มีฟังก์ชันถ่ายโอนเป็น เขียนเป็นสมการความแตกต่าง (difference eq.) จะพบว่า ส่วนของตัวกรอง FIR คือส่วนตัวเศษ nominator FIR ดังนั้น รูปแบบแรกของตัวกรอง IIR จึงเป็น Direct form EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
IIR: Direct Form I EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
สลับลำดับของ “เศษ”และ “ส่วน” ส่วน เศษ EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
IIR: Direct Form II EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
IIR: Cascade เราสามารถใช้โครงสร้างcascade ของ FIR กับตัวกรอง IIR ได้ ซึ่งเป็นตัวกรองอันดับที่ 1 แต่หาก สปส เป็นเลขเชิงซ้อน เราได้ ซึ่งมีโครงสร้างเป็นตัวกรองอันดับที่สอง EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
IIR: Cascade (ต่อ) EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
IIR: Parallel Form เรายังสามารถ แยกส่วนประกอบออกเป็นผลคูณของเทอมย่อยๆ ใช้วิธี Partial Fraction Expansion ในการแยก factor ได้ โดยที และ เป็นเลขเชิงซ้อน EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
IIR: Parallel Form (ต่อ) กรณี N =4 ( Ns=2) EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ตัวอย่างโจทย์ FIR 1 จงหาผลตอบสนองความถี่ ของตัวกรองดิจิตอลแบบ FIR -0.1 0.2 เป็นตัวกรองที่มีโครงสร้างแบบ linear phase type II EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ตัวอย่างโจทย์ FIR 1 หาสัญญาณ ณ แต่ละ “node” -0.1 0.2 EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ตัวอย่างโจทย์ FIR 1 รวมสัญญาณ ที่ node -0.1 0.2 EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ตัวอย่างโจทย์ FIR 1 คูณสัญญาณ -0.1 0.2 EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ตัวอย่างโจทย์ FIR 1 ได้ เอาท์พุทเมื่ออินพุทเป็นอิมพัลส์ แปลงDTFT ซึ่งทำให้ได้ ผลตอบสนองความถี่ EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ตัวอย่างโจทย์ IIR 1 จาก ฟังก์ชันถ่ายโอนข้างล่าง จงสร้างตัวกรองดิจิตอลในแบบ direct form I และ direct form II หาผลคูณของเทอมส่วน EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ตัวอย่างโจทย์ IIR 1 Direct form I EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ตัวอย่างโจทย์ IIR 1 Direct form II EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ตัวอย่างโจทย์ IIR 2 จงหา ฟังก์ชันถ่ายโอน H(z) จาก โครงสร้าง direct form II ข้างล่างนี้ EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
ได้ฟังก์ชันถ่ายโอนเป็นได้ฟังก์ชันถ่ายโอนเป็น EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon
สรุป • ตัวกรองดิจิตอลมีสองแบบ คือ FIR และ IIR • เราสร้างตัวกรองดิจิตอลได้จากทั้งฟังก์ชันถ่ายโอน หรือจาก สมการความแตกต่าง • หรือ ในทางกลับกันเราสามารถหาฟังก์ชันถ่ายโอน และ ผลตอบสนองความถี่ จากตัวกรองดิจิตอลได้ EEET0485 Digital Signal Processing http://embedsigproc.wordpress.com Asst. Prof. Dr. P.Yuvapoositanon