You are on page 1of 16

%Calcoliamo i poli per un filtro di Butterworth

>> %N = 22 è l'ordine del filtro

>>

>> N = [1:44]

N=

Columns 1 through 8

1 2 3 4 5 6 7 8

Columns 9 through 16

9 10 11 12 13 14 15 16

Columns 17 through 24

17 18 19 20 21 22 23 24

Columns 25 through 32

25 26 27 28 29 30 31 32

Columns 33 through 40

33 34 35 36 37 38 39 40

Columns 41 through 44

41 42 43 44
>> %I poli del filtro stanno tutti su un cerchio di raggio R
>> R = 1/(1.2)^(1/22)

R=

0.9917

>> %R è il raggio del cerchio

>> k = [1, N-1]

k=

Columns 1 through 7

1 0 1 2 3 4 5

Columns 8 through 14

6 7 8 9 10 11 12

Columns 15 through 21

13 14 15 16 17 18 19

Columns 22 through 28

20 21 22 23 24 25 26

Columns 29 through 35

27 28 29 30 31 32 33
Columns 36 through 42

34 35 36 37 38 39 40

Columns 43 through 45

41 42 43

>> %Calcoliamo ph
>> ph = exp(i*((2*N+21)*pi)/44)

ph =

Columns 1 through 2

-0.0713 + 0.9975i -0.2126 + 0.9771i

Columns 3 through 4

-0.3495 + 0.9369i -0.4792 + 0.8777i

Columns 5 through 6

-0.5993 + 0.8005i -0.7071 + 0.7071i

Columns 7 through 8

-0.8005 + 0.5993i -0.8777 + 0.4792i


Columns 9 through 10

-0.9369 + 0.3495i -0.9771 + 0.2126i

Columns 11 through 12

-0.9975 + 0.0713i -0.9975 - 0.0713i

Columns 13 through 14

-0.9771 - 0.2126i -0.9369 - 0.3495i

Columns 15 through 16

-0.8777 - 0.4792i -0.8005 - 0.5993i

Columns 17 through 18

-0.7071 - 0.7071i -0.5993 - 0.8005i

Columns 19 through 20

-0.4792 - 0.8777i -0.3495 - 0.9369i

Columns 21 through 22

-0.2126 - 0.9771i -0.0713 - 0.9975i

Columns 23 through 24

0.0713 - 0.9975i 0.2126 - 0.9771i


Columns 25 through 26

0.3495 - 0.9369i 0.4792 - 0.8777i

Columns 27 through 28

0.5993 - 0.8005i 0.7071 - 0.7071i

Columns 29 through 30

0.8005 - 0.5993i 0.8777 - 0.4792i

Columns 31 through 32

0.9369 - 0.3495i 0.9771 - 0.2126i

Columns 33 through 34

0.9975 - 0.0713i 0.9975 + 0.0713i

Columns 35 through 36

0.9771 + 0.2126i 0.9369 + 0.3495i

Columns 37 through 38

0.8777 + 0.4792i 0.8005 + 0.5993i

Columns 39 through 40

0.7071 + 0.7071i 0.5993 + 0.8005i


Columns 41 through 42

0.4792 + 0.8777i 0.3495 + 0.9369i

Columns 43 through 44

0.2126 + 0.9771i 0.0713 + 0.9975i

>> sk = R*ph

sk =

Columns 1 through 2

-0.0708 + 0.9892i -0.2108 + 0.9691i

Columns 3 through 4

-0.3466 + 0.9292i -0.4753 + 0.8704i

Columns 5 through 6

-0.5943 + 0.7939i -0.7013 + 0.7013i

Columns 7 through 8

-0.7939 + 0.5943i -0.8704 + 0.4753i

Columns 9 through 10

-0.9292 + 0.3466i -0.9691 + 0.2108i


Columns 11 through 12

-0.9892 + 0.0708i -0.9892 - 0.0708i

Columns 13 through 14

-0.9691 - 0.2108i -0.9292 - 0.3466i

Columns 15 through 16

-0.8704 - 0.4753i -0.7939 - 0.5943i

Columns 17 through 18

-0.7013 - 0.7013i -0.5943 - 0.7939i

Columns 19 through 20

-0.4753 - 0.8704i -0.3466 - 0.9292i

Columns 21 through 22

-0.2108 - 0.9691i -0.0708 - 0.9892i

Columns 23 through 24

0.0708 - 0.9892i 0.2108 - 0.9691i

Columns 25 through 26

0.3466 - 0.9292i 0.4753 - 0.8704i


Columns 27 through 28

0.5943 - 0.7939i 0.7013 - 0.7013i

Columns 29 through 30

0.7939 - 0.5943i 0.8704 - 0.4753i

Columns 31 through 32

0.9292 - 0.3466i 0.9691 - 0.2108i

Columns 33 through 34

0.9892 - 0.0708i 0.9892 + 0.0708i

Columns 35 through 36

0.9691 + 0.2108i 0.9292 + 0.3466i

Columns 37 through 38

0.8704 + 0.4753i 0.7939 + 0.5943i

Columns 39 through 40

0.7013 + 0.7013i 0.5943 + 0.7939i

Columns 41 through 42

0.4753 + 0.8704i 0.3466 + 0.9292i


Columns 43 through 44

0.2108 + 0.9691i 0.0708 + 0.9892i

>> sp = sk(1:22)

sp =

Columns 1 through 2

-0.0708 + 0.9892i -0.2108 + 0.9691i

Columns 3 through 4

-0.3466 + 0.9292i -0.4753 + 0.8704i

Columns 5 through 6

-0.5943 + 0.7939i -0.7013 + 0.7013i

Columns 7 through 8

-0.7939 + 0.5943i -0.8704 + 0.4753i

Columns 9 through 10

-0.9292 + 0.3466i -0.9691 + 0.2108i

Columns 11 through 12

-0.9892 + 0.0708i -0.9892 - 0.0708i


Columns 13 through 14

-0.9691 - 0.2108i -0.9292 - 0.3466i

Columns 15 through 16

-0.8704 - 0.4753i -0.7939 - 0.5943i

Columns 17 through 18

-0.7013 - 0.7013i -0.5943 - 0.7939i

Columns 19 through 20

-0.4753 - 0.8704i -0.3466 - 0.9292i

Columns 21 through 22

-0.2108 - 0.9691i -0.0708 - 0.9892i

>> P = poly(sp)

P=

1.0e+04 *

Columns 1 through 2

0.0001 + 0.0000i 0.0014 - 0.0000i


Columns 3 through 4

0.0097 - 0.0000i 0.0446 - 0.0000i

Columns 5 through 6

0.1535 - 0.0000i 0.4180 - 0.0000i

Columns 7 through 8

0.9349 - 0.0000i 1.7599 - 0.0000i

Columns 9 through 10

2.8334 - 0.0000i 3.9447 - 0.0000i

Columns 11 through 12

4.7824 - 0.0000i 5.0692 - 0.0000i

Columns 13 through 14

4.7038 - 0.0000i 3.8161 - 0.0000i

Columns 15 through 16

2.6960 - 0.0000i 1.6470 - 0.0000i


Columns 17 through 18

0.8606 - 0.0000i 0.3784 - 0.0000i

Columns 19 through 20

0.1367 - 0.0000i 0.0391 - 0.0000i

Columns 21 through 22

0.0083 - 0.0000i 0.0012 - 0.0000i

Column 23

0.0001 - 0.0000i

>> %Ora ragioniamo su Chebyshev

>> N_chebyshev = 9

N_chebyshev =

>> %Calcoliamo i coefficienti a e b


>> a = (((1+sqrt(1+(0.5)^2))/0.508)^(1/9)-((sqrt(1+(0.5)^2))/0.508)^(-1/9))/2
a=

0.1279

>> b = (((1+sqrt(1+(0.5)^2))/0.508)^(1/9)+((sqrt(1+(0.5)^2))/0.508)^(-1/9))/2

b=

1.0440

>> k_chebyshev = (1: N_chebyshev)

k_chebyshev =

Columns 1 through 7

1 2 3 4 5 6 7

Columns 8 through 9

8 9

>> K_chebyshev = k_chebyshev*2

K_chebyshev =

Columns 1 through 7

2 4 6 8 10 12 14

Columns 8 through 9
16 18

%pk è la parte reale dei poli

>> pk = -a*sin(((2*K_chebyshev-1)*pi)/18)

pk =

Columns 1 through 4

-0.0640 -0.1202 -0.1202 -0.0640

Columns 5 through 8

0.0222 0.0980 0.1279 0.0980

Column 9

0.0222

>> wk = b*cos(((2*K_chebyshev-1)*pi)/18)

wk =

Columns 1 through 4

0.9041 0.3571 -0.3571 -0.9041

Columns 5 through 8

-1.0281 -0.6711 -0.0000 0.6711


Column 9

1.0281

>> poly_chebyshev = pk+i*wk

poly_chebyshev =

Columns 1 through 2

-0.0640 + 0.9041i -0.1202 + 0.3571i

Columns 3 through 4

-0.1202 - 0.3571i -0.0640 - 0.9041i

Columns 5 through 6

0.0222 - 1.0281i 0.0980 - 0.6711i

Columns 7 through 8

0.1279 - 0.0000i 0.0980 + 0.6711i

Column 9

0.0222 + 1.0281i

>> Polinomio_chebyshev = poly(poly_chebyshev)


Polinomio_chebyshev =

Columns 1 through 2

1.0000 + 0.0000i 0.0000 + 0.0000i

Columns 3 through 4

2.4155 + 0.0000i 0.0000 - 0.0000i

Columns 5 through 6

1.9449 - 0.0000i 0.0000 + 0.0000i

Columns 7 through 8

0.5800 - 0.0000i -0.0000 - 0.0000i

Columns 9 through 10

0.0467 + 0.0000i -0.0073 + 0.0000i

>>

You might also like