Vous êtes sur la page 1sur 9

8/7/13

5th sem DSP lab programs | Manish Chiniwalar

Manish Chiniwalar

College

How-tos

Reviews

Misc

Downloads

Portfolio

Contact Me

DSP Lab programs


29 Nov, 2010 College featured Lab M anish

Search

Subscribe in a reader

TWITTER UPDATES Error: Twitter did not respond. Please wait a few minutes and refresh this page.

Lowpass Filters
www.anatechelectronics.com For Military & Commercial Purposes. Many Custom Products. Order Now!

Here are the lab programs for DSP Lab(V sem Electronics and communication) Subject Code : 06ECL57 Awesome Resources: DSPGuide and DSPRelated

EXPERIMENTS USING MATLAB


1. Verification of Sampling theorem.
1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 c l c ; c l e a ra l l ; c l o s ea l l ; % P r o g r a mt ov e r i f yt h es a m p l i n gt h e o r e m % G e n e r a t e1 5 H zs i n u s o i d a ls i g n a lo f0 . 1 sd u r a t i o ns a m p l e da t1 0 0 0 H z t = 0 : 0 . 0 0 1 : 0 . 1 ; f m = 1 5 ; x = s i n ( 2 * p i * f m * t ) ; f i g u r e ( 1 ) p l o t ( t , x ) , x l a b e l ( ' T i m e ' ) , y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' O r i g i n a lA n a l o gs i g n a l ' ) ; % A n a l o gs i g n a ls a m p l e da tf s < < 2 f m f s = 1 0 ; n = 0 : 1 / f s : 0 . 1 ; x n = s i n ( 2 * p i * f m * n ) ; f i g u r e ( 2 ) s u b p l o t ( 2 , 1 , 1 ) ; s t e m ( n , x n ) ; x l a b e l ( ' T i m e ' ) , y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' U n d e r s a m p l e df s < < 2 f ms i g n a l ' ) ; s u b p l o t ( 2 , 1 , 2 ) ; p l o t ( n , x n ) ; x l a b e l ( ' T i m e ' ) , y l a b e l ( ' A m p l i t u d e ' ) ;
?

manishchiniwalar.com/college/dsp-lab-programs/

1/9

8/7/13
2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 4 0 4 1 4 2 4 3 4 4 4 5 4 6 2. 1 2 3 4 5 6 7 8 3.

5th sem DSP lab programs | Manish Chiniwalar


t i t l e ( ' R e c o n s t r u c t e du n d e r s a m p l e df s < < 2 f ms i g n a l ' ) ; % A n a l o gs i g n a ls a m p l e da tN y q u i s tr a t ef s = 2 f m f s = 3 0 ; n = 0 : 1 / f s : 0 . 1 ; x n = s i n ( 2 * p i * f m * n ) ; f i g u r e ( 3 ) s u b p l o t ( 2 , 1 , 1 ) ; s t e m ( n , x n ) ; x l a b e l ( ' T i m e ' ) , y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' S a m p l e da tN y q u i s tr a t ef s = 2 f ms i g n a l ' ' ) ; s u b p l o t ( 2 , 1 , 2 ) ; p l o t ( n , x n ) ; x l a b e l ( ' T i m e ' ) , y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' R e c o n s t r u c t e dN y q u i s tr a t ef s = 2 f ms i g n a l ' ) ; % A n a l o gs i g n a ls a m p l e da to v e r s a m p l i n gf s > > 2 f m f s = 5 0 0 ; n = 0 : 1 / f s : 0 . 1 ; x n = s i n ( 2 * p i * f m * n ) ; f i g u r e ( 4 ) s u b p l o t ( 2 , 1 , 1 ) ; s t e m ( n , x n ) ; x l a b e l ( ' T i m e ' ) , y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' O v e r s a m p l e df s > > 2 f ms i g n a l ' ) ; s u b p l o t ( 2 , 1 , 2 ) ; p l o t ( n , x n ) ; x l a b e l ( ' T i m e ' ) , y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' R e c o n s t r u c t e do v e r s a m p l e df s > > 2 f ms i g n a l ' ) ;

Impulse response of a given system c l c ; c l e a ra l l ; c l o s ea l l ; a = i n p u t ( ' E n t e rt h ef e e d b a c kc o e f f i c i e n t s : ' ) ; b = i n p u t ( ' E n t e rt h ef e e d f o r w a r dc o e f f i c i e n t s : ' ) ; h = i m p z ( b , a ) ; n = 0 : l e n g t h ( h ) 1 ; s t e m ( n , h ) ; g r i do n x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I m p u l s eR e s p o n s eh [ n ] ' ) ; Linear convolution of two given sequences. 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 c l c ; c l e a ra l l ; c l o s ea l l ; x = i n p u t ( ' E n t e rx [ n ] : ' ) ; n x = 0 : l e n g t h ( x ) 1 ; h = i n p u t ( ' E n t e rh [ n ] : ' ) ; n h = 0 : l e n g t h ( h ) 1 ; z = c o n v ( x , h ) ; n z = 0 : l e n g t h ( z ) 1 ; s u b p l o t ( 3 , 1 , 1 ) ; s t e m ( n x , x ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I n p u ts e q u e n c ex [ n ] ' ) ; s u b p l o t ( 3 , 1 , 2 ) ; s t e m ( n h , h ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I m p u l s er e s p o n s eo ft h es y s t e mh [ n ] ' ) ; s u b p l o t ( 3 , 1 , 3 ) ; s t e m ( n z , z ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' L i n e a rC o n v o l u t i o n ' ) ;
? ?

4.

Circular convolution of two given sequences 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 c l c ; c l e a ra l l ; c l o s ea l l ; x = i n p u t ( ' E n t e rx [ n ] : ' ) ; h = i n p u t ( ' E n t e rh [ n ] : ' ) ; x l = l e n g t h ( x ) ; h l = l e n g t h ( h ) ; m = m a x ( x l , h l ) ; z = i f f t ( f f t ( x , m ) . * f f t ( h , m ) ) ; z l = l e n g t h ( z ) ; % P l o t s n x = 0 : x l 1 ; n h = 0 : h l 1 ; n z = 0 : z l 1 ; s u b p l o t ( 3 , 1 , 1 ) ; s t e m ( n x , x ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I n p u ts e q u e n c ex [ n ] ' ) ; s u b p l o t ( 3 , 1 , 2 ) ; s t e m ( n h , h ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I m p u l s er e s p o n s eo ft h es y s t e mh [ n ] ' ) ; s u b p l o t ( 3 , 1 , 3 ) ; s t e m ( n z , z ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' C i r c u l a rC o n v o l u t i o n ' ) ;
?

5.

Autocorrelation of a given sequence and verification of its properties. 1 2 3 4 5 c l c ; c l e a ra l l ; c l o s ea l l ; x = i n p u t ( ' E n t e rx [ n ] : ' ) ; n = 0 : 1 : l e n g t h ( x ) 1 ; s u b p l o t ( 2 , 1 , 1 ) ; s t e m ( n , x ) ;


?

manishchiniwalar.com/college/dsp-lab-programs/

2/9

8/7/13
6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 4 0 4 1 4 2 4 3 4 4 6. x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I n p u ts e q u e n c ex [ n ]' ) ; R x x = x c o r r ( x ) ; n R x x = l e n g t h ( x ) + 1 : l e n g t h ( x ) 1 ; s u b p l o t ( 2 , 1 , 2 ) ; s t e m ( n R x x , R x x ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' A u t o c o r r e l a t i o no fx [ n ] ' ) ;

5th sem DSP lab programs | Manish Chiniwalar

% V e r i f i c a t i o no fp r o p e r t i e s c e n t e r _ i n d e x = c e i l ( l e n g t h ( R x x ) / 2 ) ; R x x _ 0 = R x x ( c e n t e r _ i n d e x ) ; E = s u m ( x . ^ 2 ) ; i fR x x _ 0 = = E d i s p ( ' E n e r g y( M e a ns q u a r ev a l u e )p r o p e r t yi sv e r i f i e d . ' ) ; e l s e d i s p ( ' E n e r g yp r o p e r t yi sn o tv e r i f i e d . ' ) ; e n d R x x _ r i g h t = R x x ( c e n t e r _ i n d e x : l e n g t h ( R x x ) ) ; R x x _ l e f t = R x x ( c e n t e r _ i n d e x : 1 : 1 ) ; i fR x x _ r i g h t = = R x x _ l e f t d i s p ( ' A u t o c o r r e l a t i o ni sa ne v e nf u n c t i o n .H e n c es y m m e t r yp r o p e r t yi sv e r i f i e d . ' ) ; e l s e d i s p ( ' A u t o c o r r e l a t i o ni sn o te v e n . ' ) ; e n d m = m a x ( R x x ) ; i fm = = R x x _ 0 d i s p ( ' M a x i m u mv a l u eo fa u t o c o r r e l a t i o nf u n c t i o ni sa tz e r o . ' ) ; e l s e d i s p ( ' M a x i m u mv a l u ei sn o ta tz e r o . ' ) ; e n d z = x . * 2 ; R z z = x c o r r ( z ) / 2 ; R m n = R x x + R x x ; i fR z z = = R m n d i s p ( ' L i n e a r i t yp r o p e r t yi sv e r i f i e d ' ) ; e l s e d i s p ( ' L i n e a r i t yp r o p e r t yi sn o tv e r i f i e d ' ) ; e n d

Cross correlation of given sequences and verification of its properties. 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 c l c ; c l e a ra l l ; c l o s ea l l ; x = i n p u t ( ' E n t e rt h ef i r s ts e q u e n c ex [ n ] : ' ) ; y = i n p u t ( ' E n t e rt h es e c o n ds e q u e n c ey [ n ] : ' ) ; n x = l e n g t h ( x ) ; n y = l e n g t h ( y ) ; n = m a x ( n x , n y ) ; R x y = x c o r r ( x , y ) ; s u b p l o t ( 3 , 1 , 1 ) ; n x l = 0 : 1 : n x 1 ; s t e m ( n x l , x ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I n p u ts e q u e n c ex [ n ] ' ) ; s u b p l o t ( 3 , 1 , 2 ) ; n y l = 0 : 1 : n y 1 ; s t e m ( n y l , y ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I n p u ts e q u e n c ey [ n ] ' ) ; s u b p l o t ( 3 , 1 , 3 ) ; l = n + 1 : n 1 ; s t e m ( l , R x y ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' C r o s sc o r r e l a t i o no fx [ n ]a n dy [ n ] ' ) ; % V e r i f i c a t i o no fp r o p e r t i e s z = f l i p l r ( R x y ) ; R y x = x c o r r ( y , x ) ; i fz = = R y x d i s p ( ' R x y ( k ) = R y x ( k )-V e r i f i e d . ' ) ; e n d a = R x y . * R x y ; R x x = x c o r r ( x ) ; R y y = x c o r r ( y ) ; c 1 = c e i l ( l e n g t h ( R x x ) / 2 ) ; c 2 = c e i l ( l e n g t h ( R y y ) / 2 ) ; R x x _ 0 = R x x ( c 1 ) ; R y y _ 0 = R y y ( c 2 ) ; i fa < = R x x _ 0 . * R y y _ 0 d i s p ( ' R x y ( k ) ^ 2 < = R x x ( 0 ) . R y y ( 0 )-V e r i f i e d . ' ) ; e n d
?

7.

Solving a given difference equation. 1 2 3 4 5 6 7 8 9 1 0 c l c ; c l e a ra l l ; c l o s ea l l ; a = i n p u t ( ' E n t e rt h ec o e f f i c i e n t so fy [ n ] : ' ) ; b = i n p u t ( ' E n t e rt h ec o e f f i c i e n t so fx [ n ] : ' ) ; x = i n p u t ( ' E n t e rt h ei n p u tv a l u e s : ' ) ; i c = i n p u t ( ' E n t e rt h ei n i t i a lc o n d i t i o n s : ' ) ; z i = f i l t i c ( b , a , i c ) ; y = f i l t e r ( b , a , x , z i ) ; n = 0 : l e n g t h ( y ) 1 ; s t e m ( n , y ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ;
?

manishchiniwalar.com/college/dsp-lab-programs/

3/9

8/7/13
1 1 8.

5th sem DSP lab programs | Manish Chiniwalar


t i t l e ( ' S o l u t i o no fd i f f e r e n c ee q u a t i o n :' ) ;

Computation of N point DFT of a given sequence and to plot magnitude and phase spectrum. 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 c l c ; c l e a ra l l ; c l o s ea l l ; x = i n p u t ( ' E n t e rx [ n ] : ' ) ; n x = 0 : l e n g t h ( x ) 1 ; N = 3 2 ; % C o m p u t eD F T n = 0 : l e n g t h ( x ) 1 ; f o rk = 0 : N 1 w = e x p ( j * 2 * p i * k * n / N ) ; d o t _ p r o d = x . * w ; X ( k + 1 ) = s u m ( d o t _ p r o d ) ; e n d % P l o tt h ei n p u t s u b p l o t ( 3 , 1 , 1 ) ; s t e m ( n x , x ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' I n p u tx [ n ] ' ) ; t i t l e ( ' I n p u ts e q u e n c ex [ n ] ' ) ; t i t l e ( ' C o m p u t a t i o no fD F T' ) ; % P l o tt h em a g n i t u d es p e c t r u m s u b p l o t ( 3 , 1 , 2 ) ; s t e m ( a b s ( X ) ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' M a g n i t u d eS p e c t r u m ' ) ; % P l o tt h ep h a s es p e c t r u m s u b p l o t ( 3 , 1 , 3 ) ; s t e m ( a n g l e ( X ) ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A n g l ei nr a d i a n ' ) ; t i t l e ( ' P h a s eS p e c t r u m ' ) ;
?

9.

Linear convolution of two sequences using DFT and IDFT. 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 c l c ; c l e a ra l l ; c l o s ea l l ; x = i n p u t ( ' E n t e rx [ n ] : ' ) ; h = i n p u t ( ' E n t e rh [ n ] : ' ) ; n x = l e n g t h ( x ) ; n h = l e n g t h ( h ) ; n = n x + n h 1 ; x n e w = [ xz e r o s ( 1 , n n x ) ] ; h n e w = [ hz e r o s ( 1 , n n h ) ] ; x f = f f t ( x n e w ) ; h f = f f t ( h n e w ) ; z f = x f . * h f ; z = i f f t ( z f ) ; l x = 0 : 1 : n x 1 ; l h = 0 : 1 : n h 1 ; n z = 0 : 1 : l e n g t h ( z ) 1 ; s u b p l o t ( 3 , 1 , 1 ) ; s t e m ( l x , x ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I n p u ts e q u e n c ex [ n ] ' ) ; s u b p l o t ( 3 , 1 , 2 ) ; s t e m ( l h , h ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I m p u l s eR e s p o n s eh [ n ] ' ) ; s u b p l o t ( 3 , 1 , 3 ) ; s t e m ( n z , z ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' L i n e a rC o n v o l u t i o n' ) ; % V e r i f i c a t i o n z 1 = c o n v ( x n e w , h n e w )
?

10. Circular convolution of two given sequences using DFT and IDFT 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 c l c ; c l e a ra l l ; c l o s ea l l ; x = i n p u t ( ' E n t e rx [ n ] : ' ) ; h = i n p u t ( ' E n t e rh [ n ] : ' ) ; n x = l e n g t h ( x ) ; n h = l e n g t h ( h ) ; n = m a x ( n x , n h ) ; x n e w = [ xz e r o s ( 1 , n n x ) ] ; h n e w = [ hz e r o s ( 1 , n n h ) ] ; x f = f f t ( x n e w ) ; h f = f f t ( h n e w ) ; z f = x f . * h f ; z = i f f t ( z f ) ; l x = 0 : 1 : n x 1 ; l h = 0 : 1 : n h 1 ; n z = 0 : 1 : l e n g t h ( z ) 1 ; s u b p l o t ( 3 , 1 , 1 ) ; s t e m ( l x , x ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I n p u ts e q u e n c ex [ n ]' ) ; s u b p l o t ( 3 , 1 , 2 ) ; s t e m ( l h , h ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ; t i t l e ( ' I m p u l s eR e s p o n s eh [ n ] ' ) ; s u b p l o t ( 3 , 1 , 3 ) ; s t e m ( n z , z ) ; x l a b e l ( ' T i m e ' ) ; y l a b e l ( ' A m p l i t u d e ' ) ;
?

manishchiniwalar.com/college/dsp-lab-programs/

4/9

8/7/13
2 7 t i t l e ( ' C i r c u l a rC o n v o l u t i o n ' ) ;

5th sem DSP lab programs | Manish Chiniwalar

11. Design and implementation of FIR filter to meet given specifications. 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 9 4 0 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 4 9 5 0 5 1 5 2 5 3 c l c ; c l o s ea l l ; c l e a ra l l ; r p = i n p u t ( ' E n t e rt h ep a s s b a n dr i p p l e : ' ) ; r s = i n p u t ( ' E n t e rt h es t o o p b a n dr i p p l e : ' ) ; f p = i n p u t ( ' E n t e rt h ep a s s b a n df r e q u e n c y : ' ) ; f s = i n p u t ( ' E n t e rt h es t o o p b a n df r e q u e n c y : ' ) ; f = i n p u t ( ' E n t e rt h es a m p l i n gf r e q u e n c y : ' ) ; w p = 2 * f p / f ; w s = 2 * f s / f ; n u m = 2 0 * l o g 1 0 ( s q r t ( r p * r s ) ) 1 3 ; d e n = 1 4 . 6 * ( f s f p ) / f ; n = c e i l ( n u m / d e n ) ; n 1 = n + 1 ; i f ( r e m ( n , 2 ) ~ = 0 ) n 1 = n ; n = n 1 ; e n d y = b o x c a r ( n 1 ) ; % >( 1 ) b = f i r 1 ( n , w p , ' l o w ' , y ) ; % >( 2 ) [ h , o ] = f r e q z ( b , 1 , 2 5 6 ) ; m = 2 0 * l o g 1 0 ( a b s ( h ) ) ; a n = a n g l e ( h ) ; s u b p l o t ( 2 , 1 , 1 ) ; p l o t ( o / p i , m ) ; t i t l e ( ' M a g n i t u d er e s p o n s e ' ) ; x l a b e l ( ' N o r m a l i s e df r e q u e n c y ' ) ; y l a b e l ( ' G a i ni nd B ' ) ; s u b p l o t ( 2 , 1 , 2 ) ; p l o t ( o / p i , a n ) ; t i t l e ( ' P h a s er e s p o n s e ' ) ; x l a b e l ( ' N o r m a l i s e df r e q u e n c y ' ) ; y l a b e l ( ' G a i ni nr a d ' ) ; % m a k er e l e v e n tc h a n g e si n( 1 )f o rd i f f .w i n d o w %b o x c a r > r e c t a n g u l a rw i n d o w %b a r t l e t t > b a r t l e t tw i n d o w %b l a c k m a n > b l a c k m a nw i n d o w %c h e b w i n > c h e b y s h e vw i n d o w %h a m m i n g > h a m m i n gw i n d o w %h a n n i n g > h a n n i n gw i n d o w % m a k er e l e v e n tc h a n g e si n( 2 )f o rd i f f .t y p e s % l o wp a s s > ( n , w p , ' l o w ' , y ) ; % h i g hp a s s > ( n , w p , ' h i g h ' , y ) ; % b a n dp a s s > ( n , [ w pw s ] , ' b a n d p a s s ' , y ) ; % b a n ds t o p > ( n , [ w pw s ] , ' s t o p ' , y ) ; %f o rk a i s a rw i n d o wm a k et h e s ec h a n g e s %b e t a = i n p u t ( ' E n t e rt h ev a l u eo fb e t a > a f t e rl i n e6 % y = k a i s e r ( n 1 , b e t a ) > i nl i n e1 7 %E g :( V a l u e sw o r kf o ra l lt y p e so fF I Rf i l t e r s ) %r p = 0 . 0 2 r s = 0 . 0 1 f p = 1 0 0 0 f s = 1 5 0 0 f = 1 0 0 0 0 b e t a = 5 . 8
?

12. Design and implementation of IIR filter to meet given specifications. 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 1 9 2 0 2 1 2 2 2 3 2 4 2 5 2 6 2 7 2 8 2 9 3 0 3 1 3 2 3 3 3 4 % b u t t e r w o r t hf i l t e r c l c ; c l o s ea l l ; c l e a ra l l ; f o r m a tl o n g ; r p = i n p u t ( ' E n t e rt h ep a s s b a n dr i p p l e : ' ) ; r s = i n p u t ( ' E n t e rt h es t o o p b a n dr i p p l e : ' ) ; f p = i n p u t ( ' E n t e rt h ep a s s b a n df r e q u e n c y : ' ) ; f s = i n p u t ( ' E n t e rt h es t o o p b a n df r e q u e n c y : ' ) ; f = i n p u t ( ' E n t e rt h es a m p l i n gf r e q u e n c y : ' ) ; w p = 2 * f p / f ; w s = 2 * f s / f ; [ n , w n ] = b u t t o r d ( w p , w s , r p , r s ) ; % > ( 1 ) [ b , a ] = b u t t e r ( n , w n , ' l o w ' ) ; % > ( 2 ) w = 0 : 0 . 0 1 : p i ; [ h , o ] = f r e q z ( b , a , w ) ; m = 2 0 * l o g 1 0 ( a b s ( h ) ) ; a n = a n g l e ( h ) ; s u b p l o t ( 2 , 1 , 1 ) ; p l o t ( o / p i , m ) ; t i t l e ( ' M a g n i t u d er e s p o n s e ' ) ; x l a b e l ( ' N o r m a l i s e df r e q u e n c y ' ) ; y l a b e l ( ' G a i ni nd B ' ) ; s u b p l o t ( 2 , 1 , 2 ) ; p l o t ( o / p i , a n ) ; t i t l e ( ' P h a s er e s p o n s e ' ) ; x l a b e l ( ' N o r m a l i s e df r e q u e n c y ' ) ; y l a b e l ( ' G a i ni nr a d ' ) ; % c h e b y s h e vt y p eIf i l t e r % ( 1 ) > [ n , w n ] = c h e b 1 o r d ( w p , w s , r p , r s ) ; % ( 2 ) > [ b , a ] = c h e b y 1 ( n , r p , w n , ' l o w ' ) ; % c h e b y s h e vt y p eI If i l t e r % ( 1 ) > [ n , w n ] = c h e b 2 o r d ( w p , w s , r p , r s ) ; % ( 2 ) > [ b , a ] = c h e b y 2 ( n , r s , w n , ' l o w ' ) ;
?

manishchiniwalar.com/college/dsp-lab-programs/

5/9

8/7/13
3 5 3 6 %r p = . 0 3 5 r s = 3 5 f p = 1 5 0 0 f s = 2 0 0 0

5th sem DSP lab programs | Manish Chiniwalar


f = 8 0 0 0

B. LIST OF EXPERIMENTS USING DSP PROCESSOR 1. 2. 3. 4. Linear convolution of two given sequences. Circular convolution of two given sequences. Computation of N- Point DFT of a given sequence Realization of an FIR filter (any type) to meet given specifications .The input can be a signal from function generator /

speech signal. 5. Audio applications such as to plot time and frequency (Spectrum) display of Microphone output plus a cosine using

DSP. Read a wav file and match with their respective spectrograms 6. 7. Noise: Add noise above 3kHz and then remove; Interference suppression using 400 Hz tone. Impulse response of first order and second order system

You may also like -

VLSI Lab Program s

HDL Lab Program s

How to disable java and not get hacked

Google Custom er Surveys - New w ay to Earn

DansGuardian DansGuardian
5th sem , DSP , Lab , matlab , programs

Tw eet

This Post Has 15 Comments

Hariraj
August 17, 2011 at 6:12 pm

Sir, If you could can you please show manual calculations : ) ty

manishchiniwalar
August 18, 2011 at 12:52 pm

calculations of?

Hariraj
August 20, 2011 at 9:29 am

Sir, for example when we go for labs, our lab in charge gives us a sum which we solve it and then we try to prove it via the programs that the calculations so obtained are true.

manishchiniwalar.com/college/dsp-lab-programs/

6/9

8/7/13

5th sem DSP lab programs | Manish Chiniwalar


manishchiniwalar
August 20, 2011 at 1:21 pm

Ok. I'll try and do that when i get some free time. I too need some revision Which college, by the way?

Hariraj
August 30, 2011 at 10:24 pm

i am from Dayanand Sagar bangalore

adi
August 27, 2011 at 4:54 pm

sir, if you have analog communication lab manual,pleace provide me..

manishchiniwalar
August 31, 2011 at 5:57 pm

Sorry buddy, i dont have it. i'll mail it to you when i get it And dont call me sir, i'm still 21

ectechheads
November 22, 2011 at 9:20 am

this programs are very lengthy,

Hariraj
December 2, 2011 at 3:53 am

Hey there, semester is almost over with only theory exams to go i would like to thank you for the programs you gave they were pretty awesome i kinda modified them (a lil) so as to dodge viva questions and yea programs are lengthy but pretty easy to learn step wise procedure i liked them anyways thanks a ton -Hariraj

manishchiniwalar
December 8, 2011 at 5:05 am

Thank you IF you are from EC under VTU, check the downloads section. There is a DSP evaluation scheme. Might help you understand what they expect. Keep visiting, many more stuff for your next semesters

vijay kumar.k
January 25, 2012 at 1:49 pm

manishchiniwalar.com/college/dsp-lab-programs/

7/9

8/7/13

5th sem DSP lab programs | Manish Chiniwalar


hello sir this is vijay kumar, am pursuing M.Tech in G.pulla reddy engg clg under VLSI branch. Can i some more HDL programs for Sequential circuits?

vijay kumar.k
January 25, 2012 at 1:51 pm

sorry Can i expect some more HDL programs for Sequential Circuits?

manishchiniwalar
January 26, 2012 at 3:02 pm

Im not so sure about that. Ive put up only the programs we had in our course. Ill surely send you if i find, though.

mehak
October 18, 2012 at 5:34 am

hey could you please provide a matlab program with a bio signal or a wave such as ECG ? Asap or rather signal compression using DCT

rajvignesh
December 11, 2012 at 5:15 pm

Excellently simple. Thanks.

Leave A Reply Username*

Email*

Website

Add Comment

Notify me of follow-up comments by email. Notify me of new posts by email.

manishchiniwalar.com/college/dsp-lab-programs/

8/9

8/7/13

5th sem DSP lab programs | Manish Chiniwalar


2013 Manish Chiniwalar // design by Premium WordPress Themes back up

manishchiniwalar.com/college/dsp-lab-programs/

9/9

Vous aimerez peut-être aussi