logo资料库

Introduction to Digital Filters.pdf

第1页 / 共16页
第2页 / 共16页
第3页 / 共16页
第4页 / 共16页
第5页 / 共16页
第6页 / 共16页
第7页 / 共16页
第8页 / 共16页
资料共16页,剩余部分请下载后查看
2 6 1 C H A P T E R 1 4 I n t r o d u c t i o n t o D i g i t a l F i l t e r s D i g i t a l f i l t e r s a r e u s e d f o r t w o g e n e r a l p u r p o s e s : ( 1 ) s e p a r a t i o n o f s i g n a l s t h a t h a v e b e e n c o m b i n e d , a n d ( 2 ) r e s t o r a t i o n o f s i g n a l s t h a t h a v e b e e n d i s t o r t e d i n s o m e w a y . A n a l o g ( e l e c t r o n i c ) f i l t e r s c a n b e u s e d f o r t h e s e s a m e t a s k s ; h o w e v e r , d i g i t a l f i l t e r s c a n a c h i e v e f a r s u p e r i o r r e s u l t s . T h e m o s t p o p u l a r d i g i t a l f i l t e r s a r e d e s c r i b e d a n d c o m p a r e d i n t h e n e x t s e v e n c h a p t e r s . T h i s i n t r o d u c t o r y c h a p t e r d e s c r i b e s t h e p a r a m e t e r s y o u w a n t t o l o o k f o r w h e n l e a r n i n g a b o u t e a c h o f t h e s e f i l t e r s . F i l t e r B a s i c s D i g i t a l f i l t e r s a r e a v e r y i m p o r t a n t p a r t o f D S P . I n f a c t , t h e i r e x t r a o r d i n a r y p e r f o r m a n c e i s o n e o f t h e k e y r e a s o n s t h a t D S P h a s b e c o m e s o p o p u l a r . A s m e n t i o n e d i n t h e i n t r o d u c t i o n , f i l t e r s h a v e t w o u s e s : s i g n a l s e p a r a t i o n a n d s i g n a l r e s t o r a t i o n . S i g n a l s e p a r a t i o n i s n e e d e d w h e n a s i g n a l h a s b e e n c o n t a m i n a t e d w i t h i n t e r f e r e n c e , n o i s e , o r o t h e r s i g n a l s . F o r e x a m p l e , i m a g i n e a d e v i c e f o r m e a s u r i n g t h e e l e c t r i c a l a c t i v i t y o f a b a b y ' s h e a r t ( E K G ) w h i l e s t i l l i n t h e w o m b . T h e r a w s i g n a l w i l l l i k e l y b e c o r r u p t e d b y t h e b r e a t h i n g a n d h e a r t b e a t o f t h e m o t h e r . A f i l t e r m i g h t b e u s e d t o s e p a r a t e t h e s e s i g n a l s s o t h a t t h e y c a n b e i n d i v i d u a l l y a n a l y z e d . S i g n a l r e s t o r a t i o n i s u s e d w h e n a s i g n a l h a s b e e n d i s t o r t e d i n s o m e w a y . F o r e x a m p l e , a n a u d i o r e c o r d i n g m a d e w i t h p o o r e q u i p m e n t m a y b e f i l t e r e d t o b e t t e r r e p r e s e n t t h e s o u n d a s i t a c t u a l l y o c c u r r e d . A n o t h e r e x a m p l e i s t h e d e b l u r r i n g o f a n i m a g e a c q u i r e d w i t h a n i m p r o p e r l y f o c u s e d l e n s , o r a s h a k y c a m e r a . T h e s e p r o b l e m s c a n b e a t t a c k e d w i t h e i t h e r a n a l o g o r d i g i t a l f i l t e r s . W h i c h i s b e t t e r ? A n a l o g f i l t e r s a r e c h e a p , f a s t , a n d h a v e a l a r g e d y n a m i c r a n g e i n b o t h a m p l i t u d e a n d f r e q u e n c y . D i g i t a l f i l t e r s , i n c o m p a r i s o n , a r e v a s t l y s u p e r i o r i n t h e l e v e l o f p e r f o r m a n c e t h a t c a n b e a c h i e v e d . F o r e x a m p l e , a l o w - p a s s d i g i t a l f i l t e r p r e s e n t e d i n C h a p t e r 1 6 h a s a g a i n o f 1 + / - 0 . 0 0 0 2 f r o m D C t o 1 0 0 0 h e r t z , a n d a g a i n o f l e s s t h a n 0 . 0 0 0 2 f o r f r e q u e n c i e s a b o v e
T h e S c i e n t i s t a n d E n g i n e e r ' s G u i d e t o D i g i t a l S i g n a l P r o c e s s i n g 2 6 2 1 0 0 1 h e r t z . T h e e n t i r e t r a n s i t i o n o c c u r s w i t h i n o n l y 1 h e r t z . D o n ' t e x p e c t t h i s f r o m a n o p a m p c i r c u i t ! D i g i t a l f i l t e r s c a n a c h i e v e t h o u s a n d s o f t i m e s b e t t e r p e r f o r m a n c e t h a n a n a l o g f i l t e r s . T h i s m a k e s a d r a m a t i c d i f f e r e n c e i n h o w f i l t e r i n g p r o b l e m s a r e a p p r o a c h e d . W i t h a n a l o g f i l t e r s , t h e e m p h a s i s i s o n h a n d l i n g l i m i t a t i o n s o f t h e e l e c t r o n i c s , s u c h a s t h e a c c u r a c y a n d s t a b i l i t y o f t h e r e s i s t o r s a n d c a p a c i t o r s . I n c o m p a r i s o n , d i g i t a l f i l t e r s a r e s o g o o d t h a t t h e p e r f o r m a n c e o f t h e f i l t e r i s f r e q u e n t l y i g n o r e d . T h e e m p h a s i s s h i f t s t o t h e l i m i t a t i o n s o f t h e s i g n a l s , a n d t h e t h e o r e t i c a l i s s u e s r e g a r d i n g t h e i r p r o c e s s i n g . I t i s c o m m o n i n D S P t o s a y t h a t a f i l t e r ' s i n p u t a n d o u t p u t s i g n a l s a r e i n t h e t i m e d o m a i n . T h i s i s b e c a u s e s i g n a l s a r e u s u a l l y c r e a t e d b y s a m p l i n g a t r e g u l a r i n t e r v a l s o f t i m e . B u t t h i s i s n o t t h e o n l y w a y s a m p l i n g c a n t a k e p l a c e . T h e s e c o n d m o s t c o m m o n w a y o f s a m p l i n g i s a t e q u a l i n t e r v a l s i n s p a c e . F o r e x a m p l e , i m a g i n e t a k i n g s i m u l t a n e o u s r e a d i n g s f r o m a n a r r a y o f s t r a i n s e n s o r s m o u n t e d a t o n e c e n t i m e t e r i n c r e m e n t s a l o n g t h e l e n g t h o f a n a i r c r a f t w i n g . M a n y o t h e r d o m a i n s a r e p o s s i b l e ; h o w e v e r , t i m e a n d s p a c e a r e b y f a r t h e m o s t c o m m o n . W h e n y o u s e e t h e t e r m t i m e d o m a i n i n D S P , r e m e m b e r t h a t i t m a y a c t u a l l y r e f e r t o s a m p l e s t a k e n o v e r t i m e , o r i t m a y b e a g e n e r a l r e f e r e n c e t o a n y d o m a i n t h a t t h e s a m p l e s a r e t a k e n i n . A s s h o w n i n F i g . 1 4 - 1 , e v e r y l i n e a r f i l t e r h a s a n i m p u l s e r e s p o n s e , a s t e p r e s p o n s e a n d a f r e q u e n c y r e s p o n s e . E a c h o f t h e s e r e s p o n s e s c o n t a i n s c o m p l e t e i n f o r m a t i o n a b o u t t h e f i l t e r , b u t i n a d i f f e r e n t f o r m . I f o n e o f t h e t h r e e i s s p e c i f i e d , t h e o t h e r t w o a r e f i x e d a n d c a n b e d i r e c t l y c a l c u l a t e d . A l l t h r e e o f t h e s e r e p r e s e n t a t i o n s a r e i m p o r t a n t , b e c a u s e t h e y d e s c r i b e h o w t h e f i l t e r w i l l r e a c t u n d e r d i f f e r e n t c i r c u m s t a n c e s . T h e m o s t s t r a i g h t f o r w a r d w a y t o i m p l e m e n t a d i g i t a l f i l t e r i s b y c o n v o l v i n g t h e i n p u t s i g n a l w i t h t h e d i g i t a l f i l t e r ' s i m p u l s e r e s p o n s e . A l l p o s s i b l e l i n e a r f i l t e r s c a n b e m a d e i n t h i s m a n n e r . ( T h i s s h o u l d b e o b v i o u s . I f i t i s n ' t , y o u p r o b a b l y d o n ' t h a v e t h e b a c k g r o u n d t o u n d e r s t a n d t h i s s e c t i o n o n f i l t e r d e s i g n . T r y r e v i e w i n g t h e p r e v i o u s s e c t i o n o n D S P f u n d a m e n t a l s ) . W h e n t h e i m p u l s e r e s p o n s e i s u s e d i n t h i s w a y , f i l t e r d e s i g n e r s g i v e i t a s p e c i a l n a m e : t h e f i l t e r k e r n e l . T h e r e i s a l s o a n o t h e r w a y t o m a k e d i g i t a l f i l t e r s , c a l l e d r e c u r s i o n . W h e n a f i l t e r i s i m p l e m e n t e d b y c o n v o l u t i o n , e a c h s a m p l e i n t h e o u t p u t i s c a l c u l a t e d b y w e i g h t i n g t h e s a m p l e s i n t h e i n p u t , a n d a d d i n g t h e m t o g e t h e r . R e c u r s i v e f i l t e r s a r e a n e x t e n s i o n o f t h i s , u s i n g p r e v i o u s l y c a l c u l a t e d v a l u e s f r o m t h e o u t p u t , b e s i d e s p o i n t s f r o m t h e i n p u t . I n s t e a d o f u s i n g a f i l t e r k e r n e l , r e c u r s i v e f i l t e r s a r e d e f i n e d b y a s e t o f r e c u r s i o n c o e f f i c i e n t s . T h i s m e t h o d w i l l b e d i s c u s s e d i n d e t a i l i n C h a p t e r 1 9 . F o r n o w , t h e i m p o r t a n t p o i n t i s t h a t a l l l i n e a r f i l t e r s h a v e a n i m p u l s e r e s p o n s e , e v e n i f y o u d o n ' t u s e i t t o i m p l e m e n t t h e f i l t e r . T o f i n d t h e i m p u l s e r e s p o n s e o f a r e c u r s i v e f i l t e r , s i m p l y f e e d i n a n i m p u l s e , a n d s e e w h a t c o m e s o u t . T h e i m p u l s e r e s p o n s e s o f r e c u r s i v e f i l t e r s a r e c o m p o s e d o f s i n u s o i d s t h a t e x p o n e n t i a l l y d e c a y i n a m p l i t u d e . I n p r i n c i p l e , t h i s m a k e s t h e i r i m p u l s e r e s p o n s e s i n f i n i t e l y l o n g . H o w e v e r , t h e a m p l i t u d e e v e n t u a l l y d r o p s b e l o w t h e r o u n d - o f f n o i s e o f t h e s y s t e m , a n d t h e r e m a i n i n g s a m p l e s c a n b e i g n o r e d . B e c a u s e
a. Impulse response 32 64 Sample number 96 127 128 FFT 1.5 1.0 0.5 0.0 -0.5 0 c. Frequency response 0.1 0.2 0.3 Frequency 0.4 0.5 Integrate 20 Log( ) b. Step response d. Frequency response (in dB) 40 20 0 -20 -40 -60 32 64 Sample number 96 127 128 0 0.1 0.2 0.3 Frequency 0.4 0.5 0.2 0.1 0.0 -0.1 0 1.5 1.0 0.5 0.0 -0.5 0 C h a p t e r 1 4 - I n t r o d u c t i o n t o D i g i t a l F i l t e r s 2 6 3 0 . 3 F I G U R E 1 4 - 1 F i l t e r p a r a m e t e r s . E v e r y l i n e a r f i l t e r h a s a n i m p u l s e r e s p o n s e , a s t e p r e s p o n s e , a n d a f r e q u e n c y r e s p o n s e . T h e s t e p r e s p o n s e , ( b ) , c a n b e f o u n d b y d i s c r e t e i n t e g r a t i o n o f t h e i m p u l s e r e s p o n s e , ( a ) . T h e f r e q u e n c y r e s p o n s e c a n b e f o u n d f r o m t h e i m p u l s e r e s p o n s e b y u s i n g t h e F a s t F o u r i e r T r a n s f o r m ( F F T ) , a n d c a n b e d i s p l a y e d e i t h e r o n a l i n e a r s c a l e , ( c ) , o r i n d e c i b e l s , ( d ) . A m p l i t u d e A m p l i t u d e A m p l i t u d e ( d B ) A m p l i t u d e o f t h i s c h a r a c t e r i s t i c , r e c u r s i v e f i l t e r s a r e a l s o c a l l e d I n f i n i t e I m p u l s e R e s p o n s e o r I I R f i l t e r s . I n c o m p a r i s o n , f i l t e r s c a r r i e d o u t b y c o n v o l u t i o n a r e c a l l e d F i n i t e I m p u l s e R e s p o n s e o r F I R f i l t e r s . A s y o u k n o w , t h e i m p u l s e r e s p o n s e i s t h e o u t p u t o f a s y s t e m w h e n t h e i n p u t i s a n i m p u l s e . I n t h i s s a m e m a n n e r , t h e s t e p r e s p o n s e i s t h e o u t p u t w h e n t h e i n p u t i s a s t e p ( a l s o c a l l e d a n e d g e , a n d a n e d g e r e s p o n s e ) . S i n c e t h e s t e p i s t h e i n t e g r a l o f t h e i m p u l s e , t h e s t e p r e s p o n s e i s t h e i n t e g r a l o f t h e i m p u l s e r e s p o n s e . T h i s p r o v i d e s t w o w a y s t o f i n d t h e s t e p r e s p o n s e : ( 1 ) f e e d a s t e p w a v e f o r m i n t o t h e f i l t e r a n d s e e w h a t c o m e s o u t , o r ( 2 ) i n t e g r a t e t h e i m p u l s e r e s p o n s e . ( T o b e m a t h e m a t i c a l l y c o r r e c t : i n t e g r a t i o n i s u s e d w i t h c o n t i n u o u s s i g n a l s , w h i l e d i s c r e t e i n t e g r a t i o n , i . e . , a r u n n i n g s u m , i s u s e d w i t h d i s c r e t e s i g n a l s ) . T h e f r e q u e n c y r e s p o n s e c a n b e f o u n d b y t a k i n g t h e D F T ( u s i n g t h e F F T a l g o r i t h m ) o f t h e i m p u l s e r e s p o n s e . T h i s w i l l b e r e v i e w e d l a t e r i n t h i s
’ ’ ’ ’ ’ T h e S c i e n t i s t a n d E n g i n e e r ' s G u i d e t o D i g i t a l S i g n a l P r o c e s s i n g 2 6 4 d B 1 0 l o g 1 0 P 2 P 1 d B 2 0 l o g 1 0 A 2 A 1 E Q U A T I O N 1 4 - 1 D e f i n i t i o n o f d e c i b e l s . D e c i b e l s a r e a w a y o f e x p r e s s i n g a r a t i o b e t w e e n t w o s i g n a l s . R a t i o s o f p o w e r ( P 1 & P 2 ) u s e a d i f f e r e n t e q u a t i o n f r o m r a t i o s o f a m p l i t u d e ( A 1 & A 2 ) . c h a p t e r . T h e f r e q u e n c y r e s p o n s e c a n b e p l o t t e d o n a l i n e a r v e r t i c a l a x i s , s u c h a s i n ( c ) , o r o n a l o g a r i t h m i c s c a l e ( d e c i b e l s ) , a s s h o w n i n ( d ) . T h e l i n e a r s c a l e i s b e s t a t s h o w i n g t h e p a s s b a n d r i p p l e a n d r o l l - o f f , w h i l e t h e d e c i b e l s c a l e i s n e e d e d t o s h o w t h e s t o p b a n d a t t e n u a t i o n . D o n ' t r e m e m b e r d e c i b e l s ? H e r e i s a q u i c k r e v i e w . A b e l ( i n h o n o r o f A l e x a n d e r G r a h a m B e l l ) m e a n s t h a t t h e p o w e r i s c h a n g e d b y a f a c t o r o f t e n . F o r e x a m p l e , a n e l e c t r o n i c c i r c u i t t h a t h a s 3 b e l s o f a m p l i f i c a t i o n p r o d u c e s a n o u t p u t s i g n a l w i t h t i m e s t h e p o w e r o f t h e i n p u t . A d e c i b e l 1 0 × 1 0 × 1 0 1 0 0 0 ( d B ) i s o n e - t e n t h o f a b e l . T h e r e f o r e , t h e d e c i b e l v a l u e s o f : - 2 0 d B , - 1 0 d B , 0 d B , 1 0 d B & 2 0 d B , m e a n t h e p o w e r r a t i o s : 0 . 0 1 , 0 . 1 , 1 , 1 0 , & 1 0 0 , r e s p e c t i v e l y . I n o t h e r w o r d s , e v e r y t e n d e c i b e l s m e a n t h a t t h e p o w e r h a s c h a n g e d b y a f a c t o r o f t e n . H e r e ' s t h e c a t c h : y o u u s u a l l y w a n t t o w o r k w i t h a s i g n a l ' s a m p l i t u d e , n o t i t s p o w e r . F o r e x a m p l e , i m a g i n e a n a m p l i f i e r w i t h 2 0 d B o f g a i n . B y d e f i n i t i o n , t h i s m e a n s t h a t t h e p o w e r i n t h e s i g n a l h a s i n c r e a s e d b y a f a c t o r o f 1 0 0 . S i n c e a m p l i t u d e i s p r o p o r t i o n a l t o t h e s q u a r e - r o o t o f p o w e r , t h e a m p l i t u d e o f t h e o u t p u t i s 1 0 t i m e s t h e a m p l i t u d e o f t h e i n p u t . W h i l e 2 0 d B m e a n s a f a c t o r o f 1 0 0 i n p o w e r , i t o n l y m e a n s a f a c t o r o f 1 0 i n a m p l i t u d e . E v e r y t w e n t y d e c i b e l s m e a n t h a t t h e a m p l i t u d e h a s c h a n g e d b y a f a c t o r o f t e n . I n e q u a t i o n f o r m : T h e a b o v e e q u a t i o n s u s e t h e b a s e 1 0 l o g a r i t h m ; h o w e v e r , m a n y c o m p u t e r l a n g u a g e s o n l y p r o v i d e a f u n c t i o n f o r t h e b a s e e l o g a r i t h m ( t h e n a t u r a l l o g , w r i t t e n o r ) . T h e n a t u r a l l o g c a n b e u s e b y m o d i f y i n g t h e a b o v e l o g e x l n x e q u a t i o n s : a n d . d B 4 . 3 4 2 9 4 5 l o g e ( P 2 / P 1 ) d B 8 . 6 8 5 8 9 0 l o g e ( A 2 / A 1 ) S i n c e d e c i b e l s a r e a w a y o f e x p r e s s i n g t h e r a t i o b e t w e e n t w o s i g n a l s , t h e y a r e i d e a l f o r d e s c r i b i n g t h e g a i n o f a s y s t e m , i . e . , t h e r a t i o b e t w e e n t h e o u t p u t a n d t h e i n p u t s i g n a l . H o w e v e r , e n g i n e e r s a l s o u s e d e c i b e l s t o s p e c i f y t h e a m p l i t u d e ( o r p o w e r ) o f a s i n g l e s i g n a l , b y r e f e r e n c i n g i t t o s o m e s t a n d a r d . F o r e x a m p l e , t h e t e r m : d B V m e a n s t h a t t h e s i g n a l i s b e i n g r e f e r e n c e d t o a 1 v o l t r m s s i g n a l . L i k e w i s e , d B m i n d i c a t e s a r e f e r e n c e s i g n a l p r o d u c i n g 1 m W i n t o a 6 0 0 o h m s l o a d ( a b o u t 0 . 7 8 v o l t s r m s ) . I f y o u u n d e r s t a n d n o t h i n g e l s e a b o u t d e c i b e l s , r e m e m b e r t w o t h i n g s : F i r s t , - 3 d B m e a n s t h a t t h e a m p l i t u d e i s r e d u c e d t o 0 . 7 0 7 ( a n d t h e p o w e r i s
C h a p t e r 1 4 - I n t r o d u c t i o n t o D i g i t a l F i l t e r s 2 6 5 6 0 d B = 1 0 0 0 4 0 d B = 1 0 0 2 0 d B = 1 0 0 d B = 1 - 2 0 d B = 0 . 1 - 4 0 d B = 0 . 0 1 - 6 0 d B = 0 . 0 0 1 t h e r e f o r e r e d u c e d t o 0 . 5 ) . S e c o n d , m e m o r i z e t h e f o l l o w i n g c o n v e r s i o n s b e t w e e n d e c i b e l s a n d a m p l i t u d e r a t i o s : H o w I n f o r m a t i o n i s R e p r e s e n t e d i n S i g n a l s T h e m o s t i m p o r t a n t p a r t o f a n y D S P t a s k i s u n d e r s t a n d i n g h o w i n f o r m a t i o n i s c o n t a i n e d i n t h e s i g n a l s y o u a r e w o r k i n g w i t h . T h e r e a r e m a n y w a y s t h a t i n f o r m a t i o n c a n b e c o n t a i n e d i n a s i g n a l . T h i s i s e s p e c i a l l y t r u e i f t h e s i g n a l i s m a n m a d e . F o r i n s t a n c e , c o n s i d e r a l l o f t h e m o d u l a t i o n s c h e m e s t h a t h a v e b e e n d e v i s e d : A M , F M , s i n g l e - s i d e b a n d , p u l s e - c o d e m o d u l a t i o n , p u l s e - w i d t h m o d u l a t i o n , e t c . T h e l i s t g o e s o n a n d o n . F o r t u n a t e l y , t h e r e a r e o n l y t w o w a y s t h a t a r e c o m m o n f o r i n f o r m a t i o n t o b e r e p r e s e n t e d i n n a t u r a l l y o c c u r r i n g s i g n a l s . W e w i l l c a l l t h e s e : i n f o r m a t i o n r e p r e s e n t e d i n t h e t i m e d o m a i n , a n d i n f o r m a t i o n r e p r e s e n t e d i n t h e f r e q u e n c y d o m a i n . I n f o r m a t i o n r e p r e s e n t e d i n t h e t i m e d o m a i n d e s c r i b e s w h e n s o m e t h i n g o c c u r s a n d w h a t t h e a m p l i t u d e o f t h e o c c u r r e n c e i s . F o r e x a m p l e , i m a g i n e a n e x p e r i m e n t t o s t u d y t h e l i g h t o u t p u t f r o m t h e s u n . T h e l i g h t o u t p u t i s m e a s u r e d a n d r e c o r d e d o n c e e a c h s e c o n d . E a c h s a m p l e i n t h e s i g n a l i n d i c a t e s w h a t i s h a p p e n i n g a t t h a t i n s t a n t , a n d t h e l e v e l o f t h e e v e n t . I f a s o l a r f l a r e o c c u r s , t h e s i g n a l d i r e c t l y p r o v i d e s i n f o r m a t i o n o n t h e t i m e i t o c c u r r e d , t h e d u r a t i o n , t h e d e v e l o p m e n t o v e r t i m e , e t c . E a c h s a m p l e c o n t a i n s i n f o r m a t i o n t h a t i s i n t e r p r e t a b l e w i t h o u t r e f e r e n c e t o a n y o t h e r s a m p l e . E v e n i f y o u h a v e o n l y o n e s a m p l e f r o m t h i s s i g n a l , y o u s t i l l k n o w s o m e t h i n g a b o u t w h a t y o u a r e m e a s u r i n g . T h i s i s t h e s i m p l e s t w a y f o r i n f o r m a t i o n t o b e c o n t a i n e d i n a s i g n a l . I n c o n t r a s t , i n f o r m a t i o n r e p r e s e n t e d i n t h e f r e q u e n c y d o m a i n i s m o r e i n d i r e c t . M a n y t h i n g s i n o u r u n i v e r s e s h o w p e r i o d i c m o t i o n . F o r e x a m p l e , a w i n e g l a s s s t r u c k w i t h a f i n g e r n a i l w i l l v i b r a t e , p r o d u c i n g a r i n g i n g s o u n d ; t h e p e n d u l u m o f a g r a n d f a t h e r c l o c k s w i n g s b a c k a n d f o r t h ; s t a r s a n d p l a n e t s r o t a t e o n t h e i r a x i s a n d r e v o l v e a r o u n d e a c h o t h e r , a n d s o f o r t h . B y m e a s u r i n g t h e f r e q u e n c y , p h a s e , a n d a m p l i t u d e o f t h i s p e r i o d i c m o t i o n , i n f o r m a t i o n c a n o f t e n b e o b t a i n e d a b o u t t h e s y s t e m p r o d u c i n g t h e m o t i o n . S u p p o s e w e s a m p l e t h e s o u n d p r o d u c e d b y t h e r i n g i n g w i n e g l a s s . T h e f u n d a m e n t a l f r e q u e n c y a n d h a r m o n i c s o f t h e p e r i o d i c v i b r a t i o n r e l a t e t o t h e m a s s a n d e l a s t i c i t y o f t h e m a t e r i a l . A s i n g l e s a m p l e , i n i t s e l f , c o n t a i n s n o i n f o r m a t i o n a b o u t t h e p e r i o d i c m o t i o n , a n d t h e r e f o r e n o i n f o r m a t i o n a b o u t t h e w i n e g l a s s . T h e i n f o r m a t i o n i s c o n t a i n e d i n t h e r e l a t i o n s h i p b e t w e e n m a n y p o i n t s i n t h e s i g n a l .
T h e S c i e n t i s t a n d E n g i n e e r ' s G u i d e t o D i g i t a l S i g n a l P r o c e s s i n g 2 6 6 T h i s b r i n g s u s t o t h e i m p o r t a n c e o f t h e s t e p a n d f r e q u e n c y r e s p o n s e s . T h e s t e p r e s p o n s e d e s c r i b e s h o w i n f o r m a t i o n r e p r e s e n t e d i n t h e t i m e d o m a i n i s b e i n g m o d i f i e d b y t h e s y s t e m . I n c o n t r a s t , t h e f r e q u e n c y r e s p o n s e s h o w s h o w i n f o r m a t i o n r e p r e s e n t e d i n t h e f r e q u e n c y d o m a i n i s b e i n g c h a n g e d . T h i s d i s t i n c t i o n i s a b s o l u t e l y c r i t i c a l i n f i l t e r d e s i g n b e c a u s e i t i s n o t p o s s i b l e t o o p t i m i z e a f i l t e r f o r b o t h a p p l i c a t i o n s . G o o d p e r f o r m a n c e i n t h e t i m e d o m a i n r e s u l t s i n p o o r p e r f o r m a n c e i n t h e f r e q u e n c y d o m a i n , a n d v i c e v e r s a . I f y o u a r e d e s i g n i n g a f i l t e r t o r e m o v e n o i s e f r o m a n E K G s i g n a l ( i n f o r m a t i o n r e p r e s e n t e d i n t h e t i m e d o m a i n ) , t h e s t e p r e s p o n s e i s t h e i m p o r t a n t p a r a m e t e r , a n d t h e f r e q u e n c y r e s p o n s e i s o f l i t t l e c o n c e r n . I f y o u r t a s k i s t o d e s i g n a d i g i t a l f i l t e r f o r a h e a r i n g a i d ( w i t h t h e i n f o r m a t i o n i n t h e f r e q u e n c y d o m a i n ) , t h e f r e q u e n c y r e s p o n s e i s a l l i m p o r t a n t , w h i l e t h e s t e p r e s p o n s e d o e s n ' t m a t t e r . N o w l e t ' s l o o k a t w h a t m a k e s a f i l t e r o p t i m a l f o r t i m e d o m a i n o r f r e q u e n c y d o m a i n a p p l i c a t i o n s . T i m e D o m a i n P a r a m e t e r s I t m a y n o t b e o b v i o u s w h y t h e s t e p r e s p o n s e i s o f s u c h c o n c e r n i n t i m e d o m a i n f i l t e r s . Y o u m a y b e w o n d e r i n g w h y t h e i m p u l s e r e s p o n s e i s n ' t t h e i m p o r t a n t p a r a m e t e r . T h e a n s w e r l i e s i n t h e w a y t h a t t h e h u m a n m i n d u n d e r s t a n d s a n d p r o c e s s e s i n f o r m a t i o n . R e m e m b e r t h a t t h e s t e p , i m p u l s e a n d f r e q u e n c y r e s p o n s e s a l l c o n t a i n i d e n t i c a l i n f o r m a t i o n , j u s t i n d i f f e r e n t a r r a n g e m e n t s . T h e s t e p r e s p o n s e i s u s e f u l i n t i m e d o m a i n a n a l y s i s b e c a u s e i t m a t c h e s t h e w a y h u m a n s v i e w t h e i n f o r m a t i o n c o n t a i n e d i n t h e s i g n a l s . F o r e x a m p l e , s u p p o s e y o u a r e g i v e n a s i g n a l o f s o m e u n k n o w n o r i g i n a n d a s k e d t o a n a l y z e i t . T h e f i r s t t h i n g y o u w i l l d o i s d i v i d e t h e s i g n a l i n t o r e g i o n s o f s i m i l a r c h a r a c t e r i s t i c s . Y o u c a n ' t s t o p f r o m d o i n g t h i s ; y o u r m i n d w i l l d o i t a u t o m a t i c a l l y . S o m e o f t h e r e g i o n s m a y b e s m o o t h ; o t h e r s m a y h a v e l a r g e a m p l i t u d e p e a k s ; o t h e r s m a y b e n o i s y . T h i s s e g m e n t a t i o n i s a c c o m p l i s h e d b y i d e n t i f y i n g t h e p o i n t s t h a t s e p a r a t e t h e r e g i o n s . T h i s i s w h e r e t h e s t e p f u n c t i o n c o m e s i n . T h e s t e p f u n c t i o n i s t h e p u r e s t w a y o f r e p r e s e n t i n g a d i v i s i o n b e t w e e n t w o d i s s i m i l a r r e g i o n s . I t c a n m a r k w h e n a n e v e n t s t a r t s , o r w h e n a n e v e n t e n d s . I t t e l l s y o u t h a t w h a t e v e r i s o n t h e l e f t i s s o m e h o w d i f f e r e n t f r o m w h a t e v e r i s o n t h e r i g h t . T h i s i s h o w t h e h u m a n m i n d v i e w s t i m e d o m a i n i n f o r m a t i o n : a g r o u p o f s t e p f u n c t i o n s d i v i d i n g t h e i n f o r m a t i o n i n t o r e g i o n s o f s i m i l a r c h a r a c t e r i s t i c s . T h e s t e p r e s p o n s e , i n t u r n , i s i m p o r t a n t b e c a u s e i t d e s c r i b e s h o w t h e d i v i d i n g l i n e s a r e b e i n g m o d i f i e d b y t h e f i l t e r . T h e s t e p r e s p o n s e p a r a m e t e r s t h a t a r e i m p o r t a n t i n f i l t e r d e s i g n a r e s h o w n i n F i g . 1 4 - 2 . T o d i s t i n g u i s h e v e n t s i n a s i g n a l , t h e d u r a t i o n o f t h e s t e p r e s p o n s e m u s t b e s h o r t e r t h a n t h e s p a c i n g o f t h e e v e n t s . T h i s d i c t a t e s t h a t t h e s t e p r e s p o n s e s h o u l d b e a s f a s t ( t h e D S P j a r g o n ) a s p o s s i b l e . T h i s i s s h o w n i n F i g s . ( a ) & ( b ) . T h e m o s t c o m m o n w a y t o s p e c i f y t h e r i s e t i m e ( m o r e j a r g o n ) i s t o q u o t e t h e n u m b e r o f s a m p l e s b e t w e e n t h e 1 0 % a n d 9 0 % a m p l i t u d e l e v e l s . W h y i s n ' t a v e r y f a s t r i s e t i m e a l w a y s p o s s i b l e ? T h e r e a r e m a n y r e a s o n s , n o i s e r e d u c t i o n , i n h e r e n t l i m i t a t i o n s o f t h e d a t a a c q u i s i t i o n s y s t e m , a v o i d i n g a l i a s i n g , e t c .
1.5 1.0 0.5 0.0 -0.5 0 1.5 1.0 0.5 0.0 -0.5 0 1.5 1.0 0.5 0.0 -0.5 0 a. Slow step response 16 32 Sample number 48 64 c. Overshoot 16 32 Sample number 48 64 e. Nonlinear phase 16 32 Sample number 48 64 1.5 1.0 0.5 0.0 -0.5 0 1.5 1.0 0.5 0.0 -0.5 0 1.5 1.0 0.5 0.0 -0.5 0 b. Fast step response 16 32 Sample number 48 64 d. No overshoot 16 32 Sample number 48 64 f. Linear phase 16 32 Sample number 48 64 C h a p t e r 1 4 - I n t r o d u c t i o n t o D i g i t a l F i l t e r s 2 6 7 F I G U R E 1 4 - 2 P a r a m e t e r s f o r e v a l u a t i n g t i m e d o m a i n p e r f o r m a n c e . T h e s t e p r e s p o n s e i s u s e d t o m e a s u r e h o w w e l l a f i l t e r p e r f o r m s i n t h e t i m e d o m a i n . T h r e e p a r a m e t e r s a r e i m p o r t a n t : ( 1 ) t r a n s i t i o n s p e e d ( r i s e t i m e ) , s h o w n i n ( a ) a n d ( b ) , ( 2 ) o v e r s h o o t , s h o w n i n ( c ) a n d ( d ) , a n d ( 3 ) p h a s e l i n e a r i t y ( s y m m e t r y b e t w e e n t h e t o p a n d b o t t o m h a l v e s o f t h e s t e p ) , s h o w n i n ( e ) a n d ( f ) . P O O R G O O D A m p l i t u d e A m p l i t u d e A m p l i t u d e A m p l i t u d e A m p l i t u d e A m p l i t u d e F i g u r e s ( c ) a n d ( d ) s h o w s t h e n e x t p a r a m e t e r t h a t i s i m p o r t a n t : o v e r s h o o t i n t h e s t e p r e s p o n s e . O v e r s h o o t m u s t g e n e r a l l y b e e l i m i n a t e d b e c a u s e i t c h a n g e s t h e a m p l i t u d e o f s a m p l e s i n t h e s i g n a l ; t h i s i s a b a s i c d i s t o r t i o n o f t h e i n f o r m a t i o n c o n t a i n e d i n t h e t i m e d o m a i n . T h i s c a n b e s u m m e d u p i n
passband a. Low-pass transition band stopband Frequency b. High-pass e d u t i l p m A e d u t i l p m A c. Band-pass Frequency d. Band-reject e d u t i l p m A e d u t i l p m A Frequency Frequency T h e S c i e n t i s t a n d E n g i n e e r ' s G u i d e t o D i g i t a l S i g n a l P r o c e s s i n g 2 6 8 F I G U R E 1 4 - 3 T h e f o u r c o m m o n f r e q u e n c y r e s p o n s e s . F r e q u e n c y d o m a i n f i l t e r s a r e g e n e r a l l y u s e d t o p a s s c e r t a i n f r e q u e n c i e s ( t h e p a s s b a n d ) , w h i l e b l o c k i n g o t h e r s ( t h e s t o p b a n d ) . F o u r r e s p o n s e s a r e t h e m o s t c o m m o n : l o w - p a s s , h i g h - p a s s , b a n d - p a s s , a n d b a n d - r e j e c t . o n e q u e s t i o n : I s t h e o v e r s h o o t y o u o b s e r v e i n a s i g n a l c o m i n g f r o m t h e t h i n g y o u a r e t r y i n g t o m e a s u r e , o r f r o m t h e f i l t e r y o u h a v e u s e d ? F i n a l l y , i t i s o f t e n d e s i r e d t h a t t h e u p p e r h a l f o f t h e s t e p r e s p o n s e b e s y m m e t r i c a l w i t h t h e l o w e r h a l f , a s i l l u s t r a t e d i n ( e ) a n d ( f ) . T h i s s y m m e t r y i s n e e d e d t o m a k e t h e r i s i n g e d g e s l o o k t h e s a m e a s t h e f a l l i n g e d g e s . T h i s s y m m e t r y i s c a l l e d l i n e a r p h a s e , b e c a u s e t h e f r e q u e n c y r e s p o n s e h a s a p h a s e t h a t i s a s t r a i g h t l i n e ( d i s c u s s e d i n C h a p t e r 1 9 ) . M a k e s u r e y o u u n d e r s t a n d t h e s e t h r e e p a r a m e t e r s ; t h e y a r e t h e k e y t o e v a l u a t i n g t i m e d o m a i n f i l t e r s . F r e q u e n c y D o m a i n P a r a m e t e r s F i g u r e 1 4 - 3 s h o w s t h e f o u r b a s i c f r e q u e n c y r e s p o n s e s . T h e p u r p o s e o f t h e s e f i l t e r s i s t o a l l o w s o m e f r e q u e n c i e s t o p a s s u n a l t e r e d , w h i l e c o m p l e t e l y b l o c k i n g o t h e r f r e q u e n c i e s . T h e p a s s b a n d r e f e r s t o t h o s e f r e q u e n c i e s t h a t a r e p a s s e d , w h i l e t h e s t o p b a n d c o n t a i n s t h o s e f r e q u e n c i e s t h a t a r e b l o c k e d . T h e t r a n s i t i o n b a n d i s b e t w e e n . A f a s t r o l l - o f f m e a n s t h a t t h e t r a n s i t i o n b a n d i s v e r y n a r r o w . T h e d i v i s i o n b e t w e e n t h e p a s s b a n d a n d t r a n s i t i o n b a n d i s c a l l e d t h e c u t o f f f r e q u e n c y . I n a n a l o g f i l t e r d e s i g n , t h e c u t o f f f r e q u e n c y i s u s u a l l y d e f i n e d t o b e w h e r e t h e a m p l i t u d e i s r e d u c e d t o 0 . 7 0 7 ( i . e . , - 3 d B ) . D i g i t a l f i l t e r s a r e l e s s s t a n d a r d i z e d , a n d i t i s c o m m o n t o s e e 9 9 % , 9 0 % , 7 0 . 7 % , a n d 5 0 % a m p l i t u d e l e v e l s d e f i n e d t o b e t h e c u t o f f f r e q u e n c y . F i g u r e 1 4 - 4 s h o w s t h r e e p a r a m e t e r s t h a t m e a s u r e h o w w e l l a f i l t e r p e r f o r m s i n t h e f r e q u e n c y d o m a i n . T o s e p a r a t e c l o s e l y s p a c e d f r e q u e n c i e s , t h e f i l t e r m u s t h a v e a f a s t r o l l - o f f , a s i l l u s t r a t e d i n ( a ) a n d ( b ) . F o r t h e p a s s b a n d f r e q u e n c i e s t o m o v e t h r o u g h t h e f i l t e r u n a l t e r e d , t h e r e m u s t b e n o p a s s b a n d r i p p l e , a s s h o w n i n ( c ) a n d ( d ) . L a s t l y , t o a d e q u a t e l y b l o c k t h e s t o p b a n d f r e q u e n c i e s , i t i s n e c e s s a r y t o h a v e g o o d s t o p b a n d a t t e n u a t i o n , d i s p l a y e d i n ( e ) a n d ( f ) .
分享到:
收藏