Académique Documents
Professionnel Documents
Culture Documents
Mossoró/RN
20 de abril de 2018
Jackson Angell Alves e Silva
Mossoró/RN
20 de abril de 2018
2
1 CÓDIGOS E PLOTAGEM
1.1 Código
1 clear all
2 clc
3
4 %Amostragem ;
5 tempo = − 0 . 0 1 : 0 . 0 0 0 1 : 0 . 0 1 ;
6
7 %R e s p o t a ao i m p u l s o ( c o n t . ) ;
8 figure (1)
9 subplot (3 ,1 ,1) ;
10
11 %E n t r a d a ;
12 x= c o s ( 1 0 0 0 ∗ p i ∗ tempo ) ;
13 y= p l o t ( tempo , x , ’ b ’ ) ;
14 t i t l e ( ’ Entrada x ( t ) ’ )
15 x l a b e l ( ’ Tempo ( s ) ’ ) ;
16 y l a b e l ( ’ Amplitude ’ ) ;
17 g r i d on
18
19 %R e s p o s t a a h ( t ) ;
20 subplot (3 ,1 ,2) ;
21 h = ( 2 4 5 7 . 7 ) . ∗ s i n ( 2 4 4 1 . 3 ∗ tempo ) . ∗ exp ( −200∗ tempo ) . ∗ h e a v i s i d e (
tempo ) ;
22 p= p l o t ( tempo , h , ’ b ’ ) ;
23
24 t i t l e ( ’ Resposta a h ( t ) ’ )
Capítulo 1. Códigos e plotagem 3
25 x l a b e l ( ’ Tempo ( s ) ’ ) ;
26 y l a b e l ( ’ Magnitude ’ ) ;
27 g r i d on
28
29 %S a i d a ;
30 subplot (3 ,1 ,3) ;
31 y = 1 . 4 7 4 . ∗ c o s ( 1 0 0 0 ∗ p i ∗ tempo − 2 . 8 2 8 ) ;
32 u= p l o t ( tempo , y , ’ b ’ ) ;
33 t i t l e ( ’y ( t ) ’ )
34 x l a b e l ( ’ Tempo ( s ) ’ ) ;
35 y l a b e l ( ’ Magnitude ’ ) ;
36 g r i d on
37
38 %Funcao de H(w) ;
39 figure (2)
40 f r e q u e n c i a = −4000:0.1:4000;
41 subplot (2 ,1 ,1) ;
42 wo=2∗ p i ∗ f r e q u e n c i a ;
43 H=6 e6 . / ( ( j ∗wo+2 00 ) . ^ 2 + 2 4 4 1 . 3 ^ 2 ) ;
44 subplot (2 ,1 ,1) ;
45 p l o t ( f r e q u e n c i a , a b s (H) , ’ b ’ ) ;
46 t i t l e ( ’ A m p l i t u d e de H(w) ’ ) ;
47 x l a b e l ( ’ F r e q u e n c i a ( Hz ) ’ ) ;
48 y l a b e l ( ’ | H(w) | ’ ) ;
49 g r i d on
50
51 %Funcao de | H(w) | ;
52 subplot (2 ,1 ,2) ;
53 p l o t ( f r e q u e n c i a , a n g l e (H) , ’ b ’ ) ;
54 t i t l e ( ’ F a s e H(w) ’ ) ;
55 x l a b e l ( ’ F r e q . ( Hz ) ’ ) ;
56 y l a b e l ( ’ F a s e | H(w) | ’ ) ;
57 g r i d on
Capítulo 1. Códigos e plotagem 4
1.2 Gráficos