Documente Academic
Documente Profesional
Documente Cultură
Solutions provided by
Ms Supriya Kadam
Others
Mumbai University/pvppcoe
13 Frequency Synthesizer 9
15 PLL as FM Demodulator 11
2
List of Experiments
3
Experiment: 2
4
Experiment: 6
5
Experiment: 7
6
17 for i =1: N
18 Q (: ,(( i -1) * length ( t ) ) +1: i * length ( t ) ) = cos (2* %pi * f ( i )
*t);
19 end
20 j =1;
21 for i =0: N : length ( Q ) -N
22 for n =1: N
23 R ( i + n ) = Q ( j +( n -1) * length ( t ) ) ;
24 S ( j +( n -1) * length ( t ) ) = R ( i + n ) ;
25 end
26 j = j +1;
27 end
28 t1 =0: T / fs : N * T ;
29 for i = length ( t1 ) +1: length ( Q )
30 t1 ( i ) = t1 ( length ( t1 ) ) ;
31 end
32 subplot ( N +2 ,1 ,1)
33 plot ( t1 , Q )
34 title ( S i g n a l s t o be M u l t i p l e x e d )
35 subplot ( N +2 ,1 ,2)
36 plot ( t1 , R )
37 title ( M u l t i p l e x e d S i g n a l )
38 for i =1: N
39 subplot ( N +2 , 1 , i +2)
40 plot (t , S (: ,(( i -1) * length ( t ) ) +1: i * length ( t ) ) )
41 title ( Dem u l t i p l e x e d S i g n a l )
42 end
7
Experiment: 9
Verification of Sampling
Theorem
1 //AIM : V e r i f i c a t i o n o f S a m p l i n g Theorem
2 // S o f t w a r e v e r s i o n S c i l a b 5 . 5 . 2
3 //OS windows 7
4 clc ;
5 clear ;
6 t =0:0.001:1;
7 f = input ( e n t e r t h e b a s e b a n d s i g n a l f r e q u e n c y ) ; // 0
t o 50
8 x = sin (2* %pi * f * t ) ;
9 subplot (2 ,1 ,1)
10 plot (t , x )
11 n = input ( e n t e r t h e s a m p l i n g t i m e ) ; // l e s s t h a n
0.5
12 i =0: n :1;
13 y = sin (2* %pi * f * i )
14 subplot (2 ,1 ,2)
15 plot2d3 (i , y )
8
Experiment: 13
Frequency Synthesizer
1 //AIM : F r e q u e n c y s y n t h e s i z e r
2 // S o f t w a r e v e r s i o n S c i l a b 5 . 5 . 2
3 //OS windows 7
4 clc ;
5 clear ;
6 fs = 10000;
7 t = 0:1/ fs :1.5;
8 f =50;
9 x1 = squarewave (2* %pi * f * t ) ;
10 subplot (3 ,1 ,1)
11 plot (t , x1 ) ;
12 xlabel ( Time ( s e c ) ) ;
13 ylabel ( A m p l i t u d e ) ;
14 title ( S q u a r e wave i n p u t w i t h f r e q =50HZ ) ;
15 t = 0:1/ fs :1.5;
16 x2 = squarewave (2* %pi *2* f * t ) ;
17 subplot (3 ,1 ,2)
18 plot (t , x2 ) ;
19 xlabel ( Time ( s e c ) ) ;
20 ylabel ( A m p l i t u d e ) ;
21 title ( f r e q u e n c y m u l t i p l i c a t i o n by a f a c t o r o f 2 ) ;
9
22 x3 = squarewave (2* %pi * f /2* t ) ;
23 subplot (3 ,1 ,3)
24 plot (t , x3 ) ;
25 xlabel ( Time ( s e c ) ) ;
26 ylabel ( A m p l i t u d e ) ;
27 title ( f r e q u e n c y d i v i s i o n by a f a c t o r o f 2 );
10
Experiment: 15
PLL as FM Demodulator
11
22 t = s1 * conj ( s2 ) ;
23 phi_error = atan ( imag ( t ) / real ( t ) ) /(2* %pi ) ;
24 phi_error_reg ( nn ) = phi_error ;
25 sum1 = Kp * phi_error + phi_error * Ki + reg3 ;
26 reg1_reg ( nn ) = reg1 ;
27 reg2_reg ( nn ) = reg2 ;
28 reg1 = phi1 ;
29 reg2 = reg2 + sum1 ;
30 reg3 = reg3 + phi_error * Ki ;
31 phi2_reg ( nn ) = reg2 ;
32 end
33 subplot (321) ;
34 plot ( phi1_reg ) ;
35 subplot (322) ;
36 plot ( phi2_reg , r ) ;
37 title ( p h a s e p l o t ) ;
38 xlabel ( S a m p l e s ) ;
39 ylabel ( Phase ) ;
40 subplot (323) ;
41 plot ( phi_error_reg ) ;
42 title ( p h a s e E r r o r o f p h a s e d e t e c t o r ) ;
43 xlabel ( s a m p l e s ( n ) ) ;
44 ylabel ( Phase e r r o r ( d e g r e e s ) ) ;
45 subplot (324) ;
46 plot ( real ( s1_reg ) ) ;
47 subplot (315) ;
48 plot ( real ( s2_reg ) , r ) ;
49 title ( I n p u t s i g n a l & Output s i g n a l o f VCO ) ;
50 xlabel ( S a m p l e s ) ;
51 ylabel ( A m p l i t u d e ) ;
12