DSP 8 FIR Filter Design FIR CESd SP












































- Slides: 44
DSP 8 FIR Filter Design ���������� FIR ดร. พระพล ยวภษตานนท ภาควชา วศวกรรมอเลกทรอนกส CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -1
���� FIR • มความเสถยร (stable) • สามารถออกแบบใหผลตอบสนองทางเฟส เปนเชงเสน (Linear phase) ไดงาย CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -2
��������� (linear phase) ������ a=������� FIR ������������ CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -3
���������� • ����������� h(n) 0 1 2 N ������ 3 4 ������ 0 1 2 (symmetric) N ������ 3 4 5 N ������ 0 1 2 3 4 5 ���������� 0 N ������ 1 2 (Anti-symmetric) CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -4
Low pass filter (LPF ) High pass filter (HPF) Band pass filter (BPF) Band stop filter (BSF) CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -7
���������� LPF CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -8
���������� �� ����� d(n) ������� noncausal ����� (approximation) CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -9
��������� =����� (Cut-off frequency CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -10
ผลตอบสนองอมพลสของตวกรองตำ ผาน ทมการ เลอน M ลำดบ CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -11
��������� = n n ������� h(n) ����������� w(n) ���� N = ������ (order) ����� M=(N-1)/2 DSP 8 -13 CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon n
�������� = ��������� CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -14
���������� ----- �������� ������������� 1������� 2��������� CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -15
���������� (Filter specification) ������� �� ������� CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -16
���������� �� ������� (Main lobe) ������� (sidelobe) �������� CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -17
������ 7. 2 ������� As หนาตาง 8. 9% 21 สเหลย ม ฮานนง (H 0. 63% 44 anning) CESd. SP 0. 22% 53 แฮมมง (Hamming) แบลกแมน 0. 02% 74 (Blackman) EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon 1 DSP 8 -18
���� 1 (��� ) ���������� ����������� 7. 2 ������������ ������� 44. 44 ���� CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -21
���� 1 (��� ) CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -22
���������� CESd. SP 500 Hz EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon ex_7_1. eps DSP 8 -23
��������� h(n) ����� CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon ex_7_2. eps DSP 8 -24
�������� -21 d. B CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -25
������� -44 d. B CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -26
�������� -74 d. B CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -27
������ 2 ����������� 2 k ������������ CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -28
. 1�������� ������� ��� ����������� ������������ CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -29
. 2���������� ����� 7. 2 ���������� (8. 9%) ����������� ��������� (0. 22%) �������� (0. 02%) CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -30
�������� (0. 22%) ����������������� 7. 2 ������������������ ��������� 200 �� CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -31
�������� (0. 02%) ������ 7. 2 ���������� �������� 300 CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -32
%window. m demonstrating of the window design technique fc=500; fs=2000; N=41; M=(N-1)/2; wc=2*pi*fc/fs; n=0: N-1; %%%%%%% we can add a smallest number % 'eps' to avoid dividing by zero d=sin(wc*(n-M+eps)). /(n-M+eps)/pi; %%%% uncomment lines below for different windows w=ones(1, N); % Rectangular % w=. 5 -. 5*cos(2*pi*n. /(N-1)); %Hanning % w=. 42 -. 5*cos(2*pi*n. /(N-1))+. 08*cos(4*pi*n. /(N-1)); %blackman h=d. *w; figure(1); subplot(111); freqres(h, 1, fs, 'db') figure(2); subplot(111); stem(h) grid on xlabel('n') ylabel('h(n)') CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -33
����� FIR �������� (Frequency Sampling Techniques) ������������������ 7 ����������� 1 CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -34
������������ “FIR: Frequency Sampling” �� DSP 7: ������ h(n) ������������������� CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -35
���������� ��� ��������� ��� DSP 8 -36 CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon
����� N ����� 1 0123 CESd. SP 10 EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon 20 DSP 8 -37
���������� FIR �������� 2 k. Hz ������ (fs) 10 k. Hz ���������������� = �������� = CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -38
���������� 1 CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -39
���� 21 ��� ex_8_8. eps CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -40
���������� 61 ��� ����������� = �������� = CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -41
���� 61 ���������� 21 ��� ex_8_9. eps CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -42
%freq_sampl. m demonstrating low-pass design for FIR % fs=10000; % ������ 10 k. Hz wc= 0. 4*pi; % ��������� N=21; % ������������ Mp= ceil(wc*N/(2*pi)); %�. �. ���������� 0<w<pi Mpp=Mp-1; %�. �. ���������� pi<w<2 pi Ms= N-Mp-Mpp; %�. �. ���������� 0<w<pi H=[ones(1, Mp) zeros(1, Ms) ones(1, Mpp)]; %����� k=0: 1: N-1; % ��N ������� H=H. *exp(-j*pi*(N-1)*k/N); % ������� =���� *��� h=real(ifft(H)); %���������� figure(1) freqres(h, 1, fs) CESd. SP EEET 0485 Digital Signal Processing http: //embedsigproc. wordpress. com Asst. Prof. Dr. P. Yuvapoositanon DSP 8 -43