10.07.2015 Views

Skrypt APSC - MARS

Skrypt APSC - MARS

Skrypt APSC - MARS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ROZDZIAŁ 6. FILTRY ANALOGOWE 104%−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−Ap = 3 ; % Apass [ dB ]As = 75; % Astop [ db ]Wp = 1 ; % Wpass [ rd/ s ]Ws = 10; % Wstop [ rd/ s ]% Wyznaczenie rzędu f i l t r u Butterwortha[N,W0] = buttord (Wp,Ws, Ap, As , ’ s ’ ) ;disp ( [ ’ Rząd = ’ num2str (N ) ] ) ;disp ( [ ’ Pulsacja graniczna = ’ num2str (W0) ’ rad /s ’ ] ) ;% Wyznaczenie t r a n s m i t a n c j i f i l t r u Butterwortha[ b , a ] = butter (N,W0, ’ s ’ ) ;p r i n t s y s (b , a , ’ s ’ )[ z , p , k]= tf 2zp (b , a ) ;f i g u r e (1)p l o t ( r e a l (p ) , imag (p ) , ’ xb ’ , ’ MarkerSize ’ , 1 0 ) ;g r i d ont i t l e ( ’ Położenie zer i biegunów ’ ) ;a x i s equal ;a x i s ([ −1.1 1.1 −1.1 1 . 1 ] ∗W0) ;p l o t c i r c l e (W0) ;x l a b e l ( ’ Re ’ ) ; y l a b e l ( ’ Im ’ )f i g u r e (2)w= ( 0 . 1 : 0 . 0 1 : 4 ) ;h = f r e q s (b , a ,w) ; % charakter ystyka c z ę s t o t l i w o ś c i o w amag = abs (h ) ;% amplitudaphase = angle ( h ) ;% f azasubplot ( 2 , 1 , 1 ) , semilogx (w, 20∗ log10 (mag ) )t i t l e ( ’ Charakterystyka amplitudowa ’ ) ;x l a b e l ( ’ Pulsacja [ rad / s ] ’ ) ; y l a b e l ( ’ Amplituda [ dB ] ’ )g r i d onsubplot ( 2 , 1 , 2 ) , semilogx (w, unwrap ( phase ) )t i t l e ( ’ Charakterystyka fazowa ’ ) ;x l a b e l ( ’ Pulsacja [ rad / s ] ’ ) ; y l a b e l ( ’ Faza [ rad ] ’ )g r i d onFunkcji butter należy podać następujące parametry: rząd filtru (N), pulsacjęgraniczną (ω 0 ) oraz ciąg znakowy ’s’ oznaczający, że interesuje nas filtranalogowy w dziedzinie zmiennej zespolonej s (domyślnie funkcja projektujefiltr cyfrowy). Funkcja butter potrafi zwrócić transmitancję w postaci wielomianowej,zero-biegunowej lub zmiennych stanu.Funkcja tf2zp służy do zmiany postaci wielomianowej transmitancji na zero-

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!